danshuk / asterisk-chan-dongle

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

Decoding/encoding 7bit messages not correspond to 3GPP TS 23.038 / GSM 03.38 #140

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Sending SMS with special symbols (@,{,},[,],/,\) converts not properly or 
stops SMS decoding process.

What is the expected output? What do you see instead?
For example, SMS with text: "My e-mail is aaa@bbb.ccc BR, Mike" converted to 
"My e-mail is aaa"

What version of the product are you using? On what operating system?
Asterisk 1.8.20.1 & chan_dongle 1.1.r14

Please provide any additional information below.
As additional information can propose small patch (maked with 'diff') for 
char_conv.c.
It allows you to make the correct conversion in both directions. 

But there's a new bug. In original version all conversion function is not 
transmitted real number of characters, but CMGR char count. Therefore, if the 
input SMS with 7bit encoding has a last byte 7bit placeholder - the last 
character of the result string will be a "@". 
For example SMS with the text "Testing" will be decoded as "Testing@".
Because text with 7 letters(Testing) and with 8 letters may be transmitted in 7 
bytes:
7 * 7 = 49   ==>  49 / 8 = 6,125 ~ 7bytes   ==>  14 CMGR chars...
8 * 7 = 56   ==>  56 / 8 = 7 bytes                ==>  14 CMGR chars...
and in char_conv.c in hexstr_7bit_to_char function counts of symbols calculated 
in next string:
in_length = in_length / 2;

In the original version extra character(@) was excluded because the last 7bit 
char (placeholder) decoded as 0x00 and was interpreted as a end line symbol.

Any comments are welcomed...

Original issue reported on code.google.com by smart.st...@gmail.com on 25 Jul 2013 at 2:07

Attachments:

GoogleCodeExporter commented 8 years ago
You are right, char conversion in original chan_datacard was wrong.
This mean need complete reworks.
I do this job, but not public, because SMS part of voice channel is hold.

I strictly recommend use external software for recode USSD, SMS after receive 
raw events in PDU mode.

Original comment by bg_...@mail.ru on 30 Jul 2013 at 6:51

GoogleCodeExporter commented 8 years ago

Original comment by bg_...@mail.ru on 30 Jul 2013 at 6:53

GoogleCodeExporter commented 8 years ago

Original comment by bg_...@mail.ru on 20 Oct 2013 at 11:37