[asterisk-users] asterisk and IVR
A J Stiles
asterisk_list at earthshod.co.uk
Wed Jul 31 10:23:30 CDT 2013
On Wednesday 31 July 2013, Salaheddine Elharit wrote:
> hi
>
> i use the code below but i didn't get the We reached step 102" the same
> result
>
> exten => 534,1,Dial(SIP/228, 10)
> exten => 534,n,NoOp(Dial status is ${DIALSTATUS})
> exten => 534,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?answered)
> exten => 534,n,Goto(home,s,1)
> exten => 534,n(answered),NoOp(Call was answered)
> exten => 534,102,NoOp(We reached step 102)
So it looks as though it's breaking out of the extension logic altogether, if
the call gets answered. In that case, you'll have to do it the old-fashioned
way: Create a "h" extension (which fires when a call is hung up) *in the
same context as your 534 extension* (you can have a h extension in each
context, if needs be), and do all your fancy end-of-call stuff there.
exten => 534,1,Dial(SIP/228, 10)
exten => 534,n,NoOp(Dial status is ${DIALSTATUS})
exten => 534,n,Goto(home,s,1)
exten => h,1,NoOp(Hangup received. Dial status is ${DIALSTATUS})
Note that if there are other extensions in the context, h will be called when
they get hung up -- you might need some logic in there to deal with this (or
cheat by just having one extension besides h in this context, and use a fully-
specified Goto() to jump into it.)
--
AJS
Answers come *after* questions.
More information about the asterisk-users
mailing list