When i use the “GotoIf($[”${DIALSTATUS}" = “ANSWER”]?7" statement in the extensions.conf file as my dialplan the next executable statement is not called and i get the following error:
[color=red]Auto fallthrough, channel ‘Local/outbound@dialout-5da3,2’ status is ‘UNKNOWN’[/color]
How can i have a statement if the the “if” condition fails, something like GotoElse.
Any ideas on why do i get this error and how can i use my dialplan properly.
Your syntax is wrong.
The if has both a true and a false condition. Here is a snip from my dialplan:
exten => 444,n(repeat),Background(‘enter_an_extension’)
exten => 444,n,WaitExten(5)
exten => 444,n,Set(Count=$[${Count} + 1])
exten => 444,n,GotoIf($[ ${count} = 3 ]?hang:repeat)
exten => 444,n(hang),Playback(‘goodbye’)
exten => 444,n,Hangup( )
The if statement has both true and false conditions.
If the condition is met (ie true, ie count=3) it goes to the label hang.
If the condition is not met, (ie false, ie the count is !=3) it goes to the label repeat.
Thanks Matthew, the GotoIf statement works out. But now i have got a different problem, the condition always meets the else criteria and hangs up. Once we make a call using Dial(SIP/EXTEN), how can we determine the status of the call. I choose a condition “${DIALSTATUS}” = “ANSWER”". my extensions.conf file context is as given below:
Thanks Matthew, the GotoIf statement works out. But now i have got a different problem, the condition always meets the else criteria and hangs up. Once we make a call using Dial(SIP/EXTEN), how can we determine the status of the call. I choose a condition “${DIALSTATUS}” = “ANSWER”". my extensions.conf file context is as given below:
Thanks Matthew, the GotoIf statement works out. But now i have got a different problem, the condition always meets the else criteria and hangs up. Once we make a call using Dial(SIP/EXTEN), how can we determine the status of the call. I choose a condition “${DIALSTATUS}” = “ANSWER”". my extensions.conf file context is as given below:
exten => outbound,1,Answer