Commit 7f2cc9f7e58f864a312e879e87372e7f6f9c465b
1 parent
06ff0a91c0
Exists in
master
IMSI dan MSISDN pada report ke core
Showing 1 changed file with 15 additions and 3 deletions Side-by-side Diff
lib/partner-mkios.js
... | ... | @@ -262,7 +262,7 @@ function unsuspendPull() { |
262 | 262 | if (matrix.not_ready_ts) { |
263 | 263 | matrix.not_ready_max_age_secs = Math.max( (new Date() - matrix.not_ready_ts) / 1000, matrix.not_ready_max_age_secs ); |
264 | 264 | } |
265 | - | |
265 | + | |
266 | 266 | logger.verbose('Modem is ready'); |
267 | 267 | } |
268 | 268 | |
... | ... | @@ -316,11 +316,23 @@ function buy(task) { |
316 | 316 | }); |
317 | 317 | modem.sendUSSD(ussd_command, function() {}); |
318 | 318 | }) |
319 | - | |
320 | - | |
321 | 319 | } |
322 | 320 | |
323 | 321 | function report(data) { |
322 | + if (data.message) { | |
323 | + if (matrix.modem.imsi) { | |
324 | + data.message = 'CHIP-IMSI: ' + matrix.modem.imsi + '; '; | |
325 | + } | |
326 | + | |
327 | + let msisdn = config.partner.msisdn; | |
328 | + if (msisdn && (typeof msisdn === 'object')) { | |
329 | + msisdn = msisdn[matrix.modem.imsi]; | |
330 | + } | |
331 | + | |
332 | + if (msisdn) { | |
333 | + data.message = 'CHIP-MSISDN: ' + msisdn + '; '; | |
334 | + } | |
335 | + } | |
324 | 336 | pullgw.report(data); |
325 | 337 | } |
326 | 338 |