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

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Mar 10 01:10:47 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
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:                       SWP-3008 
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-03-10 01:10 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;
}



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

---------------------------------------------------------------------- 
 (0132796) menschentier (reporter) - 2011-03-10 01:10
 https://issues.asterisk.org/view.php?id=18152#c132796 
---------------------------------------------------------------------- 
Updated recently to asterisk 1.8.3

Incoming SMS still do not work.

My working example:
exten => sms,1,Answer()
exten => sms,2,JabberSend(asterisk,xxx at jabber.xxx.de,SMS von ${SMSSRC}
erhalten)
exten => sms,3,Verbose(${SMSSRC})
exten => sms,4,JabberSend(asterisk,wolf at jabber.xxx.de,${SMSTXT})
exten => sms,5,Hangup()

willing to test anything that might work

greetings

Simon 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-03-10 01:10 menschentier   Note Added: 0132796                          
======================================================================




More information about the asterisk-bugs mailing list