You are wrong when you put to DB value 0x00 because this indicates the end of the string.
You see, null terminated string.
You did also misunderstand the purpose of php hexdec() function. To make this function work you should use it this way:
hexdec('00')
But this is not the point.  D O N ' T  use chr() function.
To correctly insert data to msgdata field and overcome the 0x00 (NULL problem - which is not kannel's problem) is this:

INSERT INTO send_sms (momt, sender, receiver, msgdata, sms_type, dlr_mask, coding)
VALUES('MT', 'mike', '3069112345', '%00%10%12%13%14', 2, 31, 0);

And again, URL-ENCODE the characters

Give it a shoot!


On 13/05/11 11:35, Πετσούκα Τάνια wrote:
It didn't work.

i replace '@' with  chr(hexdec( '%00' ))

If i send a message with text  " [email protected]" ,   I receive "user" .

In kannel logs too : short_message: "user".

I've tried to send all gsm charecters, but none turned to '@'.

I guess it may be represented by two chars, like euro, but i have no idea.

'0x00' is the null character, so kannel confuses somewhere and thinks that this is the end of the sms??

I was thinking that it might be SMSC's issue but it is not since logs from submit_sm give short_message: "user" .

Mike, if you really send '@' , could you send me a db insert for a message with this symbol to try?
(ps: your patch for concatenation works perfectly)






----- Original Message ----- From: "Mike Nakos" <[email protected]>
To: "Πετσούκα Τάνια" <[email protected]>
Cc: <[email protected]>
Sent: Thursday, May 12, 2011 7:39 PM
Subject: Re: sqlbox greek gsm-7


Hi again. %00 is the answer.
All the alphabet is here:
http://en.wikipedia.org/wiki/GSM_03.38

Best regards
Mike Nakos

On 12/05/11 14:08, Πετσούκα Τάνια wrote:
Thank you Mike,
i send greek properly using your settings.

The only problem i came up with is symbol '@'.

E.g : For greek letter Phi, Φ, i use : chr(hexdec( '0x12' )) ( or chr(hexdec( '%12') ) For greek letter Lamda, Λ, i use : chr(hexdec( '0x14' )) ( or chr(hexdec( '%14') ) For euro sign € i use : chr(hexdec('0x1B')).chr(hexdec('0x65'))
           .....etc

When it comes to '@' if i replace it to chr(hexdec( '0x00' )) according to gsm mapping, http://www.cardboardfish.com/support/bin/view/Main/GSMEncoding
the message after this character disappears.
I tried to replace it with chr(hexdec( '%40' )) , and i got 'i' in its position to the received message.

So, do you know which is the proper way to send  '@'?


----- Original Message ----- From: "Mike Nakos" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, May 11, 2011 8:14 PM
Subject: Re: Re: sqlbox greek gsm-7


Hello Tania.
I use the below settings on my kannel.conf file

group = smsc
smsc = smpp
smsc-id = <myprovider>
host = <ip address>
port = <smsc port>
receive-port = <smsc port>
smsc-username = <username>
smsc-password = <password>
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 1
#dest-addr-np = 1
bind-addr-ton = 0
bind-addr-npi = 1
system-type = "VMA"
enquire-link-interval = 30
reconnect-delay = 10
throughput = 20
validityperiod = 1340
alt-charset = "UTF-8"


I don't use alt_dcs and set charset field on sms_send table to UTF-8 also.

Of course, any Greek character like Δ must be written %10 to msgdata field. Personally, I encode every single character to its gsm value. Always with % in front of it.

DB field and table encoding is utf-8 also.

Try these settings and follow the thread with title
SMS from sqlbox - Problem when sending more that 160 char with greek letters
on May 2011.
I think this will help you.

Best Regards
Mike Nakos








Reply via email to