[asterisk-addons-commits] mnicholson: trunk r869 - /trunk/channels/chan_mobile.c

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Tue Apr 14 15:26:46 CDT 2009


Author: mnicholson
Date: Tue Apr 14 15:26:42 2009
New Revision: 869

URL: http://svn.digium.com/svn-view/asterisk-addons?view=rev&rev=869
Log:
Fix parsing of CMTI unsolicited response codes.

(closes issue #14896)
Reported by: jongerenchaos

Modified:
    trunk/channels/chan_mobile.c

Modified: trunk/channels/chan_mobile.c
URL: http://svn.digium.com/svn-view/asterisk-addons/trunk/channels/chan_mobile.c?view=diff&rev=869&r1=868&r2=869
==============================================================================
--- trunk/channels/chan_mobile.c (original)
+++ trunk/channels/chan_mobile.c Tue Apr 14 15:26:42 2009
@@ -2003,13 +2003,12 @@
  */
 static int hfp_parse_cmti(struct hfp_pvt *hfp, char *buf)
 {
-	int index;
-	char mem[8];
+	int index = -1;
 
 	/* parse cmti info in the following format:
 	 * +CMTI: <mem>,<index> 
 	 */
-	if (!sscanf(buf, "+CMTI: %7s,%d", mem, &index)) {
+	if (!sscanf(buf, "+CMTI: %*[^,],%d", &index)) {
 		ast_debug(2, "[%s] error parsing CMTI event '%s'\n", hfp->owner->id, buf);
 		return -1;
 	}




More information about the asterisk-addons-commits mailing list