muj vyklad je od ***VYKLAD*** na konci file ; extensions.conf - the Asterisk dial plan ; ; Static extension configuration file, used by ; the pbx_config module. This is where you configure all your ; inbound and outbound calls in Asterisk. ; ; This configuration file is reloaded ; - With the "dialplan reload" command in the CLI ; - With the "reload" command (that reloads everything) in the CLI ; ; The "General" category is for certain variables. ; [general] ; ; If static is set to no, or omitted, then the pbx_config will rewrite ; this file when extensions are modified. Remember that all comments ; made in the file will be lost when that happens. ; ; XXX Not yet implemented XXX ; static=yes ; ; if static=yes and writeprotect=no, you can save dialplan by ; CLI command "dialplan save" too ; writeprotect=no ; ; If autofallthrough is set, then if an extension runs out of ; things to do, it will terminate the call with BUSY, CONGESTION ; or HANGUP depending on Asterisk's best guess. This is the default. ; ; If autofallthrough is not set, then if an extension runs out of ; things to do, Asterisk will wait for a new extension to be dialed ; (this is the original behavior of Asterisk 1.0 and earlier). ; ;autofallthrough=no ; ; ; ; If extenpatternmatchnew is set (true, yes, etc), then a new algorithm that uses ; a Trie to find the best matching pattern is used. In dialplans ; with more than about 20-40 extensions in a single context, this ; new algorithm can provide a noticeable speedup. ; With 50 extensions, the speedup is 1.32x ; with 88 extensions, the speedup is 2.23x ; with 138 extensions, the speedup is 3.44x ; with 238 extensions, the speedup is 5.8x ; with 438 extensions, the speedup is 10.4x ; With 1000 extensions, the speedup is ~25x ; with 10,000 extensions, the speedup is 374x ; Basically, the new algorithm provides a flat response ; time, no matter the number of extensions. ; ; By default, the old pattern matcher is used. ; ; ****This is a new feature! ********************* ; The new pattern matcher is for the brave, the bold, and ; the desperate. If you have large dialplans (more than about 50 extensions ; in a context), and/or high call volume, you might consider setting ; this value to "yes" !! ; Please, if you try this out, and are forced to return to the ; old pattern matcher, please report your reasons in a bug report ; on https://issues.asterisk.org. We have made good progress in providing ; something compatible with the old matcher; help us finish the job! ; ; This value can be switched at runtime using the cli command "dialplan set extenpatternmatchnew true" ; or "dialplan set extenpatternmatchnew false", so you can experiment to your hearts content. ; extenpatternmatchnew=yes ; ; If clearglobalvars is set, global variables will be cleared ; and reparsed on a dialplan reload, or Asterisk reload. ; ; If clearglobalvars is not set, then global variables will persist ; through reloads, and even if deleted from the extensions.conf or ; one of its included files, will remain set to the previous value. ; ; NOTE: A complication sets in, if you put your global variables into ; the AEL file, instead of the extensions.conf file. With clearglobalvars ; set, a "reload" will often leave the globals vars cleared, because it ; is not unusual to have extensions.conf (which will have no globals) ; load after the extensions.ael file (where the global vars are stored). ; So, with "reload" in this particular situation, first the AEL file will ; clear and then set all the global vars, then, later, when the extensions.conf ; file is loaded, the global vars are all cleared, and then not set, because ; they are not stored in the extensions.conf file. ; clearglobalvars=no ; ; User context is where entries from users.conf are registered. The ; default value is 'default' ; ;userscontext=default ; ; You can include other config files, use the #include command ; (without the ';'). Note that this is different from the "include" command ; that includes contexts within other contexts. The #include command works ; in all asterisk configuration files. ;#include "filename.conf" ;#include ;#include filename.conf ; ; You can execute a program or script that produces config files, and they ; will be inserted where you insert the #exec command. The #exec command ; works on all asterisk configuration files. However, you will need to ; activate them within asterisk.conf with the "execincludes" option. They ; are otherwise considered a security risk. ;#exec /opt/bin/build-extra-contexts.sh ;#exec /opt/bin/build-extra-contexts.sh --foo="bar" ;#exec ;#exec "/opt/bin/build-extra-contexts.sh --foo=\"bar\"" ; ; The "Globals" category contains global variables that can be referenced ; in the dialplan with the GLOBAL dialplan function: ; ${GLOBAL(VARIABLE)} ; ${${GLOBAL(VARIABLE)}} or ${text${GLOBAL(VARIABLE)}} or any hybrid ; Unix/Linux environmental variables can be reached with the ENV dialplan ; function: ${ENV(VARIABLE)} ; [globals] ;CONSOLE=Console/dsp ; Console interface for demo ;CONSOLE=DAHDI/1 ;CONSOLE=Phone/phone0 ;IAXINFO=guest ; IAXtel username/password ;IAXINFO=myuser:mypass ;TRUNK=DAHDI/G2 ; Trunk interface ; ; Note the 'G2' in the TRUNK variable above. It specifies which group (defined ; in chan_dahdi.conf) to dial, i.e. group 2, and how to choose a channel to use ; in the specified group. The four possible options are: ; ; g: select the lowest-numbered non-busy DAHDI channel ; (aka. ascending sequential hunt group). ; G: select the highest-numbered non-busy DAHDI channel ; (aka. descending sequential hunt group). ; r: use a round-robin search, starting at the next highest channel than last ; time (aka. ascending rotary hunt group). ; R: use a round-robin search, starting at the next lowest channel than last ; time (aka. descending rotary hunt group). ; ;TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0) ;TRUNK=IAX2/user:pass@provider ;FREENUMDOMAIN=mydomain.com ; domain to send on outbound ; freenum calls (uses outbound-freenum ; context) ; ; WARNING WARNING WARNING WARNING ; If you load any other extension configuration engine, such as pbx_ael.so, ; your global variables may be overridden by that file. Please take care to ; use only one location to set global variables, and you will likely save ; yourself a ton of grief. ; WARNING WARNING WARNING WARNING ; ; Any category other than "General" and "Globals" represent ; extension contexts, which are collections of extensions. ; ; Extension names may be numbers, letters, or combinations ; thereof. If an extension name is prefixed by a '_' ; character, it is interpreted as a pattern rather than a ; literal. In patterns, some characters have special meanings: ; ; X - any digit from 0-9 ; Z - any digit from 1-9 ; N - any digit from 2-9 ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9) ; . - wildcard, matches anything remaining (e.g. _9011. matches ; anything starting with 9011 excluding 9011 itself) ; ! - wildcard, causes the matching process to complete as soon as ; it can unambiguously determine that no other matches are possible ; ; For example, the extension _NXXXXXX would match normal 7 digit dialings, ; while _1NXXNXXXXXX would represent an area code plus phone number ; preceded by a one. ; ; Each step of an extension is ordered by priority, which must always start ; with 1 to be considered a valid extension. The priority "next" or "n" means ; the previous priority plus one, regardless of whether the previous priority ; was associated with the current extension or not. The priority "same" or "s" ; means the same as the previously specified priority, again regardless of ; whether the previous entry was for the same extension. Priorities may be ; immediately followed by a plus sign and another integer to add that amount ; (most useful with 's' or 'n'). Priorities may then also have an alias, or ; label, in parentheses after their name which can be used in goto situations. ; ; Contexts contain several lines, one for each step of each extension. One may ; include another context in the current one as well, optionally with a date ; and time. Included contexts are included in the order they are listed. ; Switches may also be included within a context. The order of matching within ; a context is always exact extensions, pattern match extensions, includes, and ; switches. Includes are always processed depth-first. So for example, if you ; would like a switch "A" to match before context "B", simply put switch "A" in ; an included context "C", where "C" is included in your original context ; before "B". ; [macro-trunkdial] ; ; Standard trunk dial macro (hangs up on a dialstatus that should ; terminate call) ; ${ARG1} - What to dial ; exten => s,1,Dial(${ARG1}) exten => s,n,Goto(s-${DIALSTATUS},1) exten => s-NOANSWER,1,Hangup() exten => s-BUSY,1,Hangup() exten => _s-.,1,NoOp [stdexten] ; ; Standard extension subroutine: ; ${EXTEN} - Extension ; ${ARG1} - Device(s) to ring ; ${ARG2} - Optional context in Voicemail ; ; Note that the current version will drop through to the next priority in the ; case of their pressing '#'. This gives more flexibility in what do to next: ; you can prompt for a new extension, or drop the call, or send them to a ; general delivery mailbox, or... ; ; The use of the LOCAL() function is purely for convenience. Any variable ; initially declared as LOCAL() will disappear when the innermost Gosub context ; in which it was declared returns. Note also that you can declare a LOCAL() ; variable on top of an existing variable, and its value will revert to its ; previous value (before being declared as LOCAL()) upon Return. ; exten => _X.,50000(stdexten),NoOp(Start stdexten) exten => _X.,n,Set(LOCAL(ext)=${EXTEN}) exten => _X.,n,Set(LOCAL(dev)=${ARG1}) exten => _X.,n,Set(LOCAL(cntx)=${ARG2}) exten => _X.,n,Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})}) exten => _X.,n,Dial(${dev},20) ; Ring the interface, 20 seconds maximum exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => stdexten-NOANSWER,1,VoiceMail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start exten => stdexten-BUSY,1,VoiceMail(${mbx},b) ; If busy, send to voicemail w/ busy announce exten => stdexten-BUSY,n,Return() ; If they press #, return to start exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer exten => a,1,VoiceMailMain(${mbx}) ; If they press *, send the user into VoicemailMain exten => a,n,Return() [stdPrivacyexten] ; ; Standard extension subroutine: ; ${ARG1} - Extension ; ${ARG2} - Device(s) to ring ; ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority) ; ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)` ; ${ARG5} - Context in voicemail (if empty, then "default") ; ; See above note in stdexten about priority handling on exit. ; exten => _X.,60000(stdPrivacyexten),NoOp(Start stdPrivacyexten) exten => _X.,n,Set(LOCAL(ext)=${ARG1}) exten => _X.,n,Set(LOCAL(dev)=${ARG2}) exten => _X.,n,Set(LOCAL(dontcntx)=${ARG3}) exten => _X.,n,Set(LOCAL(tortcntx)=${ARG4}) exten => _X.,n,Set(LOCAL(cntx)=${ARG5}) exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""]) exten => _X.,n,Dial(${dev},20,p) ; Ring the interface, 20 seconds maximum, call screening ; option (or use P for databased call _X.creening) exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => stdexten-NOANSWER,1,VoiceMail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce exten => stdexten-NOANSWER,n,NoOp(Finish stdPrivacyexten NOANSWER) exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start exten => stdexten-BUSY,1,VoiceMail(${mbx},b) ; If busy, send to voicemail w/ busy announce exten => stdexten-BUSY,n,NoOp(Finish stdPrivacyexten BUSY) exten => stdexten-BUSY,n,Return() ; If they press #, return to start exten => stdexten-DONTCALL,1,Goto(${dontcntx},s,1) ; Callee chose to send this call to a polite "Don't call again" script. exten => stdexten-TORTURE,1,Goto(${tortcntx},s,1) ; Callee chose to send this call to a telemarketer torture script. exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer exten => a,1,VoiceMailMain(${mbx}) ; If they press *, send the user into VoicemailMain exten => a,n,Return() [macro-page] ; ; Paging macro: ; ; Check to see if SIP device is in use and DO NOT PAGE if they are ; ; ${ARG1} - Device to page exten => s,1,ChanIsAvail(${ARG1},s) ; s is for ANY call exten => s,n,GotoIf($[${AVAILSTATUS} = "1"]?autoanswer:fail) exten => s,n(autoanswer),Set(_ALERT_INFO="RA") ; This is for the PolyComs exten => s,n,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others exten => s,n,NoOp() ; Add others here and Post on the Wiki!!!! exten => s,n,Dial(${ARG1}) exten => s,n(fail),Hangup() [time] exten => _X.,30000(time),NoOp(Time: ${EXTEN} ${timezone}) exten => _X.,n,Wait(0.25) exten => _X.,n,Answer() ; the amount of delay is set for English; you may need to adjust this time ; for other languages if there's no pause before the synchronizing beep. exten => _X.,n,Set(FUTURETIME=$[${EPOCH} + 12]) exten => _X.,n,SayUnixTime(${FUTURETIME},Zulu,HNS) exten => _X.,n,SayPhonetic(z) ; use the timezone associated with the extension (sip only), or system-wide ; default if one hasn't been set. exten => _X.,n,SayUnixTime(${FUTURETIME},${timezone},HNS) exten => _X.,n,Playback(spy-local) exten => _X.,n,WaitUntil(${FUTURETIME}) exten => _X.,n,Playback(beep) exten => _X.,n,Return() ; ; ANI context: use in the same way as "time" above ; [ani] exten => _X.,40000(ani),NoOp(ANI: ${EXTEN}) exten => _X.,n,Wait(0.25) exten => _X.,n,Answer() exten => _X.,n,Playback(vm-from) exten => _X.,n,SayDigits(${CALLERID(ani)}) exten => _X.,n,Wait(1.25) exten => _X.,n,SayDigits(${CALLERID(ani)}) ; playback again in case of missed digit exten => _X.,n,Return() ; For more information on applications, just type "core show applications" at your ; friendly Asterisk CLI prompt. ; ; "core show application " will show details of how you ; use that particular application in this file, the dial plan. ; "core show functions" will list all dialplan functions ; "core show function " will show you more information about ; one function. Remember that function names are UPPER CASE. [kobylisy] exten => 2102,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pomoci naseho Ateriska 2102 ) exten => 2102,n,Dial(SIP/${EXTEN}/${EXTEN},20) exten => 2102,n,Hangup() exten => 2103,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pomoci naseho Ateriska 2103 ) exten => 2103,n,Dial(SIP/${EXTEN}/${EXTEN},20) exten => 2103,n,Hangup() exten => 2104,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pomoci naseho Ateriska 2104 ) exten => 2104,n,Dial(SIP/${EXTEN}/${EXTEN},20) exten => 2104,n,Hangup() exten => 2906,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pomoci naseho Ateriska 2906 ) exten => 2906,n,Dial(SIP/${EXTEN}/${EXTEN},20) exten => 2906,n,Hangup() exten => _00811XX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} do Plzne pomoci VoIP ) exten => _00811XX,n,Dial(SIP/2903/${EXTEN:5},60) exten => _00811XX,n,Hangup() exten => _00812XXX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} do Panske pomoci VoIP 2904 ) exten => _00812XXX,n,Dial(SIP/2904/${EXTEN:5},60) exten => _00812XXX,n,Hangup() exten => _00813XXX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} do Panske pomoci VoIP 2905 ) exten => _00813XXX,n,Dial(SIP/2905/${EXTEN:5},60) exten => _00813XXX,n,Hangup() ; tady dale jsou pokusy ; g4 do Dialtelec exten => _0X.,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN:1} pres g4 do Dialtelecomu ) exten => _0X.,n,Dial(DAHDI/g4/${EXTEN:1},60 ) exten => _0X.,n,Hangup() exten => _511,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres SIP na 2103 ) exten => _511,n,Dial(SIP/2103/2103,60 ) exten => _511,n,Hangup() exten => _510,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g4 do Dialtelecomu na muj mobil ) exten => _510,n,Dial(DAHDI/g4/732876740,60 ) exten => _510,n,Hangup() exten => _121,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g4 do Dialtelecomu na mobil Cveklova ) exten => _121,n,Dial(DAHDI/g4/733164096,60 ) exten => _121,n,Hangup() exten => _213,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g4 do Dialtelecomu na mobil Kopecky ) exten => _213,n,Dial(DAHDI/g4/604617640,60 ) exten => _213,n,Hangup() exten => _120,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} Oklestkova pres g4 do Dialtelecomu na mobil Sivek ) exten => _120,n,Dial(DAHDI/g4/737587035,60 ) exten => _120,n,Hangup() exten => _228,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g4 do Dialtelecomu na mobil Sivek ) exten => _228,n,Dial(DAHDI/g4/737587035,60 ) exten => _228,n,Hangup() exten => _119,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g4 do Dialtelecomu na mobil Petruj ) exten => _119,n,Dial(DAHDI/g4/737382524,60 ) exten => _119,n,Hangup() exten => _110,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g4 do Dialtelecomu na mobil Svoboda ) exten => _110,n,Dial(DAHDI/g4/731604071, 60 ) exten => _110,n,Hangup() exten => _114,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g4 do Dialtelecomu na mobil Vaculik ) exten => _114,n,Dial(DAHDI/g4/731 402 046, 60 ) exten => _114,n,Hangup() exten => _1XX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g2 do Merlina ) exten => _1XX,n,Dial(DAHDI/g2/${EXTEN},60 ) exten => _1XX,n,Hangup() exten => _2XX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g2 do Merlina ) exten => _2XX,n,Dial(DAHDI/g2/${EXTEN},60 ) exten => _2XX,n,Hangup() exten => _3XX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g2 do Merlina ) exten => _3XX,n,Dial(DAHDI/g2/${EXTEN},60 ) exten => _3XX,n,Hangup() exten => _4XX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g2 do Merlina ) exten => _4XX,n,Dial(DAHDI/g2/${EXTEN},60 ) exten => _4XX,n,Hangup() exten => _5XX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres g2 do Merlina ) exten => _5XX,n,Dial(DAHDI/g2/${EXTEN},60 ) exten => _5XX,n,Hangup() ;exten => _898X.,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN:3} pres g2 smycka zatim zpatky do Asteriska ) ;exten => _898X.,n,Dial(DAHDI/g2/${EXTEN:3},60 ) ;exten => _898X.,n,Hangup() ;exten => _899X.,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN:3} pres DAHDI ISDN PRI 3 do NetStar ) ;exten => _899X.,n,Dial(DAHDI/g5/${EXTEN:3},60 ) ;exten => _899X.,n,Hangup() ;exten => 3001,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pomoci naseho Ateriska ) ;exten => 3001,2,GoTo time ***VYKLAD*** ------------------------------------------------------- ; udelame si to cele odtud ; vysvetlit context ; najit context u users.conf [kobylisy] exten => _511,1,Dial(SIP/2103) exten => _511,2,Hangup() tohle reaguje na cislo 511 zavola to pomoci SIP na cislo 2103 exten => _512,1,Dial(SIP/2103,60) exten => _512,2,Hangup() tohle reaguje na cislo 512 opet vola na 2103 exten => _513,1,Log(NOTICE, Poznamka do logu ) exten => _513,2,Dial(SIP/2103,60 ) exten => _513,3,Hangup() napise poznamku do LOGu - vechno, co je v zavorce za Log ,60 u Dial udava, kolik sekund to ma zvonit ; poradi je podle PRIORITY - to jsou cislocka 1 2 3 za prvni , ; a prestane nas bavit psat tam 12345 , tak se za carku napise ,n exten => _514,1,Log(NOTICE, Poznamka do logu ) exten => _514,n,Dial(SIP/2103,60 ) exten => _514,n,Hangup() ; a pouzivame wildcard ; ; X - any digit from 0-9 ; Z - any digit from 1-9 ; N - any digit from 2-9 [15-7]. 5.8 6XX8 ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9) ; . - wildcard, matches anything remaining (e.g. _9011. matches ; anything starting with 9011 excluding 9011 itself) ; tecka je jeden nebo vice znaku, ale vzdy alespon jeden znak exten => _5XX,1,Log(NOTICE, Poznamka do logu ) exten => _5XX,n,Dial(SIP/2103,60 ) exten => _5XX,n,Hangup() Kdyz jsme vytocili 5 a dve nejake cifry, volame na cislo 2103 cekame 60 sekund na prihlaseni potom konec exten => _6XX,1,Log(NOTICE, Volame na cislo ${EXTEN} ) exten => _6XX,n,Dial(SIP/2103,60 ) exten => _6XX,n,Hangup() tady jeste navic zapiseme do LOGu cislo, ktere jsme vytocili - EXTEN Dial(SIP/1234/${EXTEN:2} ) volame pomoci pobocky 1234 na cislo, ktere jsme vytocili. A u toho cisla jme zepredu odstranili dve cislice exten => _7XX,1,Log(NOTICE, Volame na cislo ${EXTEN} ) exten => _7XX,n,Dial(SIP/${EXTEN},60 ) exten => _7XX,n,Hangup() Volame na cislo, ktere zacina 7 a ma celkem 3 cifry ; : urezava cislice exten => _7XX,1,Log(NOTICE, Volame na cislo ${EXTEN} ) exten => _7XX,n,Dial(SIP/${EXTEN:2},60 ) exten => _7XX,n,Hangup() volame na cislo X , zepredu jsme urizli dve cifry ; : urezava cislice exten => _7XX,1,Log(NOTICE, Volame na cislo ${EXTEN} ) exten => _7XX,n,Log(NOTICE, Volame na cislo ${EXTEN:1} ) exten => _7XX,n,Log(NOTICE, Volame na cislo ${EXTEN:2} ) exten => _7XX,n,Log(NOTICE, Volame na cislo ${EXTEN} ) exten => _7XX,n,Dial(SIP/5678${EXTEN:2},60 ) exten => _7XX,n,Hangup() tady volame na cislo, ktere zacina 7 a ma tri cifry retezec, na ktery volame, je 5678${EXTEN:2} to znamena, ze pred nase cislo jsme pridali 5678 z EXTEN jsme urizli zepredu dve cifry exten => _511,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pres SIP na 2103 ) exten => _511,n,Dial(SIP/2103/456,60 ) exten => _511,n,Hangup() Tady volame pomoci pobocky 2103 na pobocku 456 i kdyz jsme vytocili 511 exten => 2102,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} pomoci naseho Ateriska 2102 ) exten => 2102,n,Dial(SIP/${EXTEN}/${EXTEN},20) exten => 2102,n,Hangup() tohle je dost nesmzsl, volame pomoci pobockz 2102 na pobocku 2102 EXTEN je 2102 , na jina cisla tohle nereaguje exten => 1234 , 1 , co se ma udelat exten => 1234 , n , co se ma udelat exten => 1234 , n , co se ma udelat exten => 1234 , n , co se ma udelat exten => _24[3-6],1,Dial(SIP/ 444${EXTEN} ) exten => _24[3-6],n,Log(NOTICE, Neco napsat cislo je 12${EXTEN}34 ) exten => _24[3-6],n,Hangup() exten => 2102,1,Dial(SIP/5555/12${EXTEN}34,150) exten => 2102,n,Log(NOTICE, Neco napsat cislo je 12${EXTEN}34 ) exten => 2102,n,Hangup() ; ; X - any digit from 0-9 ; Z - any digit from 1-9 ; N - any digit from 2-9 ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9) ; . - wildcard, matches anything remaining (e.g. _9011. matches ; anything starting with 9011 excluding 9011 itself) ; ! - wildcard, causes the matching process to complete as soon as ; it can unambiguously determine that no other matches are possible ; ; For example, the extension _NXXXXXX would match normal 7 digit dialings, ; while _1NXXNXXXXXX would represent an area code plus phone number ; preceded by a one. ; ; Each step of an extension is ordered by priority, which must always start ; with 1 to be considered a valid extension. The priority "next" or "n" means ; the previous priority plus one, regardless of whether the previous priority ; was associated with the current extension or not. The priority "same" or "s" ; means the same as the previously specified priority, again regardless of ; whether the previous entry was for the same extension. Priorities may be ; immediately followed by a plus sign and another integer to add that amount ; (most useful with 's' or 'n'). Priorities may then also have an alias, or ; label, in parentheses after their name which can be used in goto situations. ; ; Contexts contain several lines, one for each step of each extension. One may ; include another context in the current one as well, optionally with a date ; and time. Included contexts are included in the order they are listed. ; Switches may also be included within a context. The order of matching within ; a context is always exact extensions, pattern match extensions, includes, and ; switches. Includes are always processed depth-first. So for example, if you ; would like a switch "A" to match before context "B", simply put switch "A" in ; an included context "C", where "C" is included in your original context ; before "B". ; s je standardni extension ale moc netusim, k cemu to je exten => s,1,ChanIsAvail(${ARG1},s) ; s is for ANY call exten => s,n,GotoIf($[${AVAILSTATUS} = "1"]?autoanswer:fail)