[svn-commits] mjordan: tag 10.1.2 r354642 - in /tags/10.1.2: ./ apps/ channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Feb 9 13:13:18 CST 2012


Author: mjordan
Date: Thu Feb  9 13:13:16 2012
New Revision: 354642

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=354642
Log:
Committing 354496, 354543, 354548 for 10.1.2

Removed:
    tags/10.1.2/asterisk-10.1.1-summary.html
    tags/10.1.2/asterisk-10.1.1-summary.txt
Modified:
    tags/10.1.2/   (props changed)
    tags/10.1.2/.version
    tags/10.1.2/ChangeLog
    tags/10.1.2/apps/app_parkandannounce.c
    tags/10.1.2/channels/chan_sip.c

Propchange: tags/10.1.2/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb  9 13:13:16 2012
@@ -1,1 +1,1 @@
-/branches/10:349732,350553,351289,351308,351505,352015,352228
+/branches/10:349732,350553,351289,351308,351505,352015,352228,354496,354543,354548

Modified: tags/10.1.2/.version
URL: http://svnview.digium.com/svn/asterisk/tags/10.1.2/.version?view=diff&rev=354642&r1=354641&r2=354642
==============================================================================
--- tags/10.1.2/.version (original)
+++ tags/10.1.2/.version Thu Feb  9 13:13:16 2012
@@ -1,1 +1,1 @@
-10.1.1
+10.1.2

Modified: tags/10.1.2/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/10.1.2/ChangeLog?view=diff&rev=354642&r1=354641&r2=354642
==============================================================================
--- tags/10.1.2/ChangeLog (original)
+++ tags/10.1.2/ChangeLog Thu Feb  9 13:13:16 2012
@@ -1,3 +1,27 @@
+2012-02-09  Asterisk Development Team <asteriskteam at digium.com>
+
+	* Asterisk 10.1.2 Released.
+
+	* channels/chan_sip.c: Fix SIP INFO DTMF handling for non-numeric
+	  codes.  In ASTERISK-18924, SIP INFO DTMF handling was changed to
+	  account for both lowercase alphabetic DTMF events, as well as
+	  uppercase alphabetic DTMF events.  When this occurred, the comparison
+	  of the character buffer containing the event code was changed such
+	  that the buffer was first compared against '0' and '9' to determine if
+	  it was numeric.  Unfortunately, since the first character in the
+	  buffer will typically be '1' in the case of non-numeric event codes
+	  (10-16), this caused those codes to be converted to a DTMF event of
+	  '1'.  This patch fixes that, and cleans up handling of both
+	  application/dtmf-relay and application/dtmf content types.
+	  Review: https://reviewboard.asterisk.org/r/1722/
+	  (closes issue ASTERISK-19290) Reported by: Ira Emus
+	  Tested by: mjordan
+
+	* apps/app_parkandannounce.c: Fix crash in ParkAndAnnounce from
+	  uninitiliazed caller_id storage (closes issue ASTERISK-19311)
+	  Reported by: tootai
+	  Tested by: rmudgett
+
 2012-02-06  Asterisk Development Team <asteriskteam at digium.com>
 
 	* Asterisk 10.1.1 Released.

Modified: tags/10.1.2/apps/app_parkandannounce.c
URL: http://svnview.digium.com/svn/asterisk/tags/10.1.2/apps/app_parkandannounce.c?view=diff&rev=354642&r1=354641&r2=354642
==============================================================================
--- tags/10.1.2/apps/app_parkandannounce.c (original)
+++ tags/10.1.2/apps/app_parkandannounce.c Thu Feb  9 13:13:16 2012
@@ -150,6 +150,7 @@
 	}
 
 	/* Save the CallerID because the masquerade turns chan into a ZOMBIE. */
+	ast_party_id_init(&caller_id);
 	ast_channel_lock(chan);
 	ast_party_id_copy(&caller_id, &chan->caller.id);
 	ast_channel_unlock(chan);

Modified: tags/10.1.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/tags/10.1.2/channels/chan_sip.c?view=diff&rev=354642&r1=354641&r2=354642
==============================================================================
--- tags/10.1.2/channels/chan_sip.c (original)
+++ tags/10.1.2/channels/chan_sip.c Thu Feb  9 13:13:16 2012
@@ -19024,7 +19024,8 @@
 
 	/* Need to check the media/type */
 	if (!strcasecmp(c, "application/dtmf-relay") ||
-	    !strcasecmp(c, "application/vnd.nortelnetworks.digits")) {
+	    !strcasecmp(c, "application/vnd.nortelnetworks.digits") ||
+	    !strcasecmp(c, "application/dtmf")) {
 		unsigned int duration = 0;
 
 		if (!p->owner) {	/* not a PBX call */
@@ -19033,44 +19034,55 @@
 			return;
 		}
 
-		/* Try getting the "signal=" part */
-		if (ast_strlen_zero(c = get_body(req, "Signal", '=')) && ast_strlen_zero(c = get_body(req, "d", '='))) {
-			ast_log(LOG_WARNING, "Unable to retrieve DTMF signal from INFO message from %s\n", p->callid);
-			transmit_response(p, "200 OK", req); /* Should return error */
-			return;
+		/* If dtmf-relay or vnd.nortelnetworks.digits, parse the signal and duration;
+		 * otherwise use the body as the signal */
+		if (strcasecmp(c, "application/dtmf")) {
+			const char *msg_body;
+
+			if (   ast_strlen_zero(msg_body = get_body(req, "Signal", '='))
+				&& ast_strlen_zero(msg_body = get_body(req, "d", '='))) {
+				ast_log(LOG_WARNING, "Unable to retrieve DTMF signal for INFO message on "
+						"call %s\n", p->callid);
+				transmit_response(p, "200 OK", req);
+				return;
+			}
+			ast_copy_string(buf, msg_body, sizeof(buf));
+
+			if (!ast_strlen_zero((msg_body = get_body(req, "Duration", '=')))) {
+				sscanf(msg_body, "%30u", &duration);
+			}
 		} else {
-			ast_copy_string(buf, c, sizeof(buf));
-		}
-
-		if (!ast_strlen_zero((c = get_body(req, "Duration", '=')))) {
-			duration = atoi(c);
-		}
-		if (!duration) {
-			duration = 100; /* 100 ms */
-		}
-
-
+			/* Type is application/dtmf, simply use what's in the message body */
+			get_msg_text(buf, sizeof(buf), req);
+		}
+
+		/* An empty message body requires us to send a 200 OK */
 		if (ast_strlen_zero(buf)) {
 			transmit_response(p, "200 OK", req);
 			return;
 		}
 
-		if ('0' <= buf[0] && buf[0] <= '9') {
-			event = buf[0] - '0';
-		} else if (buf[0] == '*') {
+		if (!duration) {
+			duration = 100; /* 100 ms */
+		}
+
+		if (buf[0] == '*') {
 			event = 10;
 		} else if (buf[0] == '#') {
 			event = 11;
+		} else if (buf[0] == '!') {
+			event = 16;
 		} else if ('A' <= buf[0] && buf[0] <= 'D') {
 			event = 12 + buf[0] - 'A';
 		} else if ('a' <= buf[0] && buf[0] <= 'd') {
 			event = 12 + buf[0] - 'a';
-		} else if (buf[0] == '!') {
-			event = 16;
-		} else {
-			/* Unknown digit */
-			event = 0;
-		}
+		} else if ((sscanf(buf, "%30u", &event) != 1) || event > 16) {
+			ast_log(AST_LOG_WARNING, "Unable to convert DTMF event signal code to a valid "
+					"value for INFO message on call %s\n", p->callid);
+			transmit_response(p, "200 OK", req);
+			return;
+		}
+
 		if (event == 16) {
 			/* send a FLASH event */
 			struct ast_frame f = { AST_FRAME_CONTROL, { AST_CONTROL_FLASH, } };
@@ -19087,7 +19099,7 @@
 				f.subclass.integer = '*';
 			} else if (event == 11) {
 				f.subclass.integer = '#';
-			} else if (event < 16) {
+			} else {
 				f.subclass.integer = 'A' + (event - 12);
 			}
 			f.len = duration;
@@ -19098,55 +19110,6 @@
 		}
 		transmit_response(p, "200 OK", req);
 		return;
-	} else if (!strcasecmp(c, "application/dtmf")) {
-		/*! \todo Note: Doesn't read the duration of the DTMF. Should be fixed. */
-		unsigned int duration = 0;
-
-		if (!p->owner) {	/* not a PBX call */
-			transmit_response(p, "481 Call leg/transaction does not exist", req);
-			sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
-			return;
-		}
-
-		get_msg_text(buf, sizeof(buf), req);
-		duration = 100; /* 100 ms */
-
-		if (ast_strlen_zero(buf)) {
-			transmit_response(p, "200 OK", req);
-			return;
-		}
-		event = atoi(buf);
-		if (event == 16) {
-			/* send a FLASH event */
-			struct ast_frame f = { AST_FRAME_CONTROL, { AST_CONTROL_FLASH }, };
-			ast_queue_frame(p->owner, &f);
-			if (sipdebug) {
-				ast_verbose("* DTMF-relay event received: FLASH\n");
-			}
-		} else {
-			/* send a DTMF event */
-			struct ast_frame f = { AST_FRAME_DTMF, };
-			if (event < 10) {
-				f.subclass.integer = '0' + event;
-			} else if (event == 10) {
-				f.subclass.integer = '*';
-			} else if (event == 11) {
-				f.subclass.integer = '#';
-			} else if (event < 16) {
-				f.subclass.integer = 'A' + (event - 12);
-			} else {
-				/* Unknown digit. */
-				f.subclass.integer = '0';
-			}
-			f.len = duration;
-			ast_queue_frame(p->owner, &f);
-			if (sipdebug) {
-				ast_verbose("* DTMF-relay event received: %c\n", (int) f.subclass.integer);
-			}
-		}
-		transmit_response(p, "200 OK", req);
-		return;
-
 	} else if (!strcasecmp(c, "application/media_control+xml")) {
 		/* Eh, we'll just assume it's a fast picture update for now */
 		if (p->owner) {




More information about the svn-commits mailing list