[asterisk-bugs] [JIRA] (ASTERISK-16822) Channel Variable SMSSRC not set properly
Matt Jordan (JIRA)
noreply at issues.asterisk.org
Tue Jan 15 22:19:45 CST 2013
[ https://issues.asterisk.org/jira/browse/ASTERISK-16822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Jordan closed ASTERISK-16822.
----------------------------------
Resolution: Fixed
> Channel Variable SMSSRC not set properly
> ----------------------------------------
>
> Key: ASTERISK-16822
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-16822
> Project: Asterisk
> Issue Type: Bug
> Components: Addons/chan_mobile
> Reporter: menschentier
> Severity: Minor
> Attachments: fixSMSSRC.patch, fixSMSSRC.patch
>
>
> 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;
> }
> ****** ADDITIONAL INFORMATION ******
> after spending two days to get chan_mobile working for me the last unsolved issue gave me no peace and I started looking at the code...
> I'm not a big programmer and until tonight I've never done c before - so all the pointer stuff is quite confusing to me. May the original author take this, improve it and maybe include something like ${SMSDATE} and ${SMSTIME} which would be really nice to have
> i tested several times - it never worked with my nokia 6230i, after bugfixing, it does - i finally get sms on my jabber account with the number displayed :)
> greetings...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the asterisk-bugs
mailing list