[asterisk-commits] tilghman: branch 1.6.0 r235423 - in /branches/1.6.0: ./ main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 17 11:24:31 CST 2009


Author: tilghman
Date: Thu Dec 17 11:24:28 2009
New Revision: 235423

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=235423
Log:
Merged revisions 235422 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r235422 | tilghman | 2009-12-17 11:19:08 -0600 (Thu, 17 Dec 2009) | 15 lines
  
  Merged revisions 235421 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r235421 | tilghman | 2009-12-17 11:17:51 -0600 (Thu, 17 Dec 2009) | 8 lines
    
    Use context from which Macro is executed, not macro context, if applicable.
    Also, ensure that the extension COULD match, not just that it won't match more.
    (closes issue #16113)
     Reported by: OrNix
     Patches: 
           20091216__issue16113.diff.txt uploaded by tilghman (license 14)
     Tested by: OrNix
  ........
................

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

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

Modified: branches/1.6.0/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.0/main/pbx.c?view=diff&rev=235423&r1=235422&r2=235423
==============================================================================
--- branches/1.6.0/main/pbx.c (original)
+++ branches/1.6.0/main/pbx.c Thu Dec 17 11:24:28 2009
@@ -7919,8 +7919,16 @@
 	if (ast_strlen_zero(args.lang))
 		args.lang = (char *)chan->language;	/* XXX this is const */
 
-	if (ast_strlen_zero(args.context))
-		args.context = chan->context;
+	if (ast_strlen_zero(args.context)) {
+		const char *context;
+		ast_channel_lock(chan);
+		if ((context = pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT"))) {
+			args.context = ast_strdupa(context);
+		} else {
+			args.context = chan->context;
+		}
+		ast_channel_unlock(chan);
+	}
 
 	if (args.options) {
 		if (!strcasecmp(args.options, "skip"))
@@ -7978,7 +7986,9 @@
 	 * gone immediately to the "i" extension, but will now need to wait for a
 	 * timeout.
 	 */
-	if ((exten[0] = res) && !ast_matchmore_extension(chan, args.context, exten, 1, chan->cid.cid_num)) {
+	if ((exten[0] = res) &&
+			ast_canmatch_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