Daily patch: gateway

kannel at kannel.org kannel at kannel.org
Sat May 15 06:30:02 CEST 2010


Index: ChangeLog
===================================================================
--- ChangeLog	(revision 4830)
+++ ChangeLog	(revision 4831)
@@ -1,3 +1,11 @@
+2010-05-14  Stipe Tolj  <stolj at kannel.org>
+    * gw/dlr.c: fixed missing foreign ID (FID) escape codes handling for 
+      DLR SMSC SUCCESS|FAIL events, due that we handle the last chunk here, we
+      didn't get hold of the FID. We need to duplicate it to the split list 
+      original too, in order to have it available later, when the last chunk 
+      us handled for the DLR events.
+      Thanks to Gianluca Moretti <gianluca.moretti at hotmail dot it> for report.
+
 2010-05-06 Alexander Malysh <amalysh at kannel.org>
     * gw/smsc/smsc_smpp.c: ignore receive_port for transceiver mode.
       Thanks to Juan Nin <juanin at gmail.com> for report.
Index: gw/dlr.c
===================================================================
--- gw/dlr.c	(revision 4830)
+++ gw/dlr.c	(revision 4831)
@@ -319,13 +319,20 @@
 {
     struct dlr_entry *dlr = NULL;
 
-    /* Add the foreign_id so all SMSC modules can use it */
+    /* Add the foreign_id so all SMSC modules can use it.
+     * Obey also the original message in the split_parts list. */
     if (msg->sms.foreign_id != NULL)
         octstr_destroy(msg->sms.foreign_id);
     msg->sms.foreign_id = octstr_duplicate(ts);
+    if (msg->sms.split_parts != NULL) {
+        struct split_parts *split = msg->sms.split_parts;
+        if (split->orig->sms.foreign_id != NULL)
+            octstr_destroy(split->orig->sms.foreign_id);
+        split->orig->sms.foreign_id = octstr_duplicate(ts);
+    }
 
     if(octstr_len(smsc) == 0) {
-	warning(0, "DLR[%s]: Can't add a dlr without smsc-id", dlr_type());
+        warning(0, "DLR[%s]: Can't add a dlr without smsc-id", dlr_type());
         return;
     }
 
@@ -352,8 +359,8 @@
     dlr->mask = msg->sms.dlr_mask;
 
     debug("dlr.dlr", 0, "DLR[%s]: Adding DLR smsc=%s, ts=%s, src=%s, dst=%s, mask=%d, boxc=%s",
-              dlr_type(), octstr_get_cstr(dlr->smsc), octstr_get_cstr(dlr->timestamp),
-              octstr_get_cstr(dlr->source), octstr_get_cstr(dlr->destination), dlr->mask, octstr_get_cstr(dlr->boxc_id));
+          dlr_type(), octstr_get_cstr(dlr->smsc), octstr_get_cstr(dlr->timestamp),
+          octstr_get_cstr(dlr->source), octstr_get_cstr(dlr->destination), dlr->mask, octstr_get_cstr(dlr->boxc_id));
 	
     /* call registered function */
     handles->dlr_add(dlr);






More information about the devel-reports mailing list