On 08/17/2012 02:28 AM, Olle E. Johansson wrote:
If a call is forwarded and hit the dialplan again, it's forwarded to the 
context set in the channel variable FORWARD_CONTEXT.

So you could set this variable before you hit queue(), then do things 
differently in the context specified by this variable, since you know that the 
call is forwarded.

This sounds like just what I need, but I can't get it to work. Looks to me like FORWARD_CONTEXT is being ignored, and the forward target number is being interpreted in the default context. Am I doing something wrong?

The queue is entered like this:

same => n(to-queue),Set(FORWARD_CONTEXT=confirmation-required)
same => n,Queue(${queuename},${app_options},,,300)

[confirmation-required]
exten => _X!,1,Verbose(3,Calling ${EXTEN} with confirmation required)
     same => n,Dial(Local/${EXTEN}@default/n)
     same => n,Hangup(NO_ANSWER)

Now when I call the queue, with an agent logged in that has his handset set to redirect, I see this in the console:

-- Executing [s@support-queues-exit:5010] Set("SIP/pfrost-00000012", "FORWARD_CONTEXT=confirmation-required") in new stack -- Executing [s@support-queues-exit:5011] Queue("SIP/pfrost-00000012", "support,rn,,,300") in new stack -- SIP/pfrost-00000013 connected line has changed. Saving it until answer for SIP/pfrost-00000012
-- Got SIP response 302 "Moved Temporarily" back from 172.20.25.126:3072
-- Now forwarding SIP/pfrost-00000012 to 'Local/912485551234@default' (thanks to SIP/pfrost-00000013)

SIP tracing shows the response from the phone as:

SIP/2.0 302 Moved Temporarily
Via: SIP/2.0/UDP 172.20.20.6:5060;branch=z9hG4bK6ad7c9fd;rport=5060
From: "Phil Frost" <sip:[email protected]>;tag=as719c88e2
To: <sip:[email protected]:3072;line=l1no5zvm>;tag=y5f8ddjzb0
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Contact: <sip:[email protected];user=phone>
Diversion: <sip:[email protected]:3072;line=l1no5zvm>;reason="unconditional"
Content-Length: 0

I'm using Asterisk from the Digium Debian repo. core show version reports:

Asterisk 1.8.11.1-1digium1~squeeze built by pbuilder @ nighthawk on a x86_64 running Linux on 2012-04-25 17:23:34 UTC


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to