Commit 343164ad52125f678efe73867ef8516f5d6251a2
1 parent
0188bfed29
Exists in
master
Repot modem info on report-sender
Showing 2 changed files with 5 additions and 3 deletions Side-by-side Diff
lib/modem.js
... | ... | @@ -76,7 +76,7 @@ async function readSMS(slot) { |
76 | 76 | parserCMGR.on('data', (data) => { |
77 | 77 | if (data) { |
78 | 78 | try { |
79 | - reportSender.incomingSMS(sms.extract(data.toString().trim())); | |
79 | + reportSender.incomingSMS(sms.extract(data.toString().trim()), modemInfo); | |
80 | 80 | } catch (e) { |
81 | 81 | logger.warn(`Exception on reporting new message. ${e.toString()}`, { smsObj: e.smsObj, dataFromModem: data }); |
82 | 82 |
lib/report-sender.js
... | ... | @@ -5,7 +5,7 @@ const request = require('request'); |
5 | 5 | const config = require('komodo-sdk/config'); |
6 | 6 | const logger = require('komodo-sdk/logger'); |
7 | 7 | |
8 | -function incomingSMS(message) { | |
8 | +function incomingSMS(message, modemInfo) { | |
9 | 9 | if (!message || !config || !config.report_url || !config.report_url.incoming_sms) return; |
10 | 10 | |
11 | 11 | if (!message.metadata) { |
... | ... | @@ -29,11 +29,13 @@ function incomingSMS(message) { |
29 | 29 | const requestOptions = { |
30 | 30 | url: config.report_url.incoming_sms, |
31 | 31 | qs: { |
32 | - modem: config.name, | |
33 | 32 | ts: message.metadata.ts, |
34 | 33 | status: message.metadata.status, |
35 | 34 | number: message.metadata.from, |
36 | 35 | msg: message.message, |
36 | + modem: config.name, | |
37 | + modem_imsi: modemInfo.imsi, | |
38 | + modem_msisdn: modemInfo.msisdn, | |
37 | 39 | }, |
38 | 40 | }; |
39 | 41 |