SMS/USSD fixes for Asterisk chan_datacard
by Alter (alterX@alter.org.ua (remove X))
I'm using chan_datacard Rev. 185 (as far as I understand from sources).
And I met the following problem:
- 7-bit USSD replies are decoded incorrectly in some cases
- sometimes datacard unexpectedly falls into SMS promt and cannot be
reset via 'datacard reset' command. Only hard reset (e.g. via powerdown) helps
- datacard may (unpredictably) fall into state, when ERROR 305 is
returned after ^Z, however AT+CMGS and further encoded text are
correct. Sometimes, message was successfully sent with same parameters (I
- It is impossible to send special characters like quotation mark,
new line, etc.
I've fixed all these problems:
- there was incorrect encoding detection (I've taken proper
conditions from SmsTools)
- added sending of ^Z when unexpected SMS prompt encountered (may be
it is necessary to send Esc to abort operation)
- at least for those E1550 revisions I use, this unpredictable
behavior can be fixed by sending extra \r character after AT+CMGS="XXXXX"
In such case the following encoded line is always correctly accepted.
I also tried to make some delays after/before sending parts of SMS
data, without any success.
- added special processing of parsed command line (characters
escaped with \\ are treated as special). My be not too convenient
(special characters must also be separated with spaces), but works.
|escape-string (in Asterisk CLI)||encoded character (to be sent to device)|
|\\n||\n (New Line)|
|\\q||' (Single quotation mark)|
|\\Q||" (Double quotation mark)|
|\\u||? (Question mark)|
> datacard sms datacard0 Hello \\r World !!!
> datacard sms datacard0 Do you like \\s \\Q Heineken \\Q \\u
> datacard sms datacard0 Do you like \"Heineken\" \\u
> datacard cmd datacard0 AT+CMGF= \\u
All patches are sent to development team.
Mail to alterX@alter.org.ua (remove X)