atefsaeed2010 / asterisk-chan-dongle-01

Automatically exported from code.google.com/p/asterisk-chan-dongle
Other
0 stars 1 forks source link

SMS read - Charset conversion - accented char #172

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
send sms from phone like: ciao L'occhio àèìòù ...
Read SMS with chan_dongle

What is the expected output?
Expected: ciao L'occhio àèìòù

What do you see instead?
other ascii char
 楣潡ഠ쌊슃쎠슃쎨슃€਍❬漧捣楨਍畍瑬浩摥捩⁡

What version of the product are you using? On what operating system?
chan_dongle: Huawei 3G Dongle Channel Driver, Version 1.1, Revision 34
asterisk 11

Please provide any additional information below.

I tried to use ICONV() function in extension_custom.conf, change system $LANG 
to iso89591 but I always got  wrong chars from sms 

now my CentOS locale is back to:
LANG=it_IT.UTF-8

this is my my extension_custom.conf
[dongle-incoming-sms]
exten => sms,1,Noop(Incoming SMS from ${CALLERID(num)} 
${BASE64_DECODE(${SMS_BASE64})})
exten => 
sms,n,Set(SMS_MOD=${ICONV(ISO_8859-1,UTF-8,${BASE64_DECODE(${SMS_BASE64})})}
exten => sms,n,System(echo '${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - 
${DONGLENAME} - ${CALLERID(num)}: ${REPLACE(SMS_MOD,\', \'\')}' >> 
/var/log/asterisk/sms.txt)
exten => sms,n,Hangup()

is there any way to get correct text?

http://wiki.e1550.mobi/doku.php?id=introduction says: 
- Receive SMS (latin charset and multiline included)
, but not

Rudy

Original issue reported on code.google.com by ru...@tin.it on 22 May 2014 at 9:41

GoogleCodeExporter commented 9 years ago
I think its problem with console localization
current chan_dongle have historical problems with GSM->utf8 and latin->utf8 
decoding
But output always is UTF8 - locale  irrelevant  like LANG LANGUAGE etc

Original comment by bg_...@mail.ru on 23 Jul 2014 at 7:47

GoogleCodeExporter commented 9 years ago
Thankyou, I though  was a charset conversion problem making experiments on 
writing  the output to a file and I also notice there was a problem to get 
multipart sms from chan_dongle. So I decided to write my own code to translate 
directly from pdu.
At today I can decode single and multipart 7bitencodecd sms from pdu passing it 
to an agi php script for writing to mysql, and encode  single and multipart pdu 
 from a web interface  to pass to chan_dongle for delivery.  It was wery hard 
to do for me because I'm not a professional coder, but it works 
well...understanding the unpak/pack octects/septepts from/to characters with 
padding bits in multipart sms was the hardest job due to the frammentary 
documentation available on the web.
I'm sorry not to be able to fix your code to decode multipart sms

Thankyou for the great job you've done on chan_dongle

Rudy

Original comment by ru...@tin.it on 24 Jul 2014 at 11:10