Goto for patten matched extension


#1

hey all
in my dialplan I have a context for incoming calls from a SIP trunk(from telco) as mentioned below.
now I need to have a reference with Goto statement to label which is in an exten named (_x.)
how can it be done?

 exten => _x.,1,Answer()
                same => n(nowwhat),GotoIf($[${BLACKLIST()}]?blocked,1)
                same => n,GotoIfTime(06:30-23:59,sat,*,*?daygreeting)
                same => n,GotoIfTime(06:30-20:30,sun,*,*?daygreeting)
                same => n,GotoIfTime(06:30-23:59,mon,*,*?daygreeting)
                same => n,GotoIfTime(06:30-20:30,tue,*,*?daygreeting)
                same => n,GotoIfTime(06:30-23:59,wed,*,*?daygreeting)
                same => n,GotoIfTime(06:30-18:00,thu,*,*?daygreeting)
                same => n(aftershiftgreeting),Background(/var/lib/asterisk/sounds/pr-medical/my/aftershiftgreeting)
                same => n,Hangup()
                same => n(daygreeting),Background(/var/lib/asterisk/sounds/pr-medical/my/daygreeting)
                same => n,Goto(menuprompt)
                same => n(menuprompt),Background(/var/lib/asterisk/sounds/pr-medical/my/main-menu1)
                same => n,WaitExten(7)
                same => n,Goto(0,1)
        exten => 1,1,Verbose(1, Caller ${CALLERID(all)} has entered ****)
                same => n,Dial(${PAZIRESH1}&${PAZIRESH2}&${PAZIRESH3}&${PAZIRESH4})
        exten => 2,1,Verbose(1, Caller ${CALLERID(all)} has entered *****)
                same => n,Dial(${ERSALI1}&${ERSALI2}&${NICKA2})
        exten => 3,1,Verbose(1, Caller ${CALLERID(all)} has requested address and fax info)
                same => n,Background(/var/lib/asterisk/sounds/pr/announce-menu1)
                same => n,Goto(menuprompt)
        exten => 4,1,Verbose(1, Caller ${CALLERID(all)} has requested voicemail)
                same => n,VoiceMail(200@default,u)
        exten => #,1,Verbose(1, Caller ${CALLERID(all)} is entering the directory)
                same => n,Goto(incomming,menuprompt)
        exten => 0,1,Verbose(1, Caller ${CALLERID(all)} is calling the operator)
                same => n,Dial(${PAZIRESH1}&${PAZIRESH2}&${PAZIRESH3}&${PAZIRESH4})
        exten => i,1,Verbose(1, Caller ${CALLERID(all)} has entered an invalid selection)
                same => n,Playback(/var/lib/asterisk/sounds/pr-medical/my/invalid)
                same => n(menuprompt),Background(/var/lib/asterisk/sounds/pr-medical/my/main-menu1)
        exten => t,1,Verbose(1, Caller ${CALLERID(all)} has timed out)
                same => n,Goto(0,1)
        exten => _1XX,1,Verbose(1,Call to an extension starting with '1')
                same => n,Goto(LocalSets,${EXTEN},1)

#2

Use any extension that matches the pattern. I assume that your actual application means that only one value makes sense, and I wouldn’t be surprised if that was${EXTEN}.


#3

thank you ,
this is a Auto attendant application which make people to chose an option from prompted sound.
now every things works fine except any “Goto” statement that returns the code execution to the “menuprompt” (1st priority in exten => _x.) if the exten was any regular integer theGoto` would worked but reference to a pattern in this case not working .
how you would do that to make it working?


#4