[PATCH] smppbox :: ton/npi configuration

Victor Luchitz <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hello!

Please consider merging the patch attached, which makes ton and npi
for both source and destination configurable - using 0 for both by
default isn't the best of options in my opinion. Thanks in advance.

-- 
Best regards,
 Victor Luchitz
ton_npi_cfg.diff (application/octet-stream, 1.6 KB)
Index: smppbox.c
===================================================================
--- smppbox.c	(revision 18)
+++ smppbox.c	(working copy)
@@ -101,6 +101,11 @@
 static Dict *list_dict;
 static Counter *catenated_sms_counter;
 static long sms_max_length = MAX_SMS_OCTETS;
+static long smpp_source_addr_ton = 0;
+static long smpp_source_addr_npi = 0;
+static long smpp_autodetect_addr = 0;
+static long smpp_dest_addr_ton = 0;
+static long smpp_dest_addr_npi = 0;
 
 Octstr *smppbox_id;
 Octstr *our_system_id;
@@ -1382,11 +1387,13 @@
     boxc->route_to_smsc = route_to_smsc ? octstr_duplicate(route_to_smsc) : NULL;
 
     boxc->service_type = NULL;
-    boxc->source_addr_ton = 0;
-    boxc->source_addr_npi = 0;
-    boxc->autodetect_addr = 0;
-    boxc->dest_addr_ton = 0;
-    boxc->dest_addr_npi = 0;
+
+    boxc->source_addr_ton = smpp_source_addr_ton;
+    boxc->source_addr_npi = smpp_source_addr_npi;
+    boxc->autodetect_addr = smpp_autodetect_addr;
+    boxc->dest_addr_ton = smpp_dest_addr_ton;
+    boxc->dest_addr_npi = smpp_dest_addr_npi;
+
     boxc->alt_dcs = 0;
     boxc->validityperiod = 0;
     boxc->priority = 0;
@@ -1884,6 +1891,12 @@
 		octstr_destroy(logfile);
 	}
 
+	cfg_get_integer(&smpp_source_addr_ton, grp, octstr_imm("src-addr-ton"));
+	cfg_get_integer(&smpp_source_addr_npi, grp, octstr_imm("src-addr-npi"));
+	cfg_get_integer(&smpp_autodetect_addr, grp, octstr_imm("src-addr-auto"));
+	cfg_get_integer(&smpp_dest_addr_ton, grp, octstr_imm("dst-addr-ton"));
+	cfg_get_integer(&smpp_dest_addr_npi, grp, octstr_imm("dst-addr-npi"));
+
 	catenated_sms_counter = counter_create();
         boxid = counter_create();
 	gw_smpp_enter(cfg);
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.