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

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jan 31 13:49:24 CST 2011


The following issue has been UPDATED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18152 
====================================================================== 
Reported By:                menschentier
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18152
Category:                   Addons/chan_mobile
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     confirmed
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:              2011-01-31 13:49 CST
====================================================================== 
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;
}



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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-31 13:49 lmadsen        Description Updated                          
2011-01-31 13:49 lmadsen        Additional Information Updated                  
 
======================================================================




More information about the asterisk-bugs mailing list