Dear Asterisk Guru’s,
Introduction:
I’m new to Asterisk and I need some help with finalizing my dial-plan.
Goal:
The goal is to call the technical staff in case of an alarm.
If the first person doesn’t provide a pin-code or hangup the call during the script, or never pickup the call. It should go to the next person in line.
They call should stop hunting when an engineer respond with entering some pincode.
The question:
All works fine, but and I need to know how to dial the next engineer when the first one doesn’t react (no-answer) or (hanged-up) without responding with some digits
So now it only goes to the next engineer when they pickup, listen through the whole script and do nothing. Thats good.
-
But I don’t know how to go to the next nextfile when the first person pickup and hanged-up the call during the execution of the dialplan.
-
How to go to the nextfile when the first person is BUSY or doesn’t answer (NO ANSWER) their phone. The problem with the second question is that I cannot build it in the context, because the context only gets pickup when the call is answered.
I hope you guys can shed some light on this problem
This is my config:
.call file where i start the call with
Channel: SIP/mysipprovider-out/xxxnumberfirstengineerxxx
MaxRetries:3
RetryTime:2
WaitTime:40
Context: outboundmsg1
extension:s
Priority: 1
[outboundmsg1]
exten => s,1,Set(nextfile=tmp02)
exten => s,2,Set(TIMEOUT(digit)=4)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Set(stepcount=0)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Background(/home/administrator/sounds/alarm)
exten => s,n(prompt),Background(/home/administrator/sounds/pincode)
exten => s,n,Set(stepcount=$[${stepcount}+1])
exten => s,n,GotoIf($[${stepcount} > 2]?callnext)
exten => s,n,WaitExten(2)
exten => s,n,Goto(s,prompt)
exten => s,n(callnext),System(cp /var/spool/asterisk/${nextfile} /var/spool/asterisk/out$
exten => s,n,Hangup
exten => 1,1,Goto(s,begin)
exten => 2,1,Goto(msgack,s,1)
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup
tmp02 .call file
Channel: SIP/mysipprovider-out/xxxnumbersecondengineerxxx
MaxRetries:3
RetryTime:2
WaitTime:40
Context: outboundmsg1
extension:s
Priority: 1