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

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Nov 25 16:14:12 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:                     ready for testing
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-25 16:14 CST
====================================================================== 
Summary:                    [patch] 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?
====================================================================== 

---------------------------------------------------------------------- 
 (0114301) Artem (reporter) - 2009-11-25 16:14
 https://issues.asterisk.org/view.php?id=16278#c114301 
---------------------------------------------------------------------- 
Hello,

I had not the time to review the patch but I did a quick functionality
test:

It works.

But I have noticed that I am getting the "rfcomm_read_cmgr: error  +CMGR
message on rfcomm socket" error message and the \r\n are trimmed away and
are not passed through. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-11-25 16:14 Artem          Note Added: 0114301                          
======================================================================




More information about the asterisk-bugs mailing list