diff --git a/config.sample.json b/config.sample.json index baa5e68..78a1ad1 100644 --- a/config.sample.json +++ b/config.sample.json @@ -14,6 +14,7 @@ { "name": "SENDER-AS13", "disabled": true, + "outgoing": true, "imsi": null, "prefix": [] } diff --git a/lib/modems.js b/lib/modems.js index f2ee0ed..16f74f1 100644 --- a/lib/modems.js +++ b/lib/modems.js @@ -14,8 +14,13 @@ exports.enabledModems = (arrayOfModem) => { return modems.filter((modem) => !modem.disabled); }; +exports.outgoingModems = (arrayOfModem) => { + const modems = arrayOfModem || config.modems || []; + return modems.filter((modem) => !modem.disabled && modem.outgoing); +}; + exports.randomModem = (arrayOfModem) => { - const modems = this.enabledModems(arrayOfModem); + const modems = this.outgoingModems(arrayOfModem); const modemCount = modems.count; if (!modemCount) return null;