[asterisk-commits] tilghman: branch 1.6.2 r193123 - in /branches/1.6.2: ./ main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 7 18:44:42 CDT 2009


Author: tilghman
Date: Thu May  7 18:44:37 2009
New Revision: 193123

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193123
Log:
Merged revisions 193120 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r193120 | tilghman | 2009-05-07 18:42:28 -0500 (Thu, 07 May 2009) | 26 lines
  
  Merged revisions 193119 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r193119 | tilghman | 2009-05-07 18:41:11 -0500 (Thu, 07 May 2009) | 19 lines
    
    Fix Background within a Macro for FreePBX.
    If the single digit DTMF is an extension in the specified context, then
    go there and signal no DTMF.  Otherwise, we should exit with that DTMF.
    If we're in Macro, we'll exit and seek that DTMF as the beginning of an
    extension in the Macro's calling context.  If we're not in Macro, then
    we'll simply seek that extension in the calling context.  Previously,
    someone complained about the behavior as it related to the interior of a
    Gosub routine, and the fix (#14011) inadvertently broke FreePBX
    (#14940).  This change should fix both of these situations, but with the
    possible incompatibility that if a single digit extension does not exist
    (but a longer extension COULD have matched), it would have previously
    gone immediately to the "i" extension, but will now need to wait for a
    timeout.
    (closes issue #14940)
     Reported by: p_lindheimer
     Patches: 
           20090420__bug14940.diff.txt uploaded by tilghman (license 14)
     Tested by: p_lindheimer
  ........
................

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/pbx.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/main/pbx.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/main/pbx.c?view=diff&rev=193123&r1=193122&r2=193123
==============================================================================
--- branches/1.6.2/main/pbx.c (original)
+++ branches/1.6.2/main/pbx.c Thu May  7 18:44:37 2009
@@ -8737,7 +8737,7 @@
 	int res = 0;
 	int mres = 0;
 	struct ast_flags flags = {0};
-	char *parse;
+	char *parse, exten[2] = "";
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(filename);
 		AST_APP_ARG(options);
@@ -8801,7 +8801,22 @@
 			ast_stopstream(chan);
 		}
 	}
-	if (strcmp(args.context, chan->context) && res) {
+
+	/*
+	 * If the single digit DTMF is an extension in the specified context, then
+	 * go there and signal no DTMF.  Otherwise, we should exit with that DTMF.
+	 * If we're in Macro, we'll exit and seek that DTMF as the beginning of an
+	 * extension in the Macro's calling context.  If we're not in Macro, then
+	 * we'll simply seek that extension in the calling context.  Previously,
+	 * someone complained about the behavior as it related to the interior of a
+	 * Gosub routine, and the fix (#14011) inadvertently broke FreePBX
+	 * (#14940).  This change should fix both of these situations, but with the
+	 * possible incompatibility that if a single digit extension does not exist
+	 * (but a longer extension COULD have matched), it would have previously
+	 * gone immediately to the "i" extension, but will now need to wait for a
+	 * timeout.
+	 */
+	if ((exten[0] = res) && (ast_exists_extension(chan, args.context, exten, 1, chan->cid.cid_num) || !ast_matchmore_extension(chan, args.context, exten, 1, chan->cid.cid_num))) {
 		snprintf(chan->exten, sizeof(chan->exten), "%c", res);
 		ast_copy_string(chan->context, args.context, sizeof(chan->context));
 		chan->priority = 0;




More information about the asterisk-commits mailing list