[PATCH] add bind-addr-ton & bind-addr-npi

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi,

attached patch adds possibility to define bind addr ton and npi.

Please vote for commit.


Thanks,
Alex
bind-addr-ton-npi.patch (text/plain, 4.3 KB)
=== doc/userguide/userguide.xml
==================================================================
--- doc/userguide/userguide.xml	(revision 216)
+++ doc/userguide/userguide.xml	(local)
@@ -3166,6 +3166,20 @@
 		(Defaults to 1).
      </entry></row>
 
+    <row><entry><literal>bind-addr-ton</literal></entry>
+      <entry><literal>number</literal></entry>
+      <entry valign="bottom">
+      Optional, bind address TON setting for the link.
+		(Defaults to 0).
+     </entry></row>
+
+    <row><entry><literal>bind-addr-npi</literal></entry>
+      <entry><literal>number</literal></entry>
+      <entry valign="bottom">
+      Optional, bind address NPI setting for the link.
+		(Defaults to 0).
+     </entry></row>
+
    <row><entry><literal>msg-id-type</literal></entry>
      <entry><literal>number</literal></entry>
      <entry valign="bottom">
=== gw/smsc/smsc_smpp.c
==================================================================
--- gw/smsc/smsc_smpp.c	(revision 216)
+++ gw/smsc/smsc_smpp.c	(local)
@@ -146,6 +146,8 @@
     int source_addr_npi; 
     int dest_addr_ton; 
     int dest_addr_npi;
+    long bind_addr_ton;
+    long bind_addr_npi;
     int transmit_port; 
     int receive_port; 
     int quitting; 
@@ -255,6 +257,8 @@
     smpp->connection_timeout = connection_timeout;
     smpp->wait_ack = wait_ack;
     smpp->wait_ack_action = wait_ack_action;
+    smpp->bind_addr_ton = 0;
+    smpp->bind_addr_npi = 0;
  
     return smpp; 
 } 
@@ -1054,6 +1058,8 @@
     bind->u.bind_transmitter.interface_version = smpp->version;
     bind->u.bind_transmitter.address_range =  
     	octstr_duplicate(smpp->address_range); 
+    bind->u.bind_transmitter.addr_ton = smpp->bind_addr_ton;
+    bind->u.bind_transmitter.addr_npi = smpp->bind_addr_npi;
     send_pdu(conn, smpp->conn->id, bind); 
     smpp_pdu_destroy(bind); 
  
@@ -1080,14 +1086,16 @@
  
     bind = smpp_pdu_create(bind_transceiver, 
                            counter_increase(smpp->message_id_counter)); 
-    bind->u.bind_transmitter.system_id = octstr_duplicate(smpp->username); 
-    bind->u.bind_transmitter.password = octstr_duplicate(smpp->password); 
+    bind->u.bind_transceiver.system_id = octstr_duplicate(smpp->username); 
+    bind->u.bind_transceiver.password = octstr_duplicate(smpp->password); 
     if (smpp->system_type == NULL) 
-        bind->u.bind_transmitter.system_type = octstr_create("VMA"); 
+        bind->u.bind_transceiver.system_type = octstr_create("VMA"); 
     else    
-        bind->u.bind_transmitter.system_type = octstr_duplicate(smpp->system_type); 
-    bind->u.bind_transmitter.interface_version = smpp->version;
-    bind->u.bind_transmitter.address_range = octstr_duplicate(smpp->address_range); 
+        bind->u.bind_transceiver.system_type = octstr_duplicate(smpp->system_type); 
+    bind->u.bind_transceiver.interface_version = smpp->version;
+    bind->u.bind_transceiver.address_range = octstr_duplicate(smpp->address_range); 
+    bind->u.bind_transceiver.addr_ton = smpp->bind_addr_ton;
+    bind->u.bind_transceiver.addr_npi = smpp->bind_addr_npi;
     send_pdu(conn, smpp->conn->id, bind); 
     smpp_pdu_destroy(bind); 
  
@@ -1124,6 +1132,8 @@
     bind->u.bind_receiver.interface_version = smpp->version;
     bind->u.bind_receiver.address_range =
         octstr_duplicate(smpp->address_range);
+    bind->u.bind_receiver.addr_ton = smpp->bind_addr_ton;
+    bind->u.bind_receiver.addr_npi = smpp->bind_addr_npi;
     send_pdu(conn, smpp->conn->id, bind);
     smpp_pdu_destroy(bind);
 
@@ -2111,6 +2121,9 @@
                        smpp_msg_id_type, autodetect_addr, alt_charset, alt_addr_charset,
                        service_type, connection_timeout, wait_ack, wait_ack_action); 
  
+    cfg_get_integer(&smpp->bind_addr_ton, grp, octstr_imm("bind-addr-ton"));
+    cfg_get_integer(&smpp->bind_addr_npi, grp, octstr_imm("bind-addr-npi"));
+
     conn->data = smpp; 
     conn->name = octstr_format("SMPP:%S:%d/%d:%S:%S",  
     	    	    	       host, port, 
=== gwlib/cfg.def
==================================================================
--- gwlib/cfg.def	(revision 216)
+++ gwlib/cfg.def	(local)
@@ -345,6 +345,8 @@
     OCTSTR(source-addr-npi)
     OCTSTR(dest-addr-ton)
     OCTSTR(dest-addr-npi)
+    OCTSTR(bind-addr-ton)
+    OCTSTR(bind-addr-npi)
     OCTSTR(service-type)
     OCTSTR(source-addr-autodetect)
     OCTSTR(enquire-link-interval)
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.