]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make app_queue calls work with directed pickup.
authorJoshua Colp <jcolp@digium.com>
Tue, 8 Jan 2008 18:36:40 +0000 (18:36 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 8 Jan 2008 18:36:40 +0000 (18:36 +0000)
(closes issue #11700)
Reported by: jbauer

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97093 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 2be4d03dcfbd77aee78865a19e55a2008b100bac..ac8845ce116c44deca596e02670076f974c1dc97 100644 (file)
@@ -1861,6 +1861,16 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
        /* Presense of ADSI CPE on outgoing channel follows ours */
        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));
+       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));
+       else
+               ast_copy_string(tmp->chan->exten, qe->chan->exten, sizeof(tmp->chan->exten));
+
        /* Place the call, but don't wait on the answer */
        if ((res = ast_call(tmp->chan, location, 0))) {
                /* Again, keep going even if there's an error */