From 20c3b87ea7f6e477497fc7fa385e62f05575e580 Mon Sep 17 00:00:00 2001 From: Qasim Ayyaz Khan Date: Fri, 9 Mar 2018 11:27:57 +0000 Subject: [PATCH] Adding random uuid to message id if not assigned. It makes sure that the DLR's are mapped properly for smpp clients. --- lib/session.js | 3 ++- package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/session.js b/lib/session.js index 2879a80..b1fd6fe 100644 --- a/lib/session.js +++ b/lib/session.js @@ -6,6 +6,7 @@ const topLogPrefix = 'larvitsmpp: lib/session.js: ', utils = require('./utils'), async = require('async'), defs = require('./defs'), + uuid = require('uuid/v1'), log = require('winston'); /** @@ -32,7 +33,7 @@ function smsResp(status, cb) { } if (sms.smsId === undefined) { - sms.smsId = ''; + sms.smsId = uuid(); } // Accept a generic positive status diff --git a/package.json b/package.json index 21d4cd2..2415a70 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "iconv-lite": "^0.4.18", "moment": "^2.18.1", "utils-merge": "^1.0.0", + "uuid": "^3.2.1", "winston": "^2.3.1" }, "description": "Simplified SMPP implementation",