Added sm_length back as parameteres as it should be

This commit is contained in:
2015-04-06 23:14:41 +02:00
parent 4b43a92da5
commit 71f9deca8e
2 changed files with 12 additions and 5 deletions
+2 -2
View File
@@ -1189,7 +1189,7 @@ cmds = {
replace_if_present_flag: {type: types.int8}, replace_if_present_flag: {type: types.int8},
data_coding: {type: types.int8}, data_coding: {type: types.int8},
sm_default_msg_id: {type: types.int8}, sm_default_msg_id: {type: types.int8},
//sm_length: {type: types.int8}, sm_length: {type: types.int8},
short_message: {type: types.buffer, filter: filters.message} short_message: {type: types.buffer, filter: filters.message}
} }
}, },
@@ -1259,7 +1259,7 @@ cmds = {
validity_period: {type: types.cstring, filter: filters.time}, validity_period: {type: types.cstring, filter: filters.time},
registered_delivery: {type: types.int8}, registered_delivery: {type: types.int8},
sm_default_msg_id: {type: types.int8}, sm_default_msg_id: {type: types.int8},
//sm_length: {type: types.int8}, sm_length: {type: types.int8},
short_message: {type: types.buffer, filter: filters.message} short_message: {type: types.buffer, filter: filters.message}
} }
}, },
+10 -3
View File
@@ -48,7 +48,7 @@ function pduToObj(pdu, callback) {
offset, offset,
command, command,
param, param,
tlvCmdId, //tlvCmdId,
paramSize; paramSize;
// Returns true if this PDU is a response to another PDU // Returns true if this PDU is a response to another PDU
@@ -128,6 +128,8 @@ function pduToObj(pdu, callback) {
// If the length is greater than the current offset, there must be TLVs - resolve them! // If the length is greater than the current offset, there must be TLVs - resolve them!
if (offset < retObj.cmdLength) { if (offset < retObj.cmdLength) {
console.log('TLVs found yo! :D Implement us'); console.log('TLVs found yo! :D Implement us');
console.log('TLV hex: ' + pdu.slice(offset, retObj.cmdLength).toString('hex'));
/*
console.log(pdu.length); console.log(pdu.length);
console.log(retObj.cmdLength); console.log(retObj.cmdLength);
console.log(offset); console.log(offset);
@@ -138,9 +140,9 @@ function pduToObj(pdu, callback) {
console.log('tlvCmdId:'); console.log('tlvCmdId:');
console.log(tlvCmdId); console.log(tlvCmdId);
process.exit();
offset ++; //erh... not really, do something more nice! :) offset ++; //erh... not really, do something more nice! :)
*/
} }
// Decode the short message if it is set // Decode the short message if it is set
@@ -384,7 +386,7 @@ function session(sock) {
* Always use this function to close the socket so we get it on log * Always use this function to close the socket so we get it on log
*/ */
sessionEmitter.closeSocket = function() { sessionEmitter.closeSocket = function() {
log.debug('larvitsmpp: session() - closeSocket() - Closing socket for ' + sock.remoteAddress + ':' + sock.remotePort); log.verbose('larvitsmpp: session() - closeSocket() - Closing socket for ' + sock.remoteAddress + ':' + sock.remotePort);
if (sessionEmitter.enqLinkTimer) { if (sessionEmitter.enqLinkTimer) {
clearTimeout(sessionEmitter.enqLinkTimer); clearTimeout(sessionEmitter.enqLinkTimer);
} }
@@ -551,6 +553,11 @@ function session(sock) {
'short_message': smsOptions.message 'short_message': smsOptions.message
}; };
// Request DLRs!
if (smsOptions.dlr) {
pduObj.params.registered_delivery = 0x01;
}
sessionEmitter.send(pduObj, callback); sessionEmitter.send(pduObj, callback);
}; };