hi, i use call file to setup calls.Here is the call file examples:
Channel:SIP/13012345678@TG1-VD1
Context:callout
Extension: _X.
Callerid:<031187632>
Account:aliese
MaxRetries:0
RetryTime:300
WaitTime:45
Archive:yes
Setvar:dst=18098786765
when 13012345678 answers, go to callout context. and the context have to dial dst.
channel.exec(“Dial”, dialPrefix + “/” + call.getPrefixedDst() + call.getSipTrunk() +“,300,U(custom-dial-handler^s^1))”);
channel.exec(“NoOp”,“Answered at:” + channel.getVariable(“ANSWERED_TIME”));
channel.exec(“NoOp”,“Answered at:” + channel.getVariable(“__ANSWERED_TIME”));
here is the
[custom-dial-handler]
exten => s,1,Set(ring_start=${EPOCH})
same => n,Set(CDR(answeredtime)=${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)})
same => n,Set(__ANSWERED_TIME=${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)})
same => n,Return()
but after return ,i cann’t get the __ANSWERED_TIME,here is the log:
-- SIP/TG1-VD1-00000075 Internal Gosub(custom-dial-handler,s,1(s,1)) start
-- Executing [s@custom-dial-handler:1] Set("SIP/SS1-VD1-00000075", "ring_start=1733844014") in new stack
-- Executing [s@custom-dial-handler:2] NoOp("SIP/SS1-VD1-00000075", "helll,") in new stack
-- Executing [s@custom-dial-handler:3] Set("SIP/SS1-VD1-00000075", "CDR(answeredtime)=2024-12-10 23:20:14") in new stack
-- Executing [s@custom-dial-handler:4] Set("SIP/SS1-VD1-00000075", "ANSWERED_TIME=2024-12-10 23:20:14") in new stack
-- Executing [s@custom-dial-handler:5] Set("SIP/SS1-VD1-00000075", "__ANSWERED_TIME=2024-12-10 23:20:14") in new stack
-- Executing [s@custom-dial-handler:6] Return("SIP/SS1-VD1-00000075", "") in new stack
== Spawn extension (from-sip, , 1) exited non-zero on 'SIP/SS1-VD1-00000075'
-- SIP/SS1-VD1-00000075 Internal Gosub(custom-dial-handler,s,1(s,1)) complete GOSUB_RETVAL=
-- Channel SIP/SS1-VD1-00000075 joined 'simple_bridge' basic-bridge <2184dc23-7c3d-4bd5-ae12-c62f894d045f>
-- Channel SIP/SS1-VD1-00000074 joined 'simple_bridge' basic-bridge <2184dc23-7c3d-4bd5-ae12-c62f894d045f>
> 0x7f85b8016cf0 -- Strict RTP learning complete - Locking on source address 172.22.11.12:16864
-- Channel SIP/SS1-VD1-00000075 left 'simple_bridge' basic-bridge <2184dc23-7c3d-4bd5-ae12-c62f894d045f>
-- Channel SIP/SS1-VD1-00000074 left 'simple_bridge' basic-bridge <2184dc23-7c3d-4bd5-ae12-c62f894d045f>
-- AGI Script Executing Application: (NoOp) Options: (Answered at:null)
-- AGI Script Executing Application: (NoOp) Options: (Answered at:null)
so my question is dial with U don’t pass the channel variables ? and how can i get the answer time?