]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Allow directed pickup to pick up the real context instead of the macro context if...
authorJoshua Colp <jcolp@digium.com>
Fri, 16 Feb 2007 17:02:35 +0000 (17:02 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 16 Feb 2007 17:02:35 +0000 (17:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54884 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_dial.c

index e19c4f107d13e7bb903c6e4691257a20689910b7..323647834e0e28e9845b2d36adb33cce8a571b9d 100644 (file)
@@ -1185,7 +1185,10 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                        ast_app_group_set_channel(tmp->chan, outbound_group);
 
                /* Inherit context and extension */
-               ast_copy_string(tmp->chan->dialcontext, chan->context, sizeof(tmp->chan->dialcontext));
+               if (!ast_strlen_zero(chan->macrocontext))
+                       ast_copy_string(tmp->chan->dialcontext, chan->macrocontext, sizeof(tmp->chan->dialcontext));
+               else
+                       ast_copy_string(tmp->chan->dialcontext, chan->context, sizeof(tmp->chan->dialcontext));
                ast_copy_string(tmp->chan->exten, chan->exten, sizeof(tmp->chan->exten));
 
                /* Place the call, but don't wait on the answer */