Goto _X

Hi all
Does someone know how i can, based on the ${DIALSTATUS}, goto a specific route which has the X prefix ???

here is my extensions.conf

The user is dialing a number like 9710507486877, if the dialstatus is CHANUNAVAIL, i want asterisk to go to the default route, which is the one with the _X. ! This one is aloways up and running…

I hope i have been clear enought.

Thank You


My inital thought would be set the ${EXTEN} as another variable name and goto that. Not tested it but should work

So it would be Goto(from-iax2,${blah},1)

Sorry but i don’t get you…


replace putanextensionhere with any valid extension on the other system.

What extension You wish to call in default route?
I would do it using macro cmd

exten => s,1,Dial(SIP/${ARG1}@Host,,t)
exten => s,2,hangup
exten => _X.,1,Macro(abc,${EXTEN})
exten => _971.,1,Dial(SIP/AipACCt/${EXTEN},,t)
exten => _971.,2,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?103)
exten => _971.,3,hangup
exten => _971.,103,Macro(abc,${EXTEN_you_wish_to_dial_in_default_route})

You could use a dial plan label as well.

exten => _X,1(mylabel),Answer()

exten => 1,1,Goto(test1,mylabel,1)