Commit 527c38f99710f8eb446c5cfbff15d2567ed718a1
1 parent
2f33e12d0e
Exists in
master
ModemData._ts
Showing 2 changed files with 7 additions and 1 deletions Side-by-side Diff
lib/apiserver/index.js
... | ... | @@ -57,6 +57,8 @@ function onIncomingSms(req, res) { |
57 | 57 | name: req.query.modem, |
58 | 58 | imsi: req.query.modem_imsi, |
59 | 59 | msisdn: req.query.modem_msisdn, |
60 | + device: req.query.modem_device, | |
61 | + uptime: req.query.uptime, | |
60 | 62 | reportIp: req.query.report_ip || req.ip, |
61 | 63 | reportPort: req.query.report_port, |
62 | 64 | reportApikey: req.query.report_apikey, |
lib/modems2.js
... | ... | @@ -13,6 +13,8 @@ const modemList = { |
13 | 13 | * @property {string} name - nama modem |
14 | 14 | * @property {string} imsi - IMSI modem |
15 | 15 | * @property {string} msisdn - MSISDN modem |
16 | + * @property {number} uptime - modem uptime in seconds | |
17 | + * @property {string} device - modem device path | |
16 | 18 | * @property {string} reportIp - IP modem |
17 | 19 | * @property {number} reportPort - TCP port modem |
18 | 20 | * @property {string} reportApikey - APIKEY modem |
... | ... | @@ -64,7 +66,9 @@ function touchByMSISDN(val) { |
64 | 66 | * @see ModemData |
65 | 67 | */ |
66 | 68 | function touch(val) { |
67 | - if (!val) return; | |
69 | + if (!val || typeof val !== 'object') return; | |
70 | + | |
71 | + val._ts = new Date(); | |
68 | 72 | |
69 | 73 | if (!val.reportIp) { |
70 | 74 | val.reportIp = '127.0.0.1'; |