[asterisk-users] Requiring agent to confirm queue calls only when forwarded to external device
Phil Frost
phil at macprofessionals.com
Fri Aug 17 09:09:17 CDT 2012
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 at support-queues-exit:5010] Set("SIP/pfrost-00000012",
"FORWARD_CONTEXT=confirmation-required") in new stack
-- Executing [s at 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 at 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:207 at 172.20.20.6>;tag=as719c88e2
To: <sip:pfrost at 172.20.25.126:3072;line=l1no5zvm>;tag=y5f8ddjzb0
Call-ID: 22d43bc765acbcdd20da386e28ab8ed3 at 172.20.20.6:5060
CSeq: 102 INVITE
Contact: <sip:912485551234 at asterisk02.macprofessionals.lan;user=phone>
Diversion:
<sip:pfrost at 172.20.25.126: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
More information about the asterisk-users
mailing list