-1 for me.

I think we need to panic if none of both ports are in config file.
Something like:


  cfg_get_integer(&bb_port, grp, octstr_imm("smsbox-port"));
  cfg_get_integer(&bb_port, grp, octstr_imm("bearerbox-port"));
  if ( bb_port == 0)
      panic(0, "Missing or bad 'bearerbox-port' or 'smsbox-port'");

Regards,
Martin

On 7/7/06, Alexander Malysh <[EMAIL PROTECTED]> wrote:
Hi,

please find attached patch that adds two new config options to smsbox
group: bearerbox-port and bearerbox-port-ssl. This patch should help at
external modules at least sqlbox now. This issue was already discussed
on devel ML.

Votes / Comments please.

Thanks,
Alex


Index: doc/userguide/userguide.xml
===================================================================
RCS file: /home/cvs/gateway/doc/userguide/userguide.xml,v
retrieving revision 1.317
diff -a -u -p -r1.317 userguide.xml
--- doc/userguide/userguide.xml 12 Jun 2006 00:40:48 -0000      1.317
+++ doc/userguide/userguide.xml 7 Jul 2006 14:19:18 -0000
@@ -5112,6 +5112,24 @@ ssl-certkey-file
         The machine in which the bearerbox is.
      </entry></row>

+   <row><entry><literal>bearerbox-port (o)</literal></entry>
+     <entry>port-number</entry>
+     <entry valign="bottom">
+        This is the port number to which smsbox will connect bearerbox.
+        If not given <literal>smsbox-port</literal> from core group used.
+     </entry></row>
+
+   <row><entry><literal>bearerbox-port-ssl (o)</literal></entry>
+     <entry>bool</entry>
+     <entry valign="bottom">
+         If set to true, the smsbox connection will be SSL-enabled.
+        Your smsbox will connect using SSL to the bearerbox
+        then. This is used to secure communication between bearerbox
+        and smsboxes in case they are in separate networks operated and
+        the TCP communication is not secured on a lower network layer.
+         If not given <literal>smsbox-port-ssl</literal> from core group used.
+     </entry></row>
+
    <row><entry><literal>smsbox-id (o)</literal></entry>
      <entry>string</entry>
      <entry valign="bottom">
Index: gw/smsbox.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsbox.c,v
retrieving revision 1.266
diff -a -u -p -r1.266 smsbox.c
--- gw/smsbox.c 15 May 2006 18:24:40 -0000      1.266
+++ gw/smsbox.c 7 Jul 2006 14:19:19 -0000
@@ -3335,8 +3335,7 @@ static Cfg *init_smsbox(Cfg *cfg)

     grp = cfg_get_single_group(cfg, octstr_imm("core"));

-    if (cfg_get_integer(&bb_port, grp, octstr_imm("smsbox-port")) == -1)
-       panic(0, "Missing or bad 'smsbox-port' in core group");
+    cfg_get_integer(&bb_port, grp, octstr_imm("smsbox-port"));
 #ifdef HAVE_LIBSSL
     cfg_get_bool(&bb_ssl, grp, octstr_imm("smsbox-port-ssl"));
 #endif /* HAVE_LIBSSL */
@@ -3372,6 +3371,11 @@ static Cfg *init_smsbox(Cfg *cfg)
        octstr_destroy(bb_host);
        bb_host = p;
     }
+    cfg_get_integer(&bb_port, grp, octstr_imm("bearerbox-port"));
+#ifdef HAVE_LIBSSL
+    if (bb_ssl && cfg_get_bool(&bb_ssl, grp, octstr_imm("bearerbox-port-ssl")) 
== -1)
+        bb_ssl = 1;
+#endif /* HAVE_LIBSSL */

     cfg_get_bool(&mo_recode, grp, octstr_imm("mo-recode"));
     if(mo_recode < 0)
Index: gwlib/cfg.def
===================================================================
RCS file: /home/cvs/gateway/gwlib/cfg.def,v
retrieving revision 1.118
diff -a -u -p -r1.118 cfg.def
--- gwlib/cfg.def       9 May 2006 14:32:31 -0000       1.118
+++ gwlib/cfg.def       7 Jul 2006 14:19:20 -0000
@@ -243,6 +243,8 @@ SINGLE_GROUP(configuration,
 SINGLE_GROUP(smsbox,
     OCTSTR(smsbox-id)
     OCTSTR(bearerbox-host)
+    OCTSTR(bearerbox-port)
+    OCTSTR(bearerbox-port-ssl)
     OCTSTR(sendsms-port)
     OCTSTR(sendsms-port-ssl)
     OCTSTR(sendsms-interface)




Reply via email to