Re: [PATCH] Null Terminated Character Problem
"Mi Reflejo" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
damn :) Now attached. Martín. On 5/15/06, Vincent CHAVANIS <[email protected]> wrote: > nothing attached :-) > > -- > Telemaque - NICE - (FR) > Service Technique - Developpement > http://www.telemaque.fr/ > [email protected] > Tel : +33 4 93 97 71 64 (fax 68) > > ----- Original Message ----- > From: "Mi Reflejo" <[email protected]> > To: <[email protected]> > Sent: Monday, May 15, 2006 6:19 PM > Subject: Re: [PATCH] Null Terminated Character Problem > > > HI, > > Do you think so?. gsm_to_latin1 replaces \0 to @ If 00 comes in the > middle or in service id, delivery report does not match with original > message. > > Anyway i'm attaching patch with call to gsm_to_latin1 > > > -- > Regards, > Martín. > > On 5/15/06, Alexander Malysh <[email protected]> wrote: > > Hi, > > > > it would be more appropriate to call gsm_to_latin1(...) for DLR msgdata. > > > > Mi Reflejo wrote: > > > > > Example: > > > > > > 2006-04-28 16:09:30 [3130] [7] DEBUG: data: 74 65 78 74 3a 20 00 > > > text: > > > . > > > > > > 2006-05-13 01:42:10 [6892] [3] SQLBOXDEBUG: Query debug: INSERT INTO > > > sent_sms (sql_id, momt, sender, receiver, udhdata, m > > > sgdata, time, smsc_id, service, account, sms_type, mclass, mwi, coding, > > > compress, validity, deferred, dlr_mask, dlr > > > _url, pid, alt_dcs, rpi, charset, boxc_id, binfo) VALUES (NULL, 'MO', > > > '83252', '+447766906376', NULL, 'id:566357235 > > > sub:001 dlvrd:001 submit date:0604301954 done date:0604301954 stat:ACKED > > > err:003 text: > > > 2006-05-13 01:42:10 [6892] [3] ERROR: MYSQL: You have an error in your SQL > > > syntax; check the manual that correspond > > > s to your MySQL server version for the right syntax to use near > > > ''id:566357235 sub:001 dlvrd:001 submit date:060430 > > > 1954 done date:0604301954 stat' at line 1 > > > > > > Regards > > > > > > On 5/13/06, Mi Reflejo <[email protected]> wrote: > > >> * gw/smsc/smsc_smpp.c > > >> -Remove Null Terminated Character from Delivery Reports > > >> Some providers like MBLOX send 00 hex character in delivery reports. > > >> > > >> if handle_dlr does not do any conversion to msgdata when a Delivery > > >> Reports comes with 00 hex character the cstr representation of > > >> msgdata will put an additional \0 to the end - and when this string is > > >> concatenated to another (like when sqlbox does an INSERT statement) > > >> the final string has an \0 in the middle. This may affect a > > >> lot of operations with the final string. > > >> > > >> > > >> > > > > -- > > Thanks, > > Alex > > > > > > > > > >
null_terminated_replace_latin1.patch
(application/octet-stream, 538 B)
--- smsc_smpp.c.orig 2006-05-15 10:07:53.000000000 -0600
+++ smsc_smpp.c 2006-05-15 10:07:28.000000000 -0600
@@ -1286,6 +1286,8 @@
* The DLR trigger URL is indicated by msg->sms.dlr_url.
*/
dlrmsg->sms.msgdata = octstr_duplicate(respstr);
+ //Remove null terminated characters in the middle of msgdata
+ charset_gsm_to_latin1(dlrmsg->sms.msgdata);
dlrmsg->sms.sms_type = report_mo;
} else {
error(0,"SMPP[%s]: got DLR but could not find message or was not interested "