krysa79 / asterisk-chan-dongle

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

Strange charset conversion for received SMS #123

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using chan_dongle 1.1.r29 on asterisk 1:1.6.2.9-2+squeeze10 (debian 
squeeze), with an K3765, and works perfectly for audio, but i've still some 
trouble with SMS.

I've configured my cordless phone (a gigaset IP one) to send and receive SMS, 
using asterisk SMS(), and i can send flawlessy SMS to internal phones and (via 
SendSMS()) to external one using the dongle. I've laso tried to use the CLI, 
and on sending part charset are correctly converted and works; a log exerpt 
looks like:

  == Using SIP RTP CoS mark 5
  == Using SIP VRTP CoS mark 6
    -- Executing [28110@uscita:1] Answer("SIP/sgs450ip-00000013", "") in new stack
    -- Executing [28110@uscita:2] Wait("SIP/sgs450ip-00000013", "1") in new stack
    -- Executing [28110@uscita:3] SMS("SIP/sgs450ip-00000013", "212,as") in new stack
 sms argc 2 queue <212> opts <as> addr <> body <>
 initial delay 300ms
    -- SMS TX 93 00
       > doing dnsmgr_lookup for 'sip.messagenet.it'
    -- SMS RX 91 1D 01 44 0A 81 23 78 53 27 46 00 00 13 D1 7A 79 4E 0F 83 0A A0 BA 3B 0C 82 CB DF F6 B0...
    -- SMS TX 95 02 00 00
       > doing dnsmgr_lookup for 'voip.eutelia.it'  
       > ast_get_srv: SRV lookup for '_sip._UDP.voip.eutelia.it' mapped to host voip.eutelia.it, port 5060
    -- SMS RX 94 00 6C
[2013-04-12 23:35:05] NOTICE[14572]: app_sms.c:2026 sms_exec: channel hangup
    -- Executing [28110@uscita:4] AGI("SIP/sgs450ip-00000013", "smsread") in new stack
    -- Launched AGI Script /usr/share/asterisk/agi-bin/smsread
    -- <SIP/sgs450ip-00000013>AGI Script smsread completed, returning 0
    -- Executing [28110@uscita:5] Goto("SIP/sgs450ip-00000013", "smsout,XXXXXXXXXX,1") in new stack
    -- Goto (smsout,XXXXXXXXXX,1)
    -- Executing [XXXXXXXXXX@smsout:1] DongleStatus("SIP/sgs450ip-00000013", "dongle0,DONGLE0_STATUS") in new stack
    -- Executing [XXXXXXXXXX@smsout:2] GotoIf("SIP/sgs450ip-00000013", "1?3:4") in new stack
    -- Goto (smsout,XXXXXXXXXX,3)
    -- Executing [XXXXXXXXXX@smsout:3] DongleSendSMS("SIP/sgs450ip-00000013", "dongle0,+39XXXXXXXXXX,"Questa é una prova."") in new stack
    -- Executing [XXXXXXXXXX@smsout:4] Hangup("SIP/sgs450ip-00000013", "") in new stack
  == Spawn extension (smsout, XXXXXXXXXX, 4) exited non-zero on 'SIP/sgs450ip-00000013'
       > doing dnsmgr_lookup for 'sip.messagenet.it'
       > doing dnsmgr_lookup for 'voip.eutelia.it'
       > ast_get_srv: SRV lookup for '_sip._UDP.voip.eutelia.it' mapped to host voip.eutelia.it, port 5060
    -- [dongle0] Successfully sent SMS message 0xa2c1c18
[2013-04-12 23:35:06] NOTICE[4002]: at_response.c:257 at_response_ok: [dongle0] 
Successfully sent SMS message 0xa2c1c18

For received SMS, i send it via gtalk to mine and my wife google account, and i 
send also to the siemens cordless:

 [dongle0] Got SMS from +39XXXXXXXXXX: 'Questa  una prova.'
    -- Executing [sms@dongle:1] AGI("Local/sms@dongle-6724;1", "pblookup") in new stack
    -- Launched AGI Script /usr/share/asterisk/agi-bin/pblookup
    -- <Local/sms@dongle-6724;1>AGI Script pblookup completed, returning 0
    -- Executing [sms@dongle:2] Set("Local/sms@dongle-6724;1", "CALLERID(num)=XXXXXXXXXX") in new stack
    -- Executing [sms@dongle:3] Set("Local/sms@dongle-6724;1", "CALLERID(name)=Marco Gaiarin") in new stack
    -- Executing [sms@dongle:4] System("Local/sms@dongle-6724;1", "/usr/sbin/smsq --mt --oa=XXXXXXXXXX --mttx-callerid=28111 --mttx-channel=SIP/sgs450ip "Questa  una prov
    -- Executing [sms@dongle:5] JabberSend("Local/sms@dongle-6724;1", "gtalk,macogaio@gmail.com,SMS da XXXXXXXXXX (Marco Gaiarin): Questa  una prova.") in new stack
    -- Executing [sms@dongle:6] JabberSend("Local/sms@dongle-6724;1", "gtalk,YYYYYYYYY@gmail.com,SMS da XXXXXXXXXX (Marco Gaiarin): Questa  una prova.") in new stack
    -- Executing [sms@dongle:7] Hangup("Local/sms@dongle-6724;1", "") in new stack
  == Spawn extension (dongle, sms, 7) exited non-zero on 'Local/sms@dongle-6724;1'
    -- Attempting call on SIP/sgs450ip for application SMS(0,s) (Retry 1)
  == Using SIP RTP CoS mark 5
  == Using SIP VRTP CoS mark 6
       > Channel SIP/sgs450ip-0000001e was answered.
       > Launching SMS(0,s) on SIP/sgs450ip-0000001e
 sms argc 2 queue <0> opts <s> addr <> body <>
 initial delay 300ms
    -- SMS RX 93 00 6D
[2013-04-14 00:19:18] WARNING[4063]: app_sms.c:968 sms_readfile: Sending in 8 
bit format(/var/spool/asterisk/sms/mttx/0.1365891556-4062)
    -- SMS TX 91 25 00 0A 81 23 78 53 27 46 00 F5 31 40 41 00 91 81 48 13 51 75 65 73 74 61 20 05 20 75...
    -- SMS RX 95 02 00 00 69
    -- SMS TX 94 00
[2013-04-14 00:19:19] NOTICE[4063]: app_sms.c:2031 sms_exec: ast_read failed
[2013-04-14 00:19:19] NOTICE[4063]: pbx_spool.c:349 attempt_thread: Call 
completed to SIP/sgs450ip

As you can see, the accented char get mangled; i've also tried to send some set 
of GSM alphabet, and tried to compare the receving part, but seems some sort of 
(wrong) charset conversion occur, really i don't understand how.

I'm not a C programmer, but if needed i can do some test.

Thanks.

Original issue reported on code.google.com by macog...@gmail.com on 13 Apr 2013 at 10:33

GoogleCodeExporter commented 9 years ago
problem exists by historical reasons (chan_datacard) 

Original comment by bg_...@mail.ru on 27 Apr 2013 at 3:02

GoogleCodeExporter commented 9 years ago

Original comment by bg_...@mail.ru on 27 Apr 2013 at 3:21

GoogleCodeExporter commented 9 years ago
I'm not a skilled C programmer (really: i can read some C code...), but my 
system is now practically unused, and so i can at least do some test...

Say me if i can be useful in some way... thanks.

Original comment by macog...@gmail.com on 29 Apr 2013 at 1:18