[PATCH] add new report_mt sms type

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Centrium GmbH
Message-ID <[email protected]>
Hi List,

attached you can find a patch that change 'report' to 'report_mo' and adds 
'report_mt' sms type (similar to 'mo','mt_reply','mt_push'). This patch 
should not break anything and just allow easier Centrium -> Kannel.org 
merging process.

Comments and votes please!

-- 
Best regards / Mit besten Grüßen aus Düsseldorf

Dipl.-Ing.
Alexander Malysh
___________________________________________

Centrium GmbH
Vogelsanger Weg 80
40470 Düsseldorf

Fon: +49 (0211) 74 84 51 80
Fax: +49 (0211) 277 49 109

email: [email protected]
web: www.centrium.de
msn: [email protected]
icq: 98063111
___________________________________________

Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
add-report-mt.patch (text/x-diff, 7.8 KB)
Index: gw/bb_smscconn.c
===================================================================
RCS file: /home/cvs/gateway/gw/bb_smscconn.c,v
retrieving revision 1.69
diff -a -u -r1.69 bb_smscconn.c
--- gw/bb_smscconn.c	8 Dec 2003 11:25:44 -0000	1.69
+++ gw/bb_smscconn.c	15 Jan 2004 17:56:08 -0000
@@ -270,7 +270,7 @@
 	return SMSCCONN_FAILED_REJECTED;
     }
 
-    if (sms->sms.sms_type != report)
+    if (sms->sms.sms_type != report_mo)
 	sms->sms.sms_type = mo;
 
     /* write to store (if enabled) */
@@ -294,7 +294,7 @@
          */
         if (route_incoming_to_boxc(copy) == -1) {
             warning(0, "incoming messages queue too long, dropping a message.");
-            if (sms->sms.sms_type == report)
+            if (sms->sms.sms_type == report_mo)
                 bb_alog_sms(conn, sms, "DROPPED Received DLR");
             else
                 bb_alog_sms(conn, sms, "DROPPED Received SMS");
@@ -313,7 +313,7 @@
         }
     }
 
-    if (sms->sms.sms_type != report)
+    if (sms->sms.sms_type != report_mo)
 	bb_alog_sms(conn, sms, "Receive SMS");
     else
 	bb_alog_sms(conn, sms, "DLR SMS");
Index: gw/bb_store.c
===================================================================
RCS file: /home/cvs/gateway/gw/bb_store.c,v
retrieving revision 1.27
diff -a -u -r1.27 bb_store.c
--- gw/bb_store.c	15 Jan 2004 17:16:31 -0000	1.27
+++ gw/bb_store.c	15 Jan 2004 17:56:08 -0000
@@ -444,7 +444,7 @@
 	    continue;
 
 	if (msg_type(msg) == sms) {
-	    if (msg->sms.sms_type == report) {
+	    if (msg->sms.sms_type == report_mo) {
 		octstr_destroy(pack);
                 msg_destroy(msg);
 		continue;
Index: gw/dlr.c
===================================================================
RCS file: /home/cvs/gateway/gw/dlr.c,v
retrieving revision 1.46
diff -a -u -r1.46 dlr.c
--- gw/dlr.c	9 Dec 2003 00:10:52 -0000	1.46
+++ gw/dlr.c	15 Jan 2004 17:56:08 -0000
@@ -391,7 +391,7 @@
     if ((typ & dlr->mask) > 0) {
         /* its an entry we are interested in */
         msg = msg_create(sms);
-        msg->sms.sms_type = report;
+        msg->sms.sms_type = report_mo;
         msg->sms.dlr_mask = typ;
         O_SET(msg->sms.service, dlr->service);
         O_SET(msg->sms.smsc_id, dlr->smsc);
@@ -468,7 +468,7 @@
 
     dlrmsg->sms.service = octstr_duplicate(msg->sms.service);
     dlrmsg->sms.dlr_mask = stat;
-    dlrmsg->sms.sms_type = report;
+    dlrmsg->sms.sms_type = report_mo;
     dlrmsg->sms.smsc_id = octstr_duplicate(smsc ? smsc : msg->sms.smsc_id);
     dlrmsg->sms.sender = octstr_duplicate(msg->sms.sender);
     dlrmsg->sms.receiver = octstr_duplicate(msg->sms.receiver);
Index: gw/msg.h
===================================================================
RCS file: /home/cvs/gateway/gw/msg.h,v
retrieving revision 1.19
diff -a -u -r1.19 msg.h
--- gw/msg.h	8 Dec 2003 11:25:44 -0000	1.19
+++ gw/msg.h	15 Jan 2004 17:56:08 -0000
@@ -95,7 +95,8 @@
     mo = 0,
     mt_reply = 1,
     mt_push = 2,
-    report = 3
+    report_mo = 3,
+    report_mt = 4
 };
 
 /* admin commands */
Index: gw/smsbox.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsbox.c,v
retrieving revision 1.240
diff -a -u -r1.240 smsbox.c
--- gw/smsbox.c	8 Dec 2003 11:25:44 -0000	1.240
+++ gw/smsbox.c	15 Jan 2004 17:56:08 -0000
@@ -1098,7 +1098,7 @@
         if (reply_body == NULL)
             reply_body = octstr_imm("");
 
-        if (msg->sms.sms_type != report) {
+        if (msg->sms.sms_type != report_mo) {
             alog("SMS HTTP-request sender:%s request: '%s' "
                  "url: '%s' reply: %d '%s'",
                  octstr_get_cstr(msg->sms.receiver),
@@ -1115,7 +1115,7 @@
         http_destroy_headers(req_headers);
         octstr_destroy(req_body);
 
-        if (msg->sms.sms_type != report && !queued) {
+        if (msg->sms.sms_type != report_mo && !queued) {
             if (send_message(trans, msg) < 0)
                 error(0, "failed to send message to phone");
         }
@@ -1151,7 +1151,7 @@
     gw_assert(msg != NULL);
     gw_assert(msg_type(msg) == sms);
 
-    if (msg->sms.sms_type == report)
+    if (msg->sms.sms_type == report_mo)
 	type = TRANSTYPE_GET_URL;
     else
 	type = urltrans_type(trans);
@@ -1554,7 +1554,7 @@
     int ret, dreport=0;
 
     while ((msg = list_consume(smsbox_requests)) != NULL) {
-	if (msg->sms.sms_type == report)
+	if (msg->sms.sms_type == report_mo)
 	    dreport = 1;
 	else
 	    dreport = 0;
Index: gw/urltrans.c
===================================================================
RCS file: /home/cvs/gateway/gw/urltrans.c,v
retrieving revision 1.89
diff -a -u -r1.89 urltrans.c
--- gw/urltrans.c	8 Dec 2003 11:25:44 -0000	1.89
+++ gw/urltrans.c	15 Jan 2004 17:56:08 -0000
@@ -365,7 +365,7 @@
 
     url = reply = NULL;
     
-    if (request->sms.sms_type != report && t->type == TRANSTYPE_SENDSMS)
+    if (request->sms.sms_type != report_mo && t->type == TRANSTYPE_SENDSMS)
         return octstr_create("");
 
     if (request->sms.msgdata) {
@@ -379,7 +379,7 @@
     result = octstr_create("");
 
     /* check if this is a delivery report message or not */
-    if (request->sms.sms_type != report) {
+    if (request->sms.sms_type != report_mo) {
         pattern = t->pattern;
     } else {
 
Index: gw/smsc/smsc_emi.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_emi.c,v
retrieving revision 1.8
diff -a -u -r1.8 smsc_emi.c
--- gw/smsc/smsc_emi.c	3 Dec 2003 10:56:35 -0000	1.8
+++ gw/smsc/smsc_emi.c	15 Jan 2004 17:56:08 -0000
@@ -866,7 +866,6 @@
 	    else
 		msg->sms.msgdata = octstr_duplicate(emimsg->fields[E50_AMSG]);
 	    octstr_hex_to_binary(msg->sms.msgdata);
-	    msg->sms.sms_type = report;
 	    bb_smscconn_receive(conn, msg);
 	}
 	reply = emimsg_create_reply(53, emimsg->trn, 1, privdata->name);
Index: gw/smsc/smsc_fake.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_fake.c,v
retrieving revision 1.10
diff -a -u -r1.10 smsc_fake.c
--- gw/smsc/smsc_fake.c	8 Dec 2003 11:25:44 -0000	1.10
+++ gw/smsc/smsc_fake.c	15 Jan 2004 17:56:08 -0000
@@ -276,7 +276,6 @@
                                       msg->sms.receiver, /* destination */
                                       dlrstat);
                     if (dlrmsg != NULL) {
-                        dlrmsg->sms.sms_type = report;
                         bb_smscconn_receive(conn, dlrmsg);
                     } else {
                         error(0,"smsc_fale: got DLR but could not find message or was not interested in it");
Index: gw/smsc/smsc_oisd.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_oisd.c,v
retrieving revision 1.4
diff -a -u -r1.4 smsc_oisd.c
--- gw/smsc/smsc_oisd.c	15 Nov 2003 13:14:23 -0000	1.4
+++ gw/smsc/smsc_oisd.c	15 Jan 2004 17:56:08 -0000
@@ -1278,7 +1278,7 @@
     dlr_msg = msg_create(sms);
     dlr_msg->sms.service = octstr_duplicate(msg->sms.service);
     dlr_msg->sms.dlr_mask = DLR_FAIL;
-    dlr_msg->sms.sms_type = report;
+    dlr_msg->sms.sms_type = report_mo;
     dlr_msg->sms.smsc_id = octstr_create(smsc->name);
     dlr_msg->sms.sender = octstr_duplicate(msg->sms.sender);
     dlr_msg->sms.receiver = octstr_duplicate(msg->sms.receiver);
Index: gw/smsc/smsc_smpp.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_smpp.c,v
retrieving revision 1.59
diff -a -u -r1.59 smsc_smpp.c
--- gw/smsc/smsc_smpp.c	4 Dec 2003 16:51:05 -0000	1.59
+++ gw/smsc/smsc_smpp.c	15 Jan 2004 17:56:08 -0000
@@ -1055,7 +1055,6 @@
                      * The DLR trigger URL is indicated by msg->sms.dlr_url.
                      */
                     dlrmsg->sms.msgdata = octstr_duplicate(respstr);
-                    dlrmsg->sms.sms_type = report;
 
                     reason = bb_smscconn_receive(smpp->conn, dlrmsg);
                 } else {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.