Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
bug fix (incorrect if condition); renamed variables for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
bjyoungblood committed Jan 23, 2011
1 parent 0ec3ee7 commit f1dee67
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/smpp.js
Expand Up @@ -53,7 +53,7 @@ exports.command_ids = { // Use command_ids to look
0x80000103: 'data_sm_resp'
};

// Reverse coomand_ids into commands so we can have easy lookup either way!
// Reverse command_ids into commands so we can have easy lookup either way!
for (var command_id in exports.command_ids) {
exports.commands[ exports.command_ids[command_id] ] = parseInt(command_id);
}
Expand All @@ -78,18 +78,19 @@ for (var command_id in exports.command_ids) {
* things done, I'm not going to implement it right now. -- Ben
*/
exports.submit_sm_resp = function(sequence_number, message_id, cmd_status) {
if (cmd_status == undefined) {
cmd_status = 0x0;
var command_status;
if (cmd_status == undefined || cmd_status == true) {
command_status = 0x0;
} else if (cmd_status == false) {
cmd_status = 0x00000045;
command_status = 0x00000045;
}

if (message_id == undefined) {
message_id = "";
}

var payload = pdu.pack('a' + (message_id.length + 1), message_id);
return pdu.createPdu(exports.commands.submit_sm_resp, sequence_number, payload, cmd_status);
return pdu.createPdu(exports.commands.submit_sm_resp, sequence_number, payload, command_status);
};

exports.bind_resp = function(bind_type, sequence_number, system_id, error_status) {
Expand Down

0 comments on commit f1dee67

Please sign in to comment.