Answer the question
In order to leave comments, you need to log in
Asterisk call result call file?
Hello. There is an asterisk configured to make calls from the call file.
the file itself:
Channel: Local/[email protected]_test
Context: out
Extension: 100
Set: dialout_number=79001234567
Archive: yes
[outbound_test]
exten => 123,1,System(echo "Dialout number ${dialout_number}" >> /tmp/123)
same => n,Dial(SIP/78633000000/${dialout_number},20)
same => h,n,System(echo "${DIALSTATUS}" >> /tmp/1234)
[out]
exten => 100,1,Noop(Answered)
exten => 100,2,Hangup()
exten => 100,3,Noop(echo "${DIALSTATUS}" >> /tmp/12345)
-- SIP/78633000000-00000009 answered Local/[email protected]_test-00000005;2
> Channel Local/[email protected]_test-00000005;1 was answered
-- Executing [[email protected]:1] NoOp("Local/[email protected]_test-00000005;1", "Answered") in new stack
-- Auto fallthrough, channel 'Local/[email protected]_test-00000005;1' status is 'UNKNOWN'
[Dec 16 21:11:49] NOTICE[27698]: pbx_spool.c:427 attempt_thread: Call completed to Local/[email protected]_test
== Spawn extension (outbound_test, 123, 2) exited non-zero on 'Local/[email protected]_test-00000005;2'
Answer the question
In order to leave comments, you need to log in
We need to add the g option, which allows Asterisk to continue executing the dialplan after the call ends.
same => n,Dial(SIP/78633000000/${dialout_number},20,g)
For g to work, you need to do this, but it still won't work if the extension hangs up first.
[outbound_test]
exten => 123,1,System(echo "Dialout number ${dialout_number}" >> /tmp/123)
same => n,Dial(SIP/78633000000/${dialout_number},20,g)
same => n,HangUp()
exten => h,1,System(echo "${DIALSTATUS}" >> /tmp/1234)
[hdlr-dialstatus]
exten => s,1,Verbose(0, -----Dial Status handler -----)
same => n,System(echo "${DIALSTATUS}" >> /tmp/1234 &)
[outbound_test]
exten => 123,1,System(echo "Dialout number ${dialout_number}" >> /tmp/123)
same => n,Set(CHANNEL(hangup_handler_push)=hdlr-dialstatus,s,1(${EXTEN}))
same => n,Dial(SIP/78633000000/${dialout_number},20)
same => n,HangUp
exten=> h,1,System(echo "${DIALSTATUS}" >> /tmp/1234)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question