Re: Fw: [PATCH] DLR in EMI/UCP are not decoded to latin1
"Vincent CHAVANIS" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <2ab401c71669$8afc34b0$9600a8c0@vince> |
woooops :) ! here is the new patch ----- Original Message ----- From: "Stipe Tolj" <[email protected]> To: "Vincent CHAVANIS" <[email protected]> Cc: <[email protected]> Sent: Saturday, December 02, 2006 11:24 PM Subject: Re: Fw: [PATCH] DLR in EMI/UCP are not decoded to latin1 > Vincent CHAVANIS wrote: >> >> Any objections ? > > yep, the patch is not against CVS HEAD. We now have UTF-8 as inter-box > default encoding, and you add > > > + charset_gsm_to_latin1(msg->sms.msgdata); > > which wrong here I guess. > > Can you please check and diff against CVS HEAD? > > Stipe > > ------------------------------------------------------------------- > Kölner Landstrasse 419 > 40589 Düsseldorf, NRW, Germany > > tolj.org system architecture Kannel Software Foundation (KSF) > http://www.tolj.org/ http://www.kannel.org/ > > mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org > ------------------------------------------------------------------- >
patch_emi_dlr_v2.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-12-01 15:21:05.000000000 +0100
+++ /gateway/gw/smsc/smsc_emi.c 2006-12-01 17:38:00.000000000 +0100
@@ -752,9 +764,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_utf8(msg->sms.msgdata);
}
@@ -867,6 +879,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_utf8(msg->sms.msgdata);
+ }
bb_smscconn_receive(conn, msg);
}
reply = emimsg_create_reply(53, emimsg->trn, 1, privdata->name);