Daily patch: gateway

kannel at kannel.org kannel at kannel.org
Fri Apr 8 06:30:03 CEST 2011


Index: gwlib/cfg.def
===================================================================
--- gwlib/cfg.def	(revision 4897)
+++ gwlib/cfg.def	(revision 4899)
@@ -84,6 +84,7 @@
     OCTSTR(admin-allow-ip)
     OCTSTR(smsbox-port)
     OCTSTR(smsbox-port-ssl)
+    OCTSTR(smsbox-interface)
     OCTSTR(smsbox-max-pending)
     OCTSTR(wapbox-port)
     OCTSTR(wapbox-port-ssl)
Index: doc/userguide/userguide.xml
===================================================================
--- doc/userguide/userguide.xml	(revision 4897)
+++ doc/userguide/userguide.xml	(revision 4899)
@@ -1218,6 +1218,12 @@
      </entry></row>
     <row><entry><literal>admin-allow-ip</literal></entry></row>
 
+     <row><entry><literal>smsbox-interface (o)</literal></entry>
+     <entry>string</entry>
+     <entry valign="bottom">
+        If this is set, the smsbox listener will only bind
+        to a specified address. For example: "127.0.0.1".
+     </entry></row>
 
     <row><entry><literal>smsbox-port (c)</literal></entry>
      <entry>port-number</entry>
@@ -5727,6 +5733,13 @@
 		  specific smsbox instance, i.e. SMPP or EMI proxying boxes.
      </entry></row>
 
+     <row><entry><literal>sendsms-interface (o)</literal></entry>
+     <entry>string</entry>
+     <entry valign="bottom">
+        If this is set, the sendsms HTTP interface will only bind
+        to a specified address. For example: "127.0.0.1".
+     </entry></row>
+
     <row><entry><literal>sendsms-port (c)</literal></entry>
      <entry>port-number</entry>
      <entry valign="bottom">
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 4897)
+++ ChangeLog	(revision 4899)
@@ -1,3 +1,13 @@
+2011-04-07 Alexander Malysh <amalysh at kannel.org>
+    * fixed kannel monitor web interface after r4897.
+      This close #594.
+      Thanks to Roland Discein.
+
+2011-04-07 Alexander Malysh <amalysh at kannel.org>
+    * applied patch that adds support for limiting listening for smsbox connections
+      to specific interface.
+      Thanks to Roman Shterenzon <romanbsd at yahoo.com>.
+
 2011-04-05 Alexander Malysh <amalysh at kannel.org>
     * gw/bb_smscconn.c: fixed last commit.
 
Index: contrib/kannel-monitor/index.php
===================================================================
--- contrib/kannel-monitor/index.php	(revision 4897)
+++ contrib/kannel-monitor/index.php	(revision 4899)
@@ -360,10 +360,10 @@
     </td>
     <td><?php echo format_status($st) ?></td>
     <td><?php echo $uptime ?></td>
-    <td><?php echo nf($smsc['received']['sms']) ?></td>
-    <td><?php echo nf($smsc['received']['dlr']) ?></td>
-    <td><?php echo nf($smsc['sent']['sms']) ?></td>
-    <td><?php echo nf($smsc['sent']['dlr']) ?></td>
+    <td><?php echo nf($smsc['sms'][0]['received']) ?></td>
+    <td><?php echo nf($smsc['dlr'][0]['received']) ?></td>
+    <td><?php echo nf($smsc['sms'][0]['sent']) ?></td>
+    <td><?php echo nf($smsc['dlr'][0]['sent']) ?></td>
     <td><?php echo nf($smsc['failed']) ?></td>
     <td><?php echo nf($smsc['queued']) ?></td>
     <td>
Index: gw/bb_boxc.c
===================================================================
--- gw/bb_boxc.c	(revision 4897)
+++ gw/bb_boxc.c	(revision 4899)
@@ -114,6 +114,7 @@
 
 static long	smsbox_port;
 static int smsbox_port_ssl;
+static Octstr *smsbox_interface;
 static long	wapbox_port;
 static int wapbox_port_ssl;
 
@@ -993,17 +994,15 @@
 static void smsboxc_run(void *arg)
 {
     int fd;
-    int port;
 
     gwlist_add_producer(flow_threads);
     gwthread_wakeup(MAIN_THREAD_ID);
-    port = (int) *((long *)arg);
 
-    fd = make_server_socket(port, NULL);
+    fd = make_server_socket(smsbox_port, smsbox_interface ? octstr_get_cstr(smsbox_interface) : NULL);
     /* XXX add interface_name if required */
 
     if (fd < 0) {
-        panic(0, "Could not open smsbox port %d", port);
+        panic(0, "Could not open smsbox port %ld", smsbox_port);
     }
 
     /*
@@ -1222,6 +1221,8 @@
     if (smsbox_port_ssl)
         debug("bb", 0, "smsbox connection module is SSL-enabled");
 
+    smsbox_interface = cfg_get(grp, octstr_imm("smsbox-interface"));
+
     if (cfg_get_integer(&smsbox_max_pending, grp, octstr_imm("smsbox-max-pending")) == -1) {
         smsbox_max_pending = SMSBOX_MAX_PENDING;
         info(0, "BOXC: 'smsbox-max-pending' not set, using default (%ld).", smsbox_max_pending);
@@ -1258,7 +1259,7 @@
     if ((sms_dequeue_thread = gwthread_create(sms_to_smsboxes, NULL)) == -1)
  	    panic(0, "Failed to start a new thread for smsbox routing");
 
-    if (gwthread_create(smsboxc_run, &smsbox_port) == -1)
+    if (gwthread_create(smsboxc_run, NULL) == -1)
 	    panic(0, "Failed to start a new thread for smsbox connections");
 
     return 0;
@@ -1470,6 +1471,8 @@
     box_deny_ip = NULL;
     counter_destroy(boxid);
     boxid = NULL;
+    octstr_destroy(smsbox_interface);
+    smsbox_interface = NULL;
 }
 
 






More information about the devel-reports mailing list