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
23 ; The "Globals" category contains global variables that can be referenced
24 ; in the dialplan with ${VARIABLE} or ${ENV(VARIABLE)} for Environmental variable
25 ; ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
28 CONSOLE=Console/dsp ; Console interface for demo
31 IAXINFO=guest ; IAXtel username/password
32 ;IAXINFO=myuser:mypass
33 TRUNK=Zap/g2 ; Trunk interface
34 ;TRUNK=IAX2/user:pass@provider
37 ; Any category other than "General" and "Globals" represent
38 ; extension contexts, which are collections of extensions.
40 ; Extension names may be numbers, letters, or combinations
41 ; thereof. If an extension name is prefixed by a '_'
42 ; character, it is interpreted as a pattern rather than a
43 ; literal. In patterns, some characters have special meanings:
45 ; X - any digit from 0-9
46 ; N - any digit from 2-9
47 ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
48 ; . - wildcard, matches anything remaining (e.g. _9011. matches anything starting with 9011 including 9011)
50 ; For example the extenion _NXXXXXX would match normal 7 digit dialings, while
51 ; _1NXXNXXXXXX would represent an area code plus phone number
54 ; Contexts contain several lines, one for each step of each
55 ; extension, which can take one of two forms as listed below,
56 ; with the first form being preferred. One may include another
57 ; context in the current one as well, optionally with a
58 ; date and time. Included contexts are included in the order
62 ;exten => someexten,priority,application(arg1,arg2,...)
63 ;exten => someexten,priority,application,arg1|arg2...
65 ; Timing list for includes is
67 ; <time range>|<days of week>|<days of month>|<months>
69 ;include => daytime|9:00-17:00|mon-fri|*|*
71 ; ignorepat can be used to instruct drivers to not cancel dialtone upon
72 ; receipt of a particular pattern. The most commonly used example is
73 ; of course '9' like this:
77 ; so that dialtone remains even after dialing a 9.
81 ; Here are the entries you need to participate in the IAXTEL
82 ; call routing system. Most IAXTEL numbers begin with 1-700, but
83 ; there are exceptions. For more information, and to sign
84 ; up, please go to www.gnophone.com or www.iaxtel.com
87 exten => _91700NXXXXXX,1,Dial(IAX2/${IAXINFO}@iaxtel.com/${EXTEN:1}@iaxtel)
90 ;switch => IAX2/user:[key]@myserver/mycontext
94 ; International long distance through trunk
96 exten => 9011.,1,Dial(${TRUNK}/${EXTEN:1})
97 exten => 9011.,2,Congestion
101 ; Long distance context accessed through trunk
103 exten => _91NXXNXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
104 exten => _91NXXNXXXXXX,2,Congestion
108 ; Local seven-digit dialing accessed through trunk interface
110 exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
111 exten => _9NXXXXXX,2,Congestion
115 ; Long distance context accessed through trunk interface
117 exten => _91800NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
118 exten => _91800NXXXXXX,2,Congestion
119 exten => _91888NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
120 exten => _91888NXXXXXX,2,Congestion
121 exten => _91877NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
122 exten => _91877NXXXXXX,2,Congestion
123 exten => _91866NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
124 exten => _91866NXXXXXX,2,Congestion
128 ; Master context for international long distance
131 include => longdistance
136 ; Master context for long distance
144 ; Master context for local, toll-free, and iaxtel calls only
148 include => parkedcalls
149 include => trunklocal
151 include => trunktollfree
152 include => iaxprovider
154 ; You can use an alternative switch type as well, to resolve
155 ; extensions that are not known here, for example with remote
156 ; IAX switching you transparently get access to the remote
158 ; switch => IAX2/user:password@bigserver/local
162 ; Standard extension macro:
163 ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
164 ; ${ARG2} - Device(s) to ring
166 exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
167 exten => s,2,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
168 exten => s,3,Goto(default,s,1) ; If they press #, return to start
169 exten => s,102,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
170 exten => s,103,Goto(default,s,1) ; If they press #, return to start
175 ; We start with what to do when a call first comes in.
177 exten => s,1,Wait,1 ; Wait a second, just for fun
178 exten => s,2,Answer ; Answer the line
179 exten => s,3,DigitTimeout,5 ; Set Digit Timeout to 5 seconds
180 exten => s,4,ResponseTimeout,10 ; Set Response Timeout to 10 seconds
181 exten => s,5,BackGround(demo-congrats) ; Play a congratulatory message
182 exten => s,6,BackGround(demo-instruct) ; Play some instructions
184 exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
185 exten => 2,2,Goto(s,6)
187 exten => 3,1,SetLanguage(fr) ; Set language to french
188 exten => 3,2,Goto(s,5) ; Start with the congratulations
190 exten => 1000,1,Goto(default,s,1)
192 ; We also create an example user, 1234, who is on the console and has
195 exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
196 ; (but skip if channel is not up)
197 exten => 1234,2,Macro(stdexten,1234,${CONSOLE})
199 exten => 1235,1,Voicemail(u1234) ; Right to voicemail
201 exten => 1236,1,Dial(Console/dsp) ; Ring forever
202 exten => 1236,2,Voicemail(u1234) ; Unless busy
205 ; # for when they're done with the demo
207 exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
208 exten => #,2,Hangup ; Hang them up.
211 ; A timeout and "invalid extension rule"
213 exten => t,1,Goto(#,1) ; If they take too long, give up
214 exten => i,1,Playback(invalid) ; "That's not valid, try again"
217 ; Create an extension, 500, for dialing the
220 exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
221 exten => 500,2,Dial(IAX2/guest@misery.digium.com/s@default) ; Call the Asterisk demo
222 exten => 500,3,Playback(demo-nogo) ; Couldn't connect to the demo site
223 exten => 500,4,Goto(s,6) ; Return to the start over message.
226 ; Create an extension, 600, for evaulating echo latency.
228 exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
229 exten => 600,2,Echo ; Do the echo test
230 exten => 600,3,Playback(demo-echodone) ; Let them know it's over
231 exten => 600,4,Goto(s,6) ; Start over
234 ; Give voicemail at extension 8500
236 exten => 8500,1,VoicemailMain
237 exten => 8500,2,Goto(s,6)
239 ; Here's what a phone entry would look like (IXJ for example)
241 ;exten => 1265,1,Dial(Phone/phone0,15)
242 ;exten => 1265,2,Goto(s,5)
246 ; Example "main menu" context with submenu
249 ;exten => s,2,Background(thanks) ; "Thanks for calling press 1 for sales, 2 for support, ..."
250 ;exten => 1,1,Goto(submenu,s,1)
255 ;exten => s,1,Ringing ; Make them comfortable with 2 seconds of ringback
257 ;exten => s,3,Background(submenuopts) ; "Thanks for calling the sales department. Press 1 for steve, 2 for..."
258 ;exten => 1,1,Goto(default,steve,1)
259 ;exten => 2,1,Goto(default,mark,2)
263 ; By default we include the demo. In a production system, you
264 ; probably don't want to have the demo there.
269 ; Real extensions would go here. Generally you want real extensions to be 4 or 5
270 ; digits long (although there is no such requirement) and start with a single
271 ; digit that is fairly large (like 6 or 7) so that you have plenty of room to
272 ; overlap extensions and menu options without conflict. You can alias them with
273 ; names, too and use global variables
276 ;exten => 6275,Macro(stdexten,6275,${MARK}) ; assuming ${MARK} is something like Zap/2
277 ;exten => mark,1,Goto(6275|1) ; alias mark to 6275
278 ;exten => 6236,Macro(stdexten,6236,${WIL}) ; Ditto for wil
279 ;exten => wil,1,Goto(6236|1)
281 ; Some other handy things are an extension for checking voicemail via
284 ;exten => 8500,1,VoicemailMain
285 ;exten => 8500,2,Hangup
287 ; Or a conference room (you'll need to edit meetme.conf to enable this room)
289 ;exten => 8600,1,Meetme,1234
291 ; For more information on applications, just type "show applications" at your
292 ; friendly Asterisk CLI prompt.