Hi,

This patch adds an mmsc field to the send-mms-user section of the configuration 
file for mbuni. The idea is to have a default mmsc in case the CGI Variable is 
not set.

for review,

- Martin -
diff --git a/doc/userguide.shtml b/doc/userguide.shtml
index d08c4fa..b324dcd 100644
--- a/doc/userguide.shtml
+++ b/doc/userguide.shtml
@@ -2660,6 +2660,18 @@ faked-sender = 100<br>
    the VAS gateway by a MMSC for a message submitted by this user.
   </td>
  </tr>
+
+ <tr>
+  <td valign=top >
+  <tt>mmsc</tt>
+  </td>
+  <td valign=top>
+  string
+  </td>
+  <td valign=top>
+   Optional id of the mmsc to use, if none is specified using the CGI Variables
+  </td>
+ </tr>
 </table>
 
 </p>
diff --git a/mmlib/mms_cfg.def b/mmlib/mms_cfg.def
index 3f6ba81..3d7c85b 100644
--- a/mmlib/mms_cfg.def
+++ b/mmlib/mms_cfg.def
@@ -124,6 +124,7 @@ MULTI_GROUP(send-mms-user,
 	OCTSTR(faked-sender)
 	OCTSTR(delivery-report-url)
 	OCTSTR(read-report-url)
+	OCTSTR(mmsc)
 )
 
 MULTI_GROUP(mmsc,
diff --git a/mmsbox/mmsbox.c b/mmsbox/mmsbox.c
index 0748300..9208697 100644
--- a/mmsbox/mmsbox.c
+++ b/mmsbox/mmsbox.c
@@ -1232,7 +1232,9 @@ static void dispatch_sendmms_recv(List *rl)
 	       dlr_url =  http_cgi_variable(h->cgivars, "dlr-url");
 	       rr_url  =  http_cgi_variable(h->cgivars, "rr-url");	       
                allow_adaptations  =  http_cgi_variable(h->cgivars, "allow-adaptations");        
-	       mmc =  http_cgi_variable(h->cgivars, "mmsc");
+	       if ((mmc =  http_cgi_variable(h->cgivars, "mmsc")) == NULL) {
+	           mmc = octstr_duplicate(u->mmsc); /* could still be NULL */
+	       }
 	       subject =  http_cgi_variable(h->cgivars, "subject");
 	       
 	       if ((base_url = http_cgi_variable(h->cgivars, "base-url")) == NULL)
diff --git a/mmsbox/mmsbox_cfg.c b/mmsbox/mmsbox_cfg.c
index 3b3559e..d35a95f 100644
--- a/mmsbox/mmsbox_cfg.c
+++ b/mmsbox/mmsbox_cfg.c
@@ -183,6 +183,7 @@ int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func)
 	  u->faked_sender = mms_cfg_get(x, octstr_imm("faked-sender"));	  	  
 	  u->dlr_url = _mms_cfg_getx(x, octstr_imm("delivery-report-url"));	  	  
 	  u->rr_url = _mms_cfg_getx(x, octstr_imm("read-report-url"));	  	  
+	  u->mmsc = _mms_cfg_getx(x, octstr_imm("mmsc"));
 	  gwlist_append(sendmms_users, u);
      }    
      gwlist_destroy(l, NULL);
diff --git a/mmsbox/mmsbox_cfg.h b/mmsbox/mmsbox_cfg.h
index 266c41f..d8416b5 100644
--- a/mmsbox/mmsbox_cfg.h
+++ b/mmsbox/mmsbox_cfg.h
@@ -85,7 +85,7 @@ typedef struct MmsService {
 typedef struct SendMmsUser {
      Octstr *user, *pass;
      Octstr *faked_sender;
-     Octstr *dlr_url, *rr_url;
+     Octstr *dlr_url, *rr_url, *mmsc;
 } SendMmsUser;
 
 /* Basic settings for the mmsbox. */
_______________________________________________
Devel mailing list
Devel@mbuni.org
http://lists.mbuni.org/mailman/listinfo/devel

Reply via email to