2 ; Static extension configuration files, used by
3 ; the pbx_config module.
5 ; The "General" category is for certain variables.
9 ; If static is set to no, or omitted, then the pbx_config will rewrite
10 ; this file when extensions are modified. Remember that all comments
11 ; made in the file will be lost when that happens.
13 ; XXX Not yet implemented XXX
17 ; if static=yes and writeprotect=no, you can save dialplan by
18 ; CLI command 'save dialplan' too
22 ; You can include other config files, use the #include command (without the ';')
23 ; Note that this is different from the "include" command that includes contexts within
24 ; other contexts. The #include command works in all asterisk configuration files.
25 ;#include "filename.conf"
27 ; The "Globals" category contains global variables that can be referenced
28 ; in the dialplan with ${VARIABLE} or ${ENV(VARIABLE)} for Environmental variable
29 ; ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
32 CONSOLE=Console/dsp ; Console interface for demo
35 IAXINFO=guest ; IAXtel username/password
36 ;IAXINFO=myuser:mypass
37 TRUNK=Zap/g2 ; Trunk interface
38 TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
39 ;TRUNK=IAX2/user:pass@provider
42 ; Any category other than "General" and "Globals" represent
43 ; extension contexts, which are collections of extensions.
45 ; Extension names may be numbers, letters, or combinations
46 ; thereof. If an extension name is prefixed by a '_'
47 ; character, it is interpreted as a pattern rather than a
48 ; literal. In patterns, some characters have special meanings:
50 ; X - any digit from 0-9
51 ; N - any digit from 2-9
52 ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
53 ; . - wildcard, matches anything remaining (e.g. _9011. matches anything starting with 9011 including 9011)
55 ; For example the extenion _NXXXXXX would match normal 7 digit dialings, while
56 ; _1NXXNXXXXXX would represent an area code plus phone number
59 ; Contexts contain several lines, one for each step of each
60 ; extension, which can take one of two forms as listed below,
61 ; with the first form being preferred. One may include another
62 ; context in the current one as well, optionally with a
63 ; date and time. Included contexts are included in the order
67 ;exten => someexten,priority,application(arg1,arg2,...)
68 ;exten => someexten,priority,application,arg1|arg2...
70 ; Timing list for includes is
72 ; <time range>|<days of week>|<days of month>|<months>
74 ;include => daytime|9:00-17:00|mon-fri|*|*
76 ; ignorepat can be used to instruct drivers to not cancel dialtone upon
77 ; receipt of a particular pattern. The most commonly used example is
78 ; of course '9' like this:
82 ; so that dialtone remains even after dialing a 9.
86 ; Here are the entries you need to participate in the IAXTEL
87 ; call routing system. Most IAXTEL numbers begin with 1-700, but
88 ; there are exceptions. For more information, and to sign
89 ; up, please go to www.gnophone.com or www.iaxtel.com
92 exten => _91700NXXXXXX,1,Dial(IAX2/${IAXINFO}@iaxtel.com/${EXTEN:1}@iaxtel)
95 ;switch => IAX2/user:[key]@myserver/mycontext
99 ; International long distance through trunk
101 exten => _9011.,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
102 exten => _9011.,2,Congestion
106 ; Long distance context accessed through trunk
108 exten => _91NXXNXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
109 exten => _91NXXNXXXXXX,2,Congestion
113 ; Local seven-digit dialing accessed through trunk interface
115 exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
116 exten => _9NXXXXXX,2,Congestion
120 ; Long distance context accessed through trunk interface
122 exten => _91800NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
123 exten => _91800NXXXXXX,2,Congestion
124 exten => _91888NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
125 exten => _91888NXXXXXX,2,Congestion
126 exten => _91877NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
127 exten => _91877NXXXXXX,2,Congestion
128 exten => _91866NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
129 exten => _91866NXXXXXX,2,Congestion
133 ; Master context for international long distance
136 include => longdistance
141 ; Master context for long distance
149 ; Master context for local, toll-free, and iaxtel calls only
153 include => parkedcalls
154 include => trunklocal
156 include => trunktollfree
157 include => iaxprovider
159 ; You can use an alternative switch type as well, to resolve
160 ; extensions that are not known here, for example with remote
161 ; IAX switching you transparently get access to the remote
163 ; switch => IAX2/user:password@bigserver/local
167 ; Standard extension macro:
168 ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
169 ; ${ARG2} - Device(s) to ring
171 exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
172 exten => s,2,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
173 exten => s,3,Goto(default,s,1) ; If they press #, return to start
174 exten => s,102,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
175 exten => s,103,Goto(default,s,1) ; If they press #, return to start
180 ; We start with what to do when a call first comes in.
182 exten => s,1,Wait,1 ; Wait a second, just for fun
183 exten => s,2,Answer ; Answer the line
184 exten => s,3,DigitTimeout,5 ; Set Digit Timeout to 5 seconds
185 exten => s,4,ResponseTimeout,10 ; Set Response Timeout to 10 seconds
186 exten => s,5,BackGround(demo-congrats) ; Play a congratulatory message
187 exten => s,6,BackGround(demo-instruct) ; Play some instructions
189 exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
190 exten => 2,2,Goto(s,6)
192 exten => 3,1,SetLanguage(fr) ; Set language to french
193 exten => 3,2,Goto(s,5) ; Start with the congratulations
195 exten => 1000,1,Goto(default,s,1)
197 ; We also create an example user, 1234, who is on the console and has
200 exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
201 ; (but skip if channel is not up)
202 exten => 1234,2,Macro(stdexten,1234,${CONSOLE})
204 exten => 1235,1,Voicemail(u1234) ; Right to voicemail
206 exten => 1236,1,Dial(Console/dsp) ; Ring forever
207 exten => 1236,2,Voicemail(u1234) ; Unless busy
210 ; # for when they're done with the demo
212 exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
213 exten => #,2,Hangup ; Hang them up.
216 ; A timeout and "invalid extension rule"
218 exten => t,1,Goto(#,1) ; If they take too long, give up
219 exten => i,1,Playback(invalid) ; "That's not valid, try again"
222 ; Create an extension, 500, for dialing the
225 exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
226 exten => 500,2,Dial(IAX2/guest@misery.digium.com/s@default) ; Call the Asterisk demo
227 exten => 500,3,Playback(demo-nogo) ; Couldn't connect to the demo site
228 exten => 500,4,Goto(s,6) ; Return to the start over message.
231 ; Create an extension, 600, for evaulating echo latency.
233 exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
234 exten => 600,2,Echo ; Do the echo test
235 exten => 600,3,Playback(demo-echodone) ; Let them know it's over
236 exten => 600,4,Goto(s,6) ; Start over
239 ; Give voicemail at extension 8500
241 exten => 8500,1,VoicemailMain
242 exten => 8500,2,Goto(s,6)
244 ; Here's what a phone entry would look like (IXJ for example)
246 ;exten => 1265,1,Dial(Phone/phone0,15)
247 ;exten => 1265,2,Goto(s,5)
251 ; Example "main menu" context with submenu
254 ;exten => s,2,Background(thanks) ; "Thanks for calling press 1 for sales, 2 for support, ..."
255 ;exten => 1,1,Goto(submenu,s,1)
260 ;exten => s,1,Ringing ; Make them comfortable with 2 seconds of ringback
262 ;exten => s,3,Background(submenuopts) ; "Thanks for calling the sales department. Press 1 for steve, 2 for..."
263 ;exten => 1,1,Goto(default,steve,1)
264 ;exten => 2,1,Goto(default,mark,2)
268 ; By default we include the demo. In a production system, you
269 ; probably don't want to have the demo there.
274 ; Real extensions would go here. Generally you want real extensions to be 4 or 5
275 ; digits long (although there is no such requirement) and start with a single
276 ; digit that is fairly large (like 6 or 7) so that you have plenty of room to
277 ; overlap extensions and menu options without conflict. You can alias them with
278 ; names, too and use global variables
281 ;exten => 6275,1,Macro(stdexten,6275,${MARK}) ; assuming ${MARK} is something like Zap/2
282 ;exten => mark,1,Goto(6275|1) ; alias mark to 6275
283 ;exten => 6236,1,Macro(stdexten,6236,${WIL}) ; Ditto for wil
284 ;exten => wil,1,Goto(6236|1)
286 ; Some other handy things are an extension for checking voicemail via
289 ;exten => 8500,1,VoicemailMain
290 ;exten => 8500,2,Hangup
292 ; Or a conference room (you'll need to edit meetme.conf to enable this room)
294 ;exten => 8600,1,Meetme,1234
296 ; Or playing an announce to the called party, as soon it answers
298 ;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg))
300 ; For more information on applications, just type "show applications" at your
301 ; friendly Asterisk CLI prompt.