Hi,

Here is a small patch to the CIMD2 SMSC to set the DLR Msg's
sms->msgdata value to the statuscode if there is no USER_DATA available.

The CIMD2 smsc to which we connect does not return any USER_DATA in the
deliver status messages. So this patch allows us to use the statuscode
value instead.  this value is then available in the %A parameter of a
dlr-url instead of the null/empty value.

nick



Index: smsc_cimd2.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_cimd2.c,v
retrieving revision 1.22
diff -u -r1.22 smsc_cimd2.c
--- smsc_cimd2.c	11 Mar 2004 17:33:00 -0000	1.22
+++ smsc_cimd2.c	26 Mar 2004 07:19:31 -0000
@@ -2104,13 +2104,19 @@
     	msg = dlr_find(conn->name, timestamp, destination, code);
     else
         msg = NULL;
-    octstr_destroy(statuscode);
     octstr_destroy(destination);
     octstr_destroy(timestamp);
 
     /* recode the body into msgdata */
     if (msg) {
         msg->sms.msgdata = packet_get_parm(request, P_USER_DATA);
+	if (msg->sms.msgdata == NULL) {
+            msg->sms.msgdata = statuscode;
+	} else {
+	    octstr_destroy(statuscode);
+	}
+    } else {
+      octstr_destroy(statuscode);
     }
 
     return msg;

Reply via email to