PATCH: Clickatell UCS2 + Concat over HTTP support

"Donald Jackson" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi everyone,

I have written a small patch to smsc_http.c which will allow a user to send
concat, 8 bit and unicode messages over HTTP via Clickatell.

Hope someone else finds it useful! :)

Thanks,
-- 
Donald Jackson
http://www.ddj.co.za/
donaldjster(a)gmail.com
clickatell_unicode_concat.patch (application/octet-stream, 1.2 KB)
Index: gw/smsc/smsc_http.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_http.c,v
retrieving revision 1.58
diff -u -r1.58 smsc_http.c
--- gw/smsc/smsc_http.c	26 Jul 2008 09:21:17 -0000	1.58
+++ gw/smsc/smsc_http.c	5 Jan 2009 06:52:05 -0000
@@ -682,9 +682,14 @@
     octstr_destroy(os);
     
     /* add UDH header */
-    if (octstr_len(sms->sms.udhdata)) {
-        octstr_format_append(url, "&data=%H", sms->sms.msgdata);
-        octstr_format_append(url, "&udh=%H", sms->sms.udhdata);
+    if(octstr_len(sms->sms.udhdata)) {
+	octstr_format_append(url, "&udh=%H", sms->sms.udhdata);
+    }
+
+    if(sms->sms.coding == DC_8BIT) {
+        octstr_format_append(url, "&data=%H&mclass=%d", sms->sms.msgdata, sms->sms.mclass);
+    } else if(sms->sms.coding == DC_UCS2) {
+        octstr_format_append(url, "&unicode=1&text=%H", sms->sms.msgdata);
     } else {
         octstr_format_append(url, "&text=%E", sms->sms.msgdata);
         if (conndata->alt_charset) {
@@ -693,7 +698,7 @@
             octstr_append_cstr(url, "&charset=UTF-8");
         }
     }
-
+ 
     if (DLR_IS_ENABLED_DEVICE(sms->sms.dlr_mask))
 	octstr_format_append(url, "&callback=3&deliv_ack=1");
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.