Some restructuring etc
This commit is contained in:
+10
-9
@@ -59,17 +59,18 @@ function clientSession(sock, options) {
|
||||
returnObj.login();
|
||||
returnObj.resetEnqLinkTimer();
|
||||
|
||||
// Handle incoming Pdu Objects
|
||||
returnObj.on('incomingPduObj', function(pduObj) {
|
||||
if (pduObj.cmdName === 'deliver_sm') {
|
||||
returnObj.deliverSm(pduObj);
|
||||
} else if (pduObj.cmdName === 'enquire_link') {
|
||||
returnObj.enquireLink();
|
||||
} else if (pduObj.cmdName === 'submit_sm') {
|
||||
returnObj.submitSm(pduObj);
|
||||
} else if (pduObj.cmdName === 'unbind') {
|
||||
returnObj.sendReturn(pduObj, 'ESME_ROK', undefined, true);
|
||||
// Call the appropriate handleCmd function
|
||||
|
||||
if (typeof returnObj.handleCmd[pduObj.cmdName] === 'function') {
|
||||
log.debug('larvitsmpp: lib/client.js: clientSession() - returnObj.on(incomingPduObj) - Running cmd handling function returnObj.handleCmd.' + pduObj.cmdName + '()');
|
||||
|
||||
returnObj.handleCmd[pduObj.cmdName](pduObj);
|
||||
} else {
|
||||
// All other commands we do not support
|
||||
// No command handling function is registered, return error "invalid command"
|
||||
log.info('larvitsmpp: lib/client.js: clientSession() - returnObj.on(incomingPduObj) - No handling function found for command: "' + pduObj.cmdName + '"');
|
||||
|
||||
returnObj.sendReturn(pduObj, 'ESME_RINVCMDID');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user