Permalink
Browse files

forgot to implement this method for invalid bind statuses

  • Loading branch information...
bjyoungblood committed Jan 9, 2012
1 parent b1e76c8 commit 2ee787f55cdc6e1150e70a63bdab95568afc889a
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/server-connection.js
View
@@ -121,7 +121,7 @@ var serverConnection = function(socket, server, closeConnectionServerCallback, c
// don't allow anything but bind requests before the client is bound!
if (self.bound === false) {
if (pdu.command_id !== smpp.commands.bind_transceiver && pdu.command_id !== smpp.commands.bind_receiver && pdu.command_id !== smpp.commands.bind_transmitter) {
- self.error_response(pdu);
+ self.error_response(pdu, "ESME_RINVBNDSTS");
continue;
}
}
@@ -160,6 +160,15 @@ var serverConnection = function(socket, server, closeConnectionServerCallback, c
}
};
+ self.error_response = function(pdu, status) {
+ var pdu = {
+ command: 0x80000000 & pdu.command,
+ command_status: status,
+ sequence_number: pdu.sequence_number,
+ fields: {}
+ };
+ };
+
self.generic_nack = function() {
var pdu = {
command: "generic_nack",

0 comments on commit 2ee787f

Please sign in to comment.