MaKKrO
November 2, 2006, 8:47am
#1
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
[from-iax2]
include => default
exten => _X.,1, Set(CALLERID(num)=blabla)
exten => _X.,2, NoOP(Prefix : X)
exten => _X.,3, Dial(SIP/${EXTEN}@Host ,t)
exten => _X.,4, Hangup()
exten => _971.,1, Set(CALLERID(num)=blabla)
exten => _971.,2, NoOP(Prefix : 971)
exten => _971.,3, Dial(SIP/SipAcct/${EXTEN},t)
exten => _971.,4, Hangup()
[default]
exten => h,1,NoOP(Dial Status : ${DIALSTATUS})
exten => h,2,GotoIf($["${DIALSTATUS}" = “CHANUNAVAIL”]?103)
exten => h,103,Goto( << Here is what i Need >>)
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
Hi
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)
MaKKrO
November 2, 2006, 11:01am
#3
Sorry but i don’t get you…
Goto(from-iax2,putanextensionhere,1)
replace putanextensionhere with any valid extension on the other system.
MaKKrO:
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…
What extension You wish to call in default route?
I would do it using macro cmd
[macro-abc]
exten => s,1,Dial(SIP/${ARG1}@Host,,t)
exten => s,2,hangup
[from-iax2]
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})
dmikusa
November 4, 2006, 4:10pm
#6
You could use a dial plan label as well.
[test1]
exten => _X,1(mylabel),Answer()
[test2]
exten => 1,1,Goto(test1,mylabel,1)
Dan