Hi list,

attached patch does the following:

1. In case VASP of type SOAP specifies a <SenderAddress>, it is uses
it instead of short code defined in config (which might be absent).
TODO: shall we introduce allow-sender-address-override parameter?

2. Now if resolver module returns empty string (e.g. we don't know how
to deliver message for some recipient), it gets converted to NULL, so
mmsglobalsender sees that.

3. Transaction IDs changed the format to [EMAIL PROTECTED] (was
[EMAIL PROTECTED](host-alias). Having the prefixed transaction id lets one
to distinguish between different MMSCs at the proxy, i.e. MMS PDU
starting with "\x8c\x83\x98mbuni@" would mean that this is
M-NotifyResp.ind and should go to mbuni. Message IDs and URL in
notifications remain the same.

I also noticed that some thread of mmsrelay (obviously
mmsglobalsender) removes Vvasp-id line from queue file if one is
present, i.e. message was sent by VASP. After hour of debugging I
couldn't find the source for it :( However, it's easy to reproduce:
launch only mmsproxy, send MM from VASP, look at queue file, launch
mmsrelay and see the difference.

--
Dziugas
? .cdtproject
? .project
? COPYING
? autom4te.cache
? config.h
? config.h.in
? stamp-h1
? mmlib/libmms.la
? mmsc/libmmsc.la
? mmsc/libmmsc_billing_shell.la
? mmsc/libmmsc_detokenize_shell.la
? mmsc/libmmsc_resolve_shell.la
Index: mmlib/mms_util.c
===================================================================
RCS file: /cvsroot/mbuni/mbuni/mmlib/mms_util.c,v
retrieving revision 1.40
diff -u -r1.40 mms_util.c
--- mmlib/mms_util.c    10 Mar 2006 05:38:29 -0000      1.40
+++ mmlib/mms_util.c    7 Apr 2006 16:54:53 -0000
@@ -210,10 +210,8 @@
                            time(NULL), (++ct % 10000), getpid()%1000, 
random()%1000);
      else
          x = octstr_create(qf);
-     
-     y = md5digest(mmscname);
-     
-     res = octstr_format("[EMAIL PROTECTED]", x, octstr_get_cstr(y));
+          
+     res = octstr_format("[EMAIL PROTECTED]", mmscname, x);
      
      octstr_destroy(x);
      octstr_destroy(y);
@@ -229,7 +227,7 @@
        return NULL;
      i = octstr_search_char(transid, '@', 0);
      
-     return (i >= 0) ? octstr_copy(transid, 0, i) : octstr_duplicate(transid); 
    
+     return (i >= 0) ? octstr_copy(transid, i+1, octstr_len(transid)) : 
octstr_duplicate(transid);
 }
 
 Octstr *mms_isodate(time_t t)
Index: mmsc/mms_resolve_shell.c
===================================================================
RCS file: /cvsroot/mbuni/mbuni/mmsc/mms_resolve_shell.c,v
retrieving revision 1.2
diff -u -r1.2 mms_resolve_shell.c
--- mmsc/mms_resolve_shell.c    27 Mar 2006 13:00:48 -0000      1.2
+++ mmsc/mms_resolve_shell.c    7 Apr 2006 16:54:53 -0000
@@ -46,6 +46,11 @@
      octstr_strip_crlfs(s);
 
      pclose(fp);
+     
+     if (octstr_len(s) == 0) {
+        octstr_destroy(s);
+        return NULL;
+     }
 
      return s;
 }
Index: mmsc/mmsglobalsender.c
===================================================================
RCS file: /cvsroot/mbuni/mbuni/mmsc/mmsglobalsender.c,v
retrieving revision 1.13
diff -u -r1.13 mmsglobalsender.c
--- mmsc/mmsglobalsender.c      25 Oct 2005 10:55:01 -0000      1.13
+++ mmsc/mmsglobalsender.c      7 Apr 2006 16:54:54 -0000
@@ -236,6 +236,7 @@
                                   break;
                              }
                         }
+             octstr_destroy(mmsc);
               } else /* Search VASP list, see what you can find... */
                    for (j = 0, m = list_len(settings->vasp_list); j < m; j++)
                         if ((vasp = list_get(settings->vasp_list, j)) != NULL 
&&
@@ -259,7 +260,7 @@
          if (res == MMS_SEND_OK)
               to->process = 0;
          else { /* If there was a report request, queue it. */
-              
+
               if (e->dlr) {
                    Octstr *qfs; 
                    MmsMsg *m = mms_deliveryreport(e->msgId, to->rcpt, tnow, 
Index: mmsc/mmsproxy.c
===================================================================
RCS file: /cvsroot/mbuni/mbuni/mmsc/mmsproxy.c,v
retrieving revision 1.35
diff -u -r1.35 mmsproxy.c
--- mmsc/mmsproxy.c     24 Feb 2006 13:29:24 -0000      1.35
+++ mmsc/mmsproxy.c     7 Apr 2006 16:54:54 -0000
@@ -1591,7 +1591,7 @@
      switch (mm7_msgtype(mreq)) {
      case MM7_TAG_SubmitReq:
          mm7_get_envelope(mreq, &from, &to, &subject, &vasid, &expiryt, 
&delivert);
-         m = mm7_soap_to_mmsmsg(mreq, sender); 
+         m = mm7_soap_to_mmsmsg(mreq, from ? from : sender); 
          if (m) {
               Octstr *value = NULL;
               int dlr;
@@ -1618,7 +1618,7 @@
                                  octstr_get_cstr(settings->global_queuedir), 
                                  settings->host_alias);
               msgid = mms_maketransid(octstr_get_cstr(qf), 
settings->host_alias);
-              mms_log("Received", sender, to, -1, msgid, h->vasp->id, NULL, 
"MM7", 
+              mms_log("Received", from ? from : sender, to, -1, msgid, 
h->vasp->id, NULL, "MM7", 
                       h->ua, NULL);
               if (value)
                    octstr_destroy(value);            
_______________________________________________
Devel mailing list
Devel@mbuni.org
http://mbuni.org/mailman/listinfo/devel_mbuni.org

Reply via email to