Added event for login as well as original dlr pdus in the response callback

This commit is contained in:
2015-06-16 21:46:15 +02:00
parent d7b54b6dde
commit 6884c72346
4 changed files with 8 additions and 3 deletions
+2
View File
@@ -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);
}
+1
View File
@@ -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
+4 -2
View File
@@ -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
+1 -1
View File
@@ -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": {