[PATCH] SMPP sequence_number

"Angel Fradejas" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi all,

Find attached a patch to set correctly the sequence_number field of the PDU
header. According to SMPP 3.3 and 3.4 specs, it must be in the 1-N range,
but currently it is in the 0-N range.

This causes problems with one of our providers, wich refuses to ack our
first bind_transmitter (with a 0 sequence_number).

Also attached is a bearerbox.log showing the problem.

Angel Fradejas
Mediafusión España, S.A.
[email protected]
www.mediafusion.es
Tel. +34 91 252 32 00
Fax  +34 91 572 27 08
smsc_smpp.patch (application/octet-stream, 756 B)
Index: gw/smsc/smsc_smpp.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_smpp.c,v
retrieving revision 1.8
diff -u -r1.8 smsc_smpp.c
--- gw/smsc/smsc_smpp.c	4 Sep 2002 17:08:52 -0000	1.8
+++ gw/smsc/smsc_smpp.c	6 Sep 2002 09:26:22 -0000
@@ -126,7 +126,8 @@
     smpp->sent_msgs = dict_create(16, NULL); 
     list_add_producer(smpp->msgs_to_send); 
     smpp->received_msgs = list_create(); 
-    smpp->message_id_counter = counter_create(); 
+    smpp->message_id_counter = counter_create();
+    counter_increase(smpp->message_id_counter); 
     smpp->host = octstr_duplicate(host); 
     smpp->system_type = octstr_duplicate(system_type); 
     smpp->username = octstr_duplicate(username);
bearerbox.log (application/octet-stream, 5 KB)
2002-09-06 09:00:40 [0] INFO: MAIN: Start-up done, entering mainloop
2002-09-06 09:00:40 [0] DEBUG: smsc_fake: start called
2002-09-06 09:00:40 [0] DEBUG: smsc_fake: start called
2002-09-06 09:00:40 [9] DEBUG: sms_router: time to sleep
2002-09-06 09:00:40 [9] DEBUG: sms_router: list_len = 0
2002-09-06 09:00:40 [7] DEBUG: SMPP[test]: Sending PDU:
2002-09-06 09:00:40 [7] DEBUG: SMPP PDU 0x8280778 dump:
2002-09-06 09:00:40 [7] DEBUG:   type_name: bind_transmitter
2002-09-06 09:00:40 [7] DEBUG:   command_id: 2 = 0x00000002
2002-09-06 09:00:40 [7] DEBUG:   command_status: 0 = 0x00000000
2002-09-06 09:00:40 [7] DEBUG:   sequence_number: 0 = 0x00000000
2002-09-06 09:00:40 [7] DEBUG:   system_id: "xxx"
2002-09-06 09:00:40 [7] DEBUG:   password: "xxx"
2002-09-06 09:00:40 [7] DEBUG:   system_type: ""
2002-09-06 09:00:40 [7] DEBUG:   interface_version: 51 = 0x00000033
2002-09-06 09:00:40 [7] DEBUG:   addr_ton: 0 = 0x00000000
2002-09-06 09:00:40 [7] DEBUG:   addr_npi: 0 = 0x00000000
2002-09-06 09:00:40 [7] DEBUG:   address_range: NULL
2002-09-06 09:00:40 [7] DEBUG: SMPP PDU dump ends.
2002-09-06 09:00:40 [8] DEBUG: SMPP[test]: Sending PDU:
2002-09-06 09:00:40 [8] DEBUG: SMPP PDU 0x826fac8 dump:
2002-09-06 09:00:40 [8] DEBUG:   type_name: bind_receiver
2002-09-06 09:00:40 [8] DEBUG:   command_id: 1 = 0x00000001
2002-09-06 09:00:40 [8] DEBUG:   command_status: 0 = 0x00000000
2002-09-06 09:00:40 [8] DEBUG:   sequence_number: 1 = 0x00000001
2002-09-06 09:00:40 [8] DEBUG:   system_id: "xxx"
2002-09-06 09:00:40 [8] DEBUG:   password: "xxx"
2002-09-06 09:00:40 [8] DEBUG:   system_type: ""
2002-09-06 09:00:40 [8] DEBUG:   interface_version: 51 = 0x00000033
2002-09-06 09:00:40 [8] DEBUG:   addr_ton: 0 = 0x00000000
2002-09-06 09:00:40 [8] DEBUG:   addr_npi: 0 = 0x00000000
2002-09-06 09:00:40 [8] DEBUG:   address_range: NULL
2002-09-06 09:00:40 [8] DEBUG: SMPP PDU dump ends.
2002-09-06 09:00:40 [8] DEBUG: SMPP[test]: Got PDU:
2002-09-06 09:00:40 [8] DEBUG: SMPP PDU 0x82609d8 dump:
2002-09-06 09:00:40 [8] DEBUG:   type_name: bind_receiver_resp
2002-09-06 09:00:40 [8] DEBUG:   command_id: 2147483649 = 0x80000001
2002-09-06 09:00:40 [8] DEBUG:   command_status: 0 = 0x00000000
2002-09-06 09:00:40 [8] DEBUG:   sequence_number: 1 = 0x00000001
2002-09-06 09:00:40 [8] DEBUG: SMPP PDU dump ends.
2002-09-06 09:00:43 [4] DEBUG: Started thread 10 (gw/bb_boxc.c:function)
2002-09-06 09:00:43 [10] INFO: Client connected from <127.0.0.1>
2002-09-06 09:00:43 [10] DEBUG: Started thread 11 (gw/bb_boxc.c:boxc_sender)
2002-09-06 09:00:45 [7] ERROR: SMPP[test]: I/O error or other error. Re-connecting.
2002-09-06 09:00:45 [8] ERROR: SMPP[test]: I/O error or other error. Re-connecting.
2002-09-06 09:00:46 [7] DEBUG: SMPP[test]: Sending PDU:
2002-09-06 09:00:46 [7] DEBUG: SMPP PDU 0x8271950 dump:
2002-09-06 09:00:46 [7] DEBUG:   type_name: bind_transmitter
2002-09-06 09:00:46 [7] DEBUG:   command_id: 2 = 0x00000002
2002-09-06 09:00:46 [7] DEBUG:   command_status: 0 = 0x00000000
2002-09-06 09:00:46 [7] DEBUG:   sequence_number: 2 = 0x00000002
2002-09-06 09:00:46 [7] DEBUG:   system_id: "xxx"
2002-09-06 09:00:46 [7] DEBUG:   password: "xxx"
2002-09-06 09:00:46 [7] DEBUG:   system_type: ""
2002-09-06 09:00:46 [7] DEBUG:   interface_version: 51 = 0x00000033
2002-09-06 09:00:46 [7] DEBUG:   addr_ton: 0 = 0x00000000
2002-09-06 09:00:46 [7] DEBUG:   addr_npi: 0 = 0x00000000
2002-09-06 09:00:46 [7] DEBUG:   address_range: NULL
2002-09-06 09:00:46 [7] DEBUG: SMPP PDU dump ends.
2002-09-06 09:00:46 [8] DEBUG: SMPP[test]: Sending PDU:
2002-09-06 09:00:46 [8] DEBUG: SMPP PDU 0x8271fd0 dump:
2002-09-06 09:00:46 [8] DEBUG:   type_name: bind_receiver
2002-09-06 09:00:46 [8] DEBUG:   command_id: 1 = 0x00000001
2002-09-06 09:00:46 [8] DEBUG:   command_status: 0 = 0x00000000
2002-09-06 09:00:46 [8] DEBUG:   sequence_number: 3 = 0x00000003
2002-09-06 09:00:46 [8] DEBUG:   system_id: "xxx"
2002-09-06 09:00:46 [8] DEBUG:   password: "xxx"
2002-09-06 09:00:46 [8] DEBUG:   system_type: ""
2002-09-06 09:00:46 [8] DEBUG:   interface_version: 51 = 0x00000033
2002-09-06 09:00:46 [8] DEBUG:   addr_ton: 0 = 0x00000000
2002-09-06 09:00:46 [8] DEBUG:   addr_npi: 0 = 0x00000000
2002-09-06 09:00:46 [8] DEBUG:   address_range: NULL
2002-09-06 09:00:46 [8] DEBUG: SMPP PDU dump ends.
2002-09-06 09:00:46 [7] DEBUG: SMPP[test]: Got PDU:
2002-09-06 09:00:46 [7] DEBUG: SMPP PDU 0x8266078 dump:
2002-09-06 09:00:46 [7] DEBUG:   type_name: bind_transmitter_resp
2002-09-06 09:00:46 [7] DEBUG:   command_id: 2147483650 = 0x80000002
2002-09-06 09:00:46 [7] DEBUG:   command_status: 0 = 0x00000000
2002-09-06 09:00:46 [7] DEBUG:   sequence_number: 2 = 0x00000002
2002-09-06 09:00:46 [7] DEBUG: SMPP PDU dump ends.
2002-09-06 09:00:46 [8] DEBUG: SMPP[test]: Got PDU:
2002-09-06 09:00:46 [8] DEBUG: SMPP PDU 0x8272330 dump:
2002-09-06 09:00:46 [8] DEBUG:   type_name: bind_receiver_resp
2002-09-06 09:00:46 [8] DEBUG:   command_id: 2147483649 = 0x80000001
2002-09-06 09:00:46 [8] DEBUG:   command_status: 0 = 0x00000000
2002-09-06 09:00:46 [8] DEBUG:   sequence_number: 3 = 0x00000003
2002-09-06 09:00:46 [8] DEBUG: SMPP PDU dump ends.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.