2 ; Static extension configuration file, used by
3 ; the pbx_config module. This is where you configure all your
4 ; inbound and outbound calls in Asterisk.
8 ; The "General" category is for certain variables.
12 ; If static is set to no, or omitted, then the pbx_config will rewrite
13 ; this file when extensions are modified. Remember that all comments
14 ; made in the file will be lost when that happens.
16 ; XXX Not yet implemented XXX
20 ; if static=yes and writeprotect=no, you can save dialplan by
21 ; CLI command 'save dialplan' too
25 ; You can include other config files, use the #include command (without the ';')
26 ; Note that this is different from the "include" command that includes contexts within
27 ; other contexts. The #include command works in all asterisk configuration files.
28 ;#include "filename.conf"
30 ; The "Globals" category contains global variables that can be referenced
31 ; in the dialplan with ${VARIABLE} or ${ENV(VARIABLE)} for Environmental variable
32 ; ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
35 CONSOLE=Console/dsp ; Console interface for demo
38 IAXINFO=guest ; IAXtel username/password
39 ;IAXINFO=myuser:mypass
40 TRUNK=Zap/g2 ; Trunk interface
41 TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
42 ;TRUNK=IAX2/user:pass@provider
45 ; Any category other than "General" and "Globals" represent
46 ; extension contexts, which are collections of extensions.
48 ; Extension names may be numbers, letters, or combinations
49 ; thereof. If an extension name is prefixed by a '_'
50 ; character, it is interpreted as a pattern rather than a
51 ; literal. In patterns, some characters have special meanings:
53 ; X - any digit from 0-9
54 ; Z - any digit from 1-9
55 ; N - any digit from 2-9
56 ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
57 ; . - wildcard, matches anything remaining (e.g. _9011. matches
58 ; anything starting with 9011 excluding 9011 itself)
60 ; For example the extension _NXXXXXX would match normal 7 digit dialings,
61 ; while _1NXXNXXXXXX would represent an area code plus phone number
64 ; Each step of an extension is ordered by priority, which must
65 ; always start with 1 to be considered a valid extension.
67 ; Contexts contain several lines, one for each step of each
68 ; extension, which can take one of two forms as listed below,
69 ; with the first form being preferred. One may include another
70 ; context in the current one as well, optionally with a
71 ; date and time. Included contexts are included in the order
75 ;exten => someexten,priority,application(arg1,arg2,...)
76 ;exten => someexten,priority,application,arg1|arg2...
78 ; Timing list for includes is
80 ; <time range>|<days of week>|<days of month>|<months>
82 ;include => daytime|9:00-17:00|mon-fri|*|*
84 ; ignorepat can be used to instruct drivers to not cancel dialtone upon
85 ; receipt of a particular pattern. The most commonly used example is
86 ; of course '9' like this:
90 ; so that dialtone remains even after dialing a 9.
94 ; Here are the entries you need to participate in the IAXTEL
95 ; call routing system. Most IAXTEL numbers begin with 1-700, but
96 ; there are exceptions. For more information, and to sign
97 ; up, please go to www.gnophone.com or www.iaxtel.com
100 exten => _91700XXXXXXX,1,Dial(IAX2/${IAXINFO}@iaxtel.com/${EXTEN:1}@iaxtel)
103 ; The SWITCH statement permits a server to share the dialplain with
104 ; another server. Use with care: Reciprocal switch statements are not
105 ; allowed (e.g. both A -> B and B -> A), and the switched server needs
106 ; to be on-line or else dialing can be severly delayed.
109 ;switch => IAX2/user:[key]@myserver/mycontext
113 ; International long distance through trunk
115 exten => _9011.,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
116 exten => _9011.,2,Congestion
120 ; Long distance context accessed through trunk
122 exten => _91NXXNXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
123 exten => _91NXXNXXXXXX,2,Congestion
127 ; Local seven-digit dialing accessed through trunk interface
129 exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
130 exten => _9NXXXXXX,2,Congestion
134 ; Long distance context accessed through trunk interface
136 exten => _91800NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
137 exten => _91800NXXXXXX,2,Congestion
138 exten => _91888NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
139 exten => _91888NXXXXXX,2,Congestion
140 exten => _91877NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
141 exten => _91877NXXXXXX,2,Congestion
142 exten => _91866NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
143 exten => _91866NXXXXXX,2,Congestion
147 ; Master context for international long distance
150 include => longdistance
155 ; Master context for long distance
163 ; Master context for local, toll-free, and iaxtel calls only
167 include => parkedcalls
168 include => trunklocal
170 include => trunktollfree
171 include => iaxprovider
173 ; You can use an alternative switch type as well, to resolve
174 ; extensions that are not known here, for example with remote
175 ; IAX switching you transparently get access to the remote
178 ; switch => IAX2/user:password@bigserver/local
182 ; Standard extension macro:
183 ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
184 ; ${ARG2} - Device(s) to ring
186 exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
187 exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
189 exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
190 exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
192 exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
193 exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
195 exten => s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
197 exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain
201 ; We start with what to do when a call first comes in.
203 exten => s,1,Wait,1 ; Wait a second, just for fun
204 exten => s,2,Answer ; Answer the line
205 exten => s,3,DigitTimeout,5 ; Set Digit Timeout to 5 seconds
206 exten => s,4,ResponseTimeout,10 ; Set Response Timeout to 10 seconds
207 exten => s,5,BackGround(demo-congrats) ; Play a congratulatory message
208 exten => s,6,BackGround(demo-instruct) ; Play some instructions
210 exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
211 exten => 2,2,Goto(s,6)
213 exten => 3,1,SetLanguage(fr) ; Set language to french
214 exten => 3,2,Goto(s,5) ; Start with the congratulations
216 exten => 1000,1,Goto(default,s,1)
218 ; We also create an example user, 1234, who is on the console and has
221 exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
222 ; (but skip if channel is not up)
223 exten => 1234,2,Macro(stdexten,1234,${CONSOLE})
225 exten => 1235,1,Voicemail(u1234) ; Right to voicemail
227 exten => 1236,1,Dial(Console/dsp) ; Ring forever
228 exten => 1236,2,Voicemail(u1234) ; Unless busy
231 ; # for when they're done with the demo
233 exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
234 exten => #,2,Hangup ; Hang them up.
237 ; A timeout and "invalid extension rule"
239 exten => t,1,Goto(#,1) ; If they take too long, give up
240 exten => i,1,Playback(invalid) ; "That's not valid, try again"
243 ; Create an extension, 500, for dialing the
246 exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
247 exten => 500,2,Dial(IAX2/guest@misery.digium.com/s@default) ; Call the Asterisk demo
248 exten => 500,3,Playback(demo-nogo) ; Couldn't connect to the demo site
249 exten => 500,4,Goto(s,6) ; Return to the start over message.
252 ; Create an extension, 600, for evaulating echo latency.
254 exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
255 exten => 600,2,Echo ; Do the echo test
256 exten => 600,3,Playback(demo-echodone) ; Let them know it's over
257 exten => 600,4,Goto(s,6) ; Start over
260 ; Give voicemail at extension 8500
262 exten => 8500,1,VoicemailMain
263 exten => 8500,2,Goto(s,6)
265 ; Here's what a phone entry would look like (IXJ for example)
267 ;exten => 1265,1,Dial(Phone/phone0,15)
268 ;exten => 1265,2,Goto(s,5)
272 ; Example "main menu" context with submenu
275 ;exten => s,2,Background(thanks) ; "Thanks for calling press 1 for sales, 2 for support, ..."
276 ;exten => 1,1,Goto(submenu,s,1)
281 ;exten => s,1,Ringing ; Make them comfortable with 2 seconds of ringback
283 ;exten => s,3,Background(submenuopts) ; "Thanks for calling the sales department. Press 1 for steve, 2 for..."
284 ;exten => 1,1,Goto(default,steve,1)
285 ;exten => 2,1,Goto(default,mark,2)
289 ; By default we include the demo. In a production system, you
290 ; probably don't want to have the demo there.
295 ; Extensions like the two below can be used for FWD, Nikotel, sipgate etc.
296 ; Note that you must have a [sipprovider] section in sip.conf whereas
297 ; the otherprovider.net example does not require such a peer definition
299 ;exten => _41X.,1,Dial(SIP/${EXTEN:2}@sipprovider,,r)
300 ;exten => _42X.,1,Dial(SIP/user:passwd@${EXTEN:2}@otherprovider.net,30,rT)
302 ; Real extensions would go here. Generally you want real extensions to be 4 or 5
303 ; digits long (although there is no such requirement) and start with a single
304 ; digit that is fairly large (like 6 or 7) so that you have plenty of room to
305 ; overlap extensions and menu options without conflict. You can alias them with
306 ; names, too and use global variables
308 ;exten => 6245,1,Dial(SIP/Grandstream1,20,rt) ; permit transfer
309 ;exten => 6245,1,Dial(SIP/Grandstream1&SIP/Xlite1,20,rtT)
310 ;exten => 6361,1,Dial(IAX2/JaneDoe,,rm) ; ring without time limit
311 ;exten => 6389,1,Dial(MGCP/aaln/1@192.168.0.14)
312 ;exten => 6394,1,Dial(Local/6275/n) ; this will dial ${MARK}
314 ;exten => 6275,1,Macro(stdexten,6275,${MARK}) ; assuming ${MARK} is something like Zap/2
315 ;exten => mark,1,Goto(6275|1) ; alias mark to 6275
316 ;exten => 6536,1,Macro(stdexten,6236,${WIL}) ; Ditto for wil
317 ;exten => wil,1,Goto(6236|1)
319 ; Some other handy things are an extension for checking voicemail via
322 ;exten => 8500,1,VoicemailMain
323 ;exten => 8500,2,Hangup
325 ; Or a conference room (you'll need to edit meetme.conf to enable this room)
327 ;exten => 8600,1,Meetme(1234)
329 ; Or playing an announcement to the called party, as soon it answers
331 ;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg))
333 ; For more information on applications, just type "show applications" at your
334 ; friendly Asterisk CLI prompt.
336 ; 'show application <command>' will show details of how you
337 ; use that particular application in this file, the dial plan.