[asterisk-bugs] [Asterisk 0018152]: Channel Variable SMSSRC not set properly

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Oct 18 12:11:46 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18152 
====================================================================== 
Reported By:                menschentier
Assigned To:                mnicholson
====================================================================== 
Project:                    Asterisk
Issue ID:                   18152
Category:                   Addons/chan_mobile
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 292052 
Request Review:              
====================================================================== 
Date Submitted:             2010-10-17 20:36 CDT
Last Modified:              2010-10-18 12:11 CDT
====================================================================== 
Summary:                    Channel Variable SMSSRC not set properly
Description: 
to make it simple - did not work before - works now

function changed:

static int hfp_parse_cmgr(struct hfp_pvt *hfp, char *buf, char
**from_number, char **text)
{
	int i, state;
	size_t s;

	/* parse cmgr info in the following format:
	 * +CMGR: <msg status>,"+123456789",...\r\n
	 * <message text>
	 */
	state = 0;
	s = strlen(buf);
	for (i = 0; i < s && state != 6; i++) { //not s != 6.....
		switch (state) {
		case 0: /* search for start of the number section (,) */
			if (buf[i] == ',') {
				state++;
			}
			break;
		case 1: /* find the opening quote (") */
			if (buf[i] == '"') {
				state++;
			}
			break; //made it break here
		case 2: /* mark the start of the number */
			if (from_number) {
				*from_number = &buf[i];
				state++;
			}
			/* fall through */
		case 3: /* search for the end of the number (") */
			if (buf[i] == '"') {
				buf[i] = '\0';
				state++;
			}
			break;
		case 4: /* search for the start of the message text (\n) */
			if (buf[i] == '\n') {
				state++;
			}
			break;
		case 5: /* mark the start of the message text */
			if (text) {
				*text = &buf[i];
				state++;
			}
			break;
		}
	}

	if (state != 6) {
		return -1;
	}

	return 0;
}



====================================================================== 

---------------------------------------------------------------------- 
 (0128165) svnbot (reporter) - 2010-10-18 12:11
 https://issues.asterisk.org/view.php?id=18152#c128165 
---------------------------------------------------------------------- 
Repository: asterisk-addons
Revision: 1136

U   branches/1.6.2/channels/chan_mobile.c

------------------------------------------------------------------------
r1136 | mnicholson | 2010-10-18 12:11:45 -0500 (Mon, 18 Oct 2010) | 6
lines

Fix cmgr parser.

(closes issue https://issues.asterisk.org/view.php?id=18152)
Reported by: menschentier


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk-addons?view=rev&revision=1136 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-10-18 12:11 svnbot         Checkin                                      
2010-10-18 12:11 svnbot         Note Added: 0128165                          
======================================================================




More information about the asterisk-bugs mailing list