[asterisk-bugs] [Asterisk 0016278]: Incoming multiline SMS causes chan_mobile to stop working

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Nov 24 15:09:24 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16278 
====================================================================== 
Reported By:                Artem
Assigned To:                mnicholson
====================================================================== 
Project:                    Asterisk
Issue ID:                   16278
Category:                   Addons/chan_mobile
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-11-18 17:04 CST
Last Modified:              2009-11-24 15:09 CST
====================================================================== 
Summary:                    Incoming multiline SMS causes chan_mobile to stop
working
Description: 
Hello,

multiline SMS messages makes the channel driver get "out of sync" with the
mobile phone.

Here is an example of an incoming SMS:

+CMGR: \"REC UNREAD\",\"+49xxxxxxxx\",,\"09/11/15,22:35:56+04\"\r\n
Anruf-Info:\r\n
0xxxxxxx hat  versucht Sie anzurufen (15.11. um 22:35 Uhr)\r\n
* Diese SMS ist fuer Sie kostenlos\r\n
\r\n
OK\r\n\

The only part of the SMS that chan_mobile reads is the line
"Anruf-Info:\r\n".
Then it expects the OK response and other (further) commands.

Each command it expects should have this format:
\r\n
COMMAND\r\n

But after receiving this sms the OK message of will look like this for the
channel driver:

OK\r\n
\r\n   <-- next AT command could start, but chan_mobile thinks, that this
is the rest of the OK command)
RING\r\n <-- chan_mobile will start to read in the next command just here

(1st Command would be: OK\r\n\r\n   and the 2nd comand would be RING\r\n
....)

So new incoming commands/responses will not be read in anymore in the
correct format. It will not possible to receive or place new calls and so
on.


I am not sure how to fix this problem. I am thinking about getting the
rest of the message directly in hfp_parse_cmgr by reading from the rfcomm
until we get a \r\nOK\r\n.

What do you think?
====================================================================== 

---------------------------------------------------------------------- 
 (0114255) mnicholson (administrator) - 2009-11-24 15:09
 https://issues.asterisk.org/view.php?id=16278#c114255 
---------------------------------------------------------------------- 
I plan to fix this by parsing the entire SMS message including the
terminating \r\nOK\r\n in rfcomm_read_result(). 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-11-24 15:09 mnicholson     Note Added: 0114255                          
======================================================================




More information about the asterisk-bugs mailing list