<< Back Home RU ru   Donate Donate www/www1/www2

SMS/USSD fixes for Asterisk chan_datacard

by Alter ( (remove X))

I'm using chan_datacard Rev. 185 (as far as I understand from sources). And I meat the following problem:

  1. 7-bit USSD replies are decoded incorrectly in some cases
  2. sometimes datacard unexpectedly falls into SMS promt and cannot be reset via 'datacard reset' command. Only hard reset (e.g. via powerdown) helps
  3. 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 monitored I/O).
  4. It is impossible to send special characters like quotation mark, new line, etc.

I've fixed all these problems:

  1. there was incorrect encoding detection (I've taken proper conditions from SmsTools)
  2. added sending of ^Z when unexpected SMS prompt encountered (may be it is necessary to send Esc to abort operation)
  3. 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.
  4. 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)
\\r\r (Return)
\\n\n (New Line)
\\q' (Single quotation mark)
\\Q" (Double quotation mark)
\\u? (Question mark)
\\t (Tab)
\\s (Space)
\\z^Z (Ctrl-Z)
\\[^[ (Escape)


> 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 (remove X)  
designed by Alter aka Alexander A. Telyatnikov powered by Apache+PHP under FBSD © 2002-2017