Commit 5f8f49a459a90ddeb40d2d56b445cdf319dc79f3

Authored by Adhidarma Hadiwinoto
1 parent fd31f25c10
Exists in master and in 1 other branch webadmin

modem.outgoing

Showing 2 changed files with 7 additions and 1 deletions Side-by-side Diff

... ... @@ -14,6 +14,7 @@
14 14 {
15 15 "name": "SENDER-AS13",
16 16 "disabled": true,
  17 + "outgoing": true,
17 18 "imsi": null,
18 19 "prefix": []
19 20 }
... ... @@ -14,8 +14,13 @@ exports.enabledModems = (arrayOfModem) => {
14 14 return modems.filter((modem) => !modem.disabled);
15 15 };
16 16  
  17 +exports.outgoingModems = (arrayOfModem) => {
  18 + const modems = arrayOfModem || config.modems || [];
  19 + return modems.filter((modem) => !modem.disabled && modem.outgoing);
  20 +};
  21 +
17 22 exports.randomModem = (arrayOfModem) => {
18   - const modems = this.enabledModems(arrayOfModem);
  23 + const modems = this.outgoingModems(arrayOfModem);
19 24 const modemCount = modems.count;
20 25  
21 26 if (!modemCount) return null;