aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-29 19:42:43 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-29 19:42:43 +0000
commit983ed2a0f4c35c326131d0a996af5688ad7708e3 (patch)
tree48eb654f96926d38952650fd6c9fb2eca389c4bd
parent2bf2e81c3389e83969057f9047e24e0457335438 (diff)
Merged revisions 114849 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r114849 | mmichelson | 2008-04-29 14:42:04 -0500 (Tue, 29 Apr 2008) | 22 lines Merged revisions 114848 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114848 | mmichelson | 2008-04-29 14:40:06 -0500 (Tue, 29 Apr 2008) | 14 lines Use the MACRO_CONTEXT and MACRO_EXTEN channel variables instead of the channel's macrocontext and macroexten fields. This is needed because if macros are daisy-chained, the incorrect context and extension are placed on the new channel. I also added locking to the channel prior to accessing these variables as noted in trunk's janitor project file. (closes issue #12549) Reported by: darren1713 Patches: app_queue.c.macroextenpatch uploaded by darren1713 (license 116) (with modifications from me) Tested by: putnopvut ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@114850 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_queue.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 6f7431698..906d44712 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2102,6 +2102,7 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
int status;
char tech[256];
char *location;
+ const char *macrocontext, *macroexten;
/* on entry here, we know that tmp->chan == NULL */
if ((tmp->lastqueue && tmp->lastqueue->wrapuptime && (time(NULL) - tmp->lastcall < tmp->lastqueue->wrapuptime)) ||
@@ -2184,14 +2185,18 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
tmp->chan->adsicpe = qe->chan->adsicpe;
/* Inherit context and extension */
- if (!ast_strlen_zero(qe->chan->macrocontext))
- ast_copy_string(tmp->chan->dialcontext, qe->chan->macrocontext, sizeof(tmp->chan->dialcontext));
+ ast_channel_lock(qe->chan);
+ macrocontext = pbx_builtin_getvar_helper(qe->chan, "MACRO_CONTEXT");
+ if (!ast_strlen_zero(macrocontext))
+ ast_copy_string(tmp->chan->dialcontext, macrocontext, sizeof(tmp->chan->dialcontext));
else
ast_copy_string(tmp->chan->dialcontext, qe->chan->context, sizeof(tmp->chan->dialcontext));
- if (!ast_strlen_zero(qe->chan->macroexten))
- ast_copy_string(tmp->chan->exten, qe->chan->macroexten, sizeof(tmp->chan->exten));
+ macroexten = pbx_builtin_getvar_helper(qe->chan, "MACRO_EXTEN");
+ if (!ast_strlen_zero(macroexten))
+ ast_copy_string(tmp->chan->exten, macroexten, sizeof(tmp->chan->exten));
else
ast_copy_string(tmp->chan->exten, qe->chan->exten, sizeof(tmp->chan->exten));
+ ast_channel_unlock(qe->chan);
/* Place the call, but don't wait on the answer */
if ((res = ast_call(tmp->chan, location, 0))) {