Fw: [PATCH] DLR in EMI/UCP are not decoded to latin1

"Vincent CHAVANIS" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <268201c7156c$c64d3b70$9600a8c0@vince>
Any objections ?

Vincent.


----- Original Message ----- 
From: "Vincent CHAVANIS" <[email protected]>
To: <[email protected]>
Sent: Tuesday, September 05, 2006 1:16 PM
Subject: Re: [PATCH] DLR in EMI/UCP are not decoded to latin1


This is the same way of processing an incoming message (UCP 52)

Here is a review of the patch
(- whites spaces changes to follow coding rules)
(- added E50_MT checks as it's an Optional field on EMI specs 4.6)


diff -rau /gateway-cvs/gw/smsc/smsc_emi.c /gateway/gw/smsc/smsc_emi.c
--- /gateway-cvs/gw/smsc/smsc_emi.c     2006-04-07 14:54:06.000000000 +0200
+++ /gateway/gw/smsc/smsc_emi.c 2006-09-05 13:51:21.000000000 +0200
@@ -751,9 +757,9 @@
            msg->sms.msgdata = emimsg->fields[E50_AMSG];
            emimsg->fields[E50_AMSG] = NULL; /* So it's not freed */

-        /* obey the NRC (national replacement codes) */
-        if (privdata->alt_charset == EMI_NRC_ISO_21)
-            charset_nrc_iso_21_german_to_gsm(msg->sms.msgdata);
+            /* obey the NRC (national replacement codes) */
+            if (privdata->alt_charset == EMI_NRC_ISO_21)
+                charset_nrc_iso_21_german_to_gsm(msg->sms.msgdata);

            charset_gsm_to_latin1(msg->sms.msgdata);
        }
@@ -866,6 +872,14 @@
            else
                msg->sms.msgdata = 
octstr_duplicate(emimsg->fields[E50_AMSG]);
            octstr_hex_to_binary(msg->sms.msgdata);
+
+            if (octstr_get_char(emimsg->fields[E50_MT], 0) == '3') {
+                /* obey the NRC (national replacement codes) */
+                if (privdata->alt_charset == EMI_NRC_ISO_21)
+                    charset_nrc_iso_21_german_to_gsm(msg->sms.msgdata);
+
+                charset_gsm_to_latin1(msg->sms.msgdata);
+            }
            bb_smscconn_receive(conn, msg);
        }
        reply = emimsg_create_reply(53, emimsg->trn, 1, privdata->name);
patch_emi_c.txt (text/plain, 1.4 KB)
diff -rau /gateway-cvs/gw/smsc/smsc_emi.c /gateway/gw/smsc/smsc_emi.c
--- /gateway-cvs/gw/smsc/smsc_emi.c     2006-04-07 14:54:06.000000000 +0200
+++ /gateway/gw/smsc/smsc_emi.c 2006-09-05 13:51:21.000000000 +0200
@@ -751,9 +757,9 @@
            msg->sms.msgdata = emimsg->fields[E50_AMSG];
            emimsg->fields[E50_AMSG] = NULL; /* So it's not freed */
 
-        /* obey the NRC (national replacement codes) */
-        if (privdata->alt_charset == EMI_NRC_ISO_21)
-            charset_nrc_iso_21_german_to_gsm(msg->sms.msgdata);
+            /* obey the NRC (national replacement codes) */
+            if (privdata->alt_charset == EMI_NRC_ISO_21)
+                charset_nrc_iso_21_german_to_gsm(msg->sms.msgdata);
 
            charset_gsm_to_latin1(msg->sms.msgdata);
        }
@@ -866,6 +872,14 @@
            else
                msg->sms.msgdata = octstr_duplicate(emimsg->fields[E50_AMSG]);
            octstr_hex_to_binary(msg->sms.msgdata);
+
+            if (octstr_get_char(emimsg->fields[E50_MT], 0) == '3') {
+                /* obey the NRC (national replacement codes) */
+                if (privdata->alt_charset == EMI_NRC_ISO_21)
+                    charset_nrc_iso_21_german_to_gsm(msg->sms.msgdata);
+     
+                charset_gsm_to_latin1(msg->sms.msgdata);
+            }
            bb_smscconn_receive(conn, msg);
        }
        reply = emimsg_create_reply(53, emimsg->trn, 1, privdata->name);
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.