diff --git a/lib/server.js b/lib/server.js index 33d7dd6..4c2851a 100644 --- a/lib/server.js +++ b/lib/server.js @@ -61,6 +61,7 @@ function login(pduObj) { } that.sock.resume(); + that.emit('login'); that.sendReturn(pduObj); }); @@ -70,6 +71,7 @@ function login(pduObj) { // If we arrived here it means we are not logged in and that a bind_* event happened and no checkuserpass() method exists. Lets login! this.loggedIn = true; this.sock.resume(); + this.emit('login'); this.sendReturn(pduObj); } diff --git a/lib/session.js b/lib/session.js index dbc644e..fafafc8 100644 --- a/lib/session.js +++ b/lib/session.js @@ -489,6 +489,7 @@ function session(sock) { returnObj.send = send; returnObj.sendReturn = sendReturn; returnObj.sendSms = sendSms; + returnObj.utils = utils; // Temporary storage for long sms parts // These should be cleared if they lingre to long to avoid memory leaks diff --git a/lib/utils.js b/lib/utils.js index 7c8ccc5..e71130d 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -692,7 +692,7 @@ function splitMsg(msg) { * This must be called from an sms object context * * @param str status - see list at defs.consts.MESSAGE_STATE - defaults to 'DELIVERED' - * @param func callback(err, retPdu) + * @param func callback(err, retPdu, dlrPduObj) */ function smsDlr(status, callback) { var shortMessage, @@ -767,7 +767,9 @@ function smsDlr(status, callback) { } }; - sms.session.send(dlrPduObj, false, callback); + sms.session.send(dlrPduObj, false, function(err, retPdu) { + callback(err, retPdu, dlrPduObj); + }); } // Expose some functions diff --git a/package.json b/package.json index 6eac857..127a149 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "url": "https://github.com/larvit/larvitsmpp", "type": "git" }, - "version": "0.1.6", + "version": "0.1.7", "readmeFilename": "README.md", "readme": "larvitsmpp", "bugs": {