Are you sure you don't have "Magic Quotes On" on your php.ini ? It
does exactly that, I mean: put \' to ease your mysql inserts and
trouble your life forever ;)

Hope it helps,


On Sun, 6 Mar 2005 02:35:56 +0800, Davy Chan <[EMAIL PROTECTED]> wrote:
> Please provide your configuration files.  Are you sure you don't have
> any HTTP SMSC defined in your configuration files?  I'm really
> curious why it took 2 seconds for the smsbox to submit the SMS
> to the bearbox's receiver queue.
> 
> The alt-dcs is not for changing the character set.  It's used to
> indicate how to set/unset bits 7 through 3 of Data Coding Scheme
> (used to distinguish between MWI or just data coding/mclass).
> 
> According to your logs, the SMS Msg structure that is extracted
> out of the bearerbox receive queue already has the single quote
> with an backslash prepended.
> 
> It's getting late for me...please post your config files.
> 
> See ya...
> 
> d.c.
> 
> **>Date: Sat,  5 Mar 2005 18:07:33 +0100
> **>From: [EMAIL PROTECTED]
> **>To: Davy Chan <[EMAIL PROTECTED]>
> **>Cc: Guillaume Cottenceau <[EMAIL PROTECTED]>, [email protected]
> **>Subject: Re: Please help : Pbs with quote and backslash
> **>In-Reply-To: <[EMAIL PROTECTED]>
> **>User-Agent: Internet Messaging Program (IMP) 3.2.5
> **>
> **>Thanks for your answer, I will give you more informations :
> **>
> **>First, I 'm using Playsms but I have make some additionnals tests that not 
> put
> **>Playsms in the problem resolution.
> **>
> **>I made additionnal test with the following URL (only Kannel cgi-sendsms so 
> no
> **>Playsms at all) :
> **>http://127.0.0.1:13013/cgi-bin/sendsms?username=xxxx&password=xxxx&to=06xxxxxx&text=salut+%22+et+%27+et+%5C
> **>
> **>The return code is "sent" and the sms arrives on the phone but still with 
> the
> **>same issue (\ in front of ' and \).
> **>
> **>For my point of view, there is something between bearbox and smsbox that 
> add
> **>additionnal backslash but I still do not know where. The logs below shows 
> that
> **>the backslash is not in smsbox but is in bearbox.
> **>
> **>I do not use alt-dcs variable neither coding in http request, so it must be
> **>default value.
> **>
> **>I modified the Kannel source in order to add additionnal DEBUG trace, here 
> is
> **>what I retrieve :
> **>
> **>>From the smsbox.log :
> **>2005-03-05 15:57:46 [27066] [2] DEBUG: HTTP: Creating HTTPClient for
> **>`127.0.0.1'.
> **>2005-03-05 15:57:46 [27067] [3] INFO: smsbox: Got HTTP request
> **></cgi-bin/sendsms> from <127.0.0.1>
> **>2005-03-05 15:57:46 [27067] [3] INFO: sendsms used by <xxxx>
> **>2005-03-05 15:57:46 [27067] [3] INFO: sendsms sender:<xxxx:13013> 
> (127.0.0.1)
> **>to:<06xxxxxx> msg:<salut " et ' et \>
> **>2005-03-05 15:57:46 [27067] [3] INFO: sendsms sender:<xxxxt:13013> 
> (127.0.0.1)
> **>to:<0xxxxxxx>  msg:<salut " et ' et \>
> **>2005-03-05 15:57:46 [27067] [3] INFO: sendsms sender:after 
> charset-processing
> **>msg:<salut " et ' et \>
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: AT2[]: sms_split
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: AT2[salut " et ' et \]: latin12gsm
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: AT2[salut " et ' et /]: apres 
> latin12gsm
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: AT2[salut " et ' et \]: sms_split
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: AT2[(null)]: split char CYRIL
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: AT2[salut " et ' et \]: latin12gsm
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: AT2[salut " et ' et /]: apres 
> latin12gsm
> **>CYRIL
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: AT2[salut " et ' et \]: sms_split 
> apres
> **>footer et header CYRIL
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: message length 17, sending 1 
> messages
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: smsbox : msg [salut " et ' et \]
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: smsbox : new_msg [salut " et ' et \]
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: Status: 202 Answer: <Sent.>
> **>2005-03-05 15:57:46 [27067] [3] DEBUG: HTTP: Resetting HTTPClient for
> **>`127.0.0.1'.
> **>
> **>
> **>
> **>
> **>
> **>>From the Kannel.log (some function name appears in the log, latin12gsm in
> **>charset.c for example):
> **>
> **>
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: boxc_receiver: sms received
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: AT2[]: sms_split
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: AT2[salut " et \' et \\]: 
> latin12gsm
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: AT2[salut " et /' et //]: apres
> **>latin12gsm
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: AT2[salut " et \' et \\]: sms_split
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: AT2[(null)]: split char
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: AT2[salut " et \' et \\]: 
> latin12gsm
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: AT2[salut " et /' et //]: apres
> **>latin12gsm CYRIL
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: AT2[salut " et \' et \\]: sms_split
> **>apres footer et header
> **>2005-03-05 15:57:48 [27073] [12] DEBUG: send_msg: sending msg to box:
> **><127.0.0.1>
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[salut " et \' et \\]:
> **>at2_send_one_message CYRIL
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[salut " et \' et \\]: 
> at2_pdu_encode
> **>CYRIL2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[Wave2]: TP-Validity-Period:
> **>24.0 hours
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[salut " et \' et \\]: latin12gsm
> **>CYRIL
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[salut " et /' et //]: apres
> **>latin12gsm
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[salut " et \' et \\]: sms_at
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[salut " et \' et \\]: latin12gsm
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[salut " et /' et //]: apres
> **>latin12gsm
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[Wave2]: --> AT+CMGS=34^M
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[Wave2]: <-- >
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[Wave2]: send command status: 1
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[Wave2]: -->
> **>0011000B913316770342F70000A716F330BB4E078940653A68F33A81CA74D0E6B57901
> **>2005-03-05 15:57:50 [27054] [8] DEBUG: AT2[Wave2]: --> ^Z
> **>2005-03-05 15:57:53 [27054] [8] DEBUG: AT2[Wave2]: <-- >
> **>2005-03-05 15:57:53 [27054] [8] DEBUG: AT2[Wave2]: <-- +CMGS: 54
> **>2005-03-05 15:57:53 [27054] [8] DEBUG: AT2[Wave2]: <-- OK
> **>2005-03-05 15:57:53 [27054] [8] DEBUG: AT2[Wave2]: send command status: 0
> **>2005-03-05 15:57:53 [27047] [1] DEBUG: Dumping 0 messages and 0 acks to 
> store
> **>
> **>
> **>
> **>Quoting Davy Chan <[EMAIL PROTECTED]>:
> **>
> **>>
> **>> We are not ignoring your posting.  We are having a hard time trying
> **>> to read your mind since you are providing us with very little information
> **>> to try and deduce your current setup.
> **>>
> **>> From the looks of the log, I would say you are not using Kannel
> **>> directly but playsms.  Playsms uses Kannel as an SMS gateway.
> **>>
> **>> Playsms (from my brief glance of it) is a set of PHP scripts that
> **>> handle the communication between you and the SMS gateway.
> **>>
> **>> The "sendsms sender ..." line comes from the smsbox.  The
> **>> "Parsing URL ..." line occurs either from a get-url/post-url inside
> **>> a sms-service or a send-url inside the HTTP SMSC declaration.
> **>> Since it is coming after the sendsms, I would deduce that your
> **>> have setup an HTTP SMSC configuration. When you submit an
> **>> sendsms to Kannel, the HTTP SMSC handles the MT SMS and
> **>> sends it to the Playsms proxy for handling.
> **>>
> **>> Now, guessing at this possible configuration (since you did not
> **>> provide it for us), I would assume that the Playsms proxy PHP
> **>> script is the program that is escaping the single (') and double (")
> **>> quotes a backslash (\). I believe that the Playsms PHP scripts
> **>> are the culprit and not Kannel.
> **>>
> **>> I can tell you that the Kannel source code obtained from www.kannel.org
> **>> for the bearerbox and smsbox do not add backslashes to the code.
> **>> The bearerbox will convert latin1 to GSM7
> **>> (gateway/gwlib/charset.c:charset_latin1_to_gsm()).  But, the single
> **>> and double quotes are the same in both character sets.
> **>>
> **>> If my assumptions are wrong then please post your configurations
> **>> so we can better help you with your problem.
> **>>
> **>> See ya...
> **>>
> **>> d.c.
> **>>
> **>> **>Date: Fri,  4 Mar 2005 17:28:21 +0100
> **>> **>From: [EMAIL PROTECTED]
> **>> **>To: Guillaume Cottenceau <[EMAIL PROTECTED]>
> **>> **>Subject: Re: Please help : Pbs with quote and backslash
> **>> **>In-Reply-To: <[EMAIL PROTECTED]>
> **>> **>
> **>> **>I'm using this version :
> **>> **>2005-03-04 11:51:25 [8231] [0] INFO: Kannel bearerbox II version 1.4.0
> **>> starting
> **>> **>
> **>> **>And yes, I don't understand where is the bug, here is my log :
> **>> **>
> **>> **>smsbox.log
> **>> **>2005-03-04 14:06:24 [8254] [3] INFO: sendsms sender:<titext:Cyrille>
> **>> **>(213.41.137.61) to:<0033617730247> msg:<salut " et ' et \>
> **>> **>2005-03-04 14:06:29 [8264] [9] DEBUG: Parsing URL
> **>>
> **>**>`http://127.0.0.1/~playsms/proxy.php?dlr-type=8&myid=2384&username=xxxx&password=xxxx&dlr-mask=31&from=Cyrille&to=00336xxxxx&text=salut+%22+et+%27+et+%5C':
> **>> **>2005-03-04 14:06:29 [8264] [9] DEBUG:   Query:
> **>>
> **>**>dlr-type=8&myid=2384&username=xxxx&password=xxxx&dlr-mask=31&from=Cyrille&to=0033xxxxxx&text=salut+%22+et+%27+et+%5C
> **>> **>2005-03-04 14:07:39 [8264] [9] DEBUG: Parsing URL
> **>>
> **>**>`http://127.0.0.1/~playsms/proxy.php?dlr-type=1&myid=2384&username=xxxx&password=xxxx&dlr-mask=31&from=Cyrille&to=0033xxxxx&text=salut+%22+et+%27+et+%5C':
> **>> **>
> **>> **>2005-03-04 14:06:24 [8254] [3] INFO: sendsms sender:<xxxx:Cyrille>
> **>> **>(xxx.xxx.137.61) to:<00336xxx> msg:<salut " et ' et \>
> **>> **>
> **>> **>And kannel-Access.log :
> **>> **>2005-03-04 14:06:29 Sent SMS [SMSC:Nokia] [SVC:toto] [ACT:] [BINF:]
> **>> **>[from:0033xxxxxx] [to:+336xxxxx] [flags:-1:0:-1:-1:31] [msg:22:salut 
> " et
> **>> /'
> **>> **>et //] [udh:0:]
> **>> **>
> **>> **>What it surprised me (see the additionnal char), that appears in log 
> only
> **>> in the
> **>> **>access log, not before. Do you have idea ?
> **>> **>
> **>> **>Thanks
> **>> **>
> **>> **>
> **>> **>
> **>> **>Quoting Guillaume Cottenceau <[EMAIL PROTECTED]>:
> **>> **>
> **>> **>> info.ubichip 'at' free.fr writes:
> **>> **>>
> **>> **>> > Here is an example of the text I send :
> **>> **>> >
> **>> **>> > salut " et ' et \
> **>> **>> >
> **>> **>> > so urlencode(text)=salut+%22+et+%27+et+%5C
> **>> **>> >
> **>> **>> > and what I receive :
> **>> **>> >
> **>> **>> > salut " et \' et \\
> **>> **>>
> **>> **>> Strange, I receive it correctly (except \ which is removed by my
> **>> **>> application). Are you using an old version? I'm using CVS of a
> **>> **>> little while ago.
> **>> **>>
> **>> **>> smsbox.log:2005-03-04 15:34:17 [32042] [3] INFO: sendsms 
> sender:<xxx>
> **>> **>> (127.0.0.1) to:<+41yyy> msg:<salut " et ' et   bye>
> **>> **>> smsbox-access.log:2005-03-04 15:34:17 send-SMS request added -
> **>> sender:xxx
> **>> **>> 127.0.0.1 target:+41yyy request: 'salut " et ' et   bye'
> **>> **>> kannel-access.log:2005-03-04 15:34:18 Sent SMS [SMSC:xxx] [SVC:xxx]
> **>> [ACT:]
> **>> **>> [BINF:] [from:xxx] [to:+41yyy] [flags:-1:0:-1:-1:2] [msg:21:salut " 
> et '
> **>> et
> **>> **>> bye] [udh:0:]
> **>> **>>
> **>>
> **>
> **>
> 
> 


-- 
Alejandro Guerrieri
Magicom
http://www.magicom-bcn.net/

Reply via email to