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 TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
35 ;TRUNK=IAX2/user:pass@provider
38 ; Any category other than "General" and "Globals" represent
39 ; extension contexts, which are collections of extensions.
41 ; Extension names may be numbers, letters, or combinations
42 ; thereof. If an extension name is prefixed by a '_'
43 ; character, it is interpreted as a pattern rather than a
44 ; literal. In patterns, some characters have special meanings:
46 ; X - any digit from 0-9
47 ; N - any digit from 2-9
48 ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
49 ; . - wildcard, matches anything remaining (e.g. _9011. matches anything starting with 9011 including 9011)
51 ; For example the extenion _NXXXXXX would match normal 7 digit dialings, while
52 ; _1NXXNXXXXXX would represent an area code plus phone number
55 ; Contexts contain several lines, one for each step of each
56 ; extension, which can take one of two forms as listed below,
57 ; with the first form being preferred. One may include another
58 ; context in the current one as well, optionally with a
59 ; date and time. Included contexts are included in the order
63 ;exten => someexten,priority,application(arg1,arg2,...)
64 ;exten => someexten,priority,application,arg1|arg2...
66 ; Timing list for includes is
68 ; <time range>|<days of week>|<days of month>|<months>
70 ;include => daytime|9:00-17:00|mon-fri|*|*
72 ; ignorepat can be used to instruct drivers to not cancel dialtone upon
73 ; receipt of a particular pattern. The most commonly used example is
74 ; of course '9' like this:
78 ; so that dialtone remains even after dialing a 9.
82 ; Here are the entries you need to participate in the IAXTEL
83 ; call routing system. Most IAXTEL numbers begin with 1-700, but
84 ; there are exceptions. For more information, and to sign
85 ; up, please go to www.gnophone.com or www.iaxtel.com
88 exten => _91700NXXXXXX,1,Dial(IAX2/${IAXINFO}@iaxtel.com/${EXTEN:1}@iaxtel)
91 ;switch => IAX2/user:[key]@myserver/mycontext
95 ; International long distance through trunk
97 exten => _9011.,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
98 exten => _9011.,2,Congestion
102 ; Long distance context accessed through trunk
104 exten => _91NXXNXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
105 exten => _91NXXNXXXXXX,2,Congestion
109 ; Local seven-digit dialing accessed through trunk interface
111 exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
112 exten => _9NXXXXXX,2,Congestion
116 ; Long distance context accessed through trunk interface
118 exten => _91800NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
119 exten => _91800NXXXXXX,2,Congestion
120 exten => _91888NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
121 exten => _91888NXXXXXX,2,Congestion
122 exten => _91877NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
123 exten => _91877NXXXXXX,2,Congestion
124 exten => _91866NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
125 exten => _91866NXXXXXX,2,Congestion
129 ; Master context for international long distance
132 include => longdistance
137 ; Master context for long distance
145 ; Master context for local, toll-free, and iaxtel calls only
149 include => parkedcalls
150 include => trunklocal
152 include => trunktollfree
153 include => iaxprovider
155 ; You can use an alternative switch type as well, to resolve
156 ; extensions that are not known here, for example with remote
157 ; IAX switching you transparently get access to the remote
159 ; switch => IAX2/user:password@bigserver/local
163 ; Standard extension macro:
164 ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
165 ; ${ARG2} - Device(s) to ring
167 exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
168 exten => s,2,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
169 exten => s,3,Goto(default,s,1) ; If they press #, return to start
170 exten => s,102,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
171 exten => s,103,Goto(default,s,1) ; If they press #, return to start
176 ; We start with what to do when a call first comes in.
178 exten => s,1,Wait,1 ; Wait a second, just for fun
179 exten => s,2,Answer ; Answer the line
180 exten => s,3,DigitTimeout,5 ; Set Digit Timeout to 5 seconds
181 exten => s,4,ResponseTimeout,10 ; Set Response Timeout to 10 seconds
182 exten => s,5,BackGround(demo-congrats) ; Play a congratulatory message
183 exten => s,6,BackGround(demo-instruct) ; Play some instructions
185 exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
186 exten => 2,2,Goto(s,6)
188 exten => 3,1,SetLanguage(fr) ; Set language to french
189 exten => 3,2,Goto(s,5) ; Start with the congratulations
191 exten => 1000,1,Goto(default,s,1)
193 ; We also create an example user, 1234, who is on the console and has
196 exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
197 ; (but skip if channel is not up)
198 exten => 1234,2,Macro(stdexten,1234,${CONSOLE})
200 exten => 1235,1,Voicemail(u1234) ; Right to voicemail
202 exten => 1236,1,Dial(Console/dsp) ; Ring forever
203 exten => 1236,2,Voicemail(u1234) ; Unless busy
206 ; # for when they're done with the demo
208 exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
209 exten => #,2,Hangup ; Hang them up.
212 ; A timeout and "invalid extension rule"
214 exten => t,1,Goto(#,1) ; If they take too long, give up
215 exten => i,1,Playback(invalid) ; "That's not valid, try again"
218 ; Create an extension, 500, for dialing the
221 exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
222 exten => 500,2,Dial(IAX2/guest@misery.digium.com/s@default) ; Call the Asterisk demo
223 exten => 500,3,Playback(demo-nogo) ; Couldn't connect to the demo site
224 exten => 500,4,Goto(s,6) ; Return to the start over message.
227 ; Create an extension, 600, for evaulating echo latency.
229 exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
230 exten => 600,2,Echo ; Do the echo test
231 exten => 600,3,Playback(demo-echodone) ; Let them know it's over
232 exten => 600,4,Goto(s,6) ; Start over
235 ; Give voicemail at extension 8500
237 exten => 8500,1,VoicemailMain
238 exten => 8500,2,Goto(s,6)
240 ; Here's what a phone entry would look like (IXJ for example)
242 ;exten => 1265,1,Dial(Phone/phone0,15)
243 ;exten => 1265,2,Goto(s,5)
247 ; Example "main menu" context with submenu
250 ;exten => s,2,Background(thanks) ; "Thanks for calling press 1 for sales, 2 for support, ..."
251 ;exten => 1,1,Goto(submenu,s,1)
256 ;exten => s,1,Ringing ; Make them comfortable with 2 seconds of ringback
258 ;exten => s,3,Background(submenuopts) ; "Thanks for calling the sales department. Press 1 for steve, 2 for..."
259 ;exten => 1,1,Goto(default,steve,1)
260 ;exten => 2,1,Goto(default,mark,2)
264 ; By default we include the demo. In a production system, you
265 ; probably don't want to have the demo there.
270 ; Real extensions would go here. Generally you want real extensions to be 4 or 5
271 ; digits long (although there is no such requirement) and start with a single
272 ; digit that is fairly large (like 6 or 7) so that you have plenty of room to
273 ; overlap extensions and menu options without conflict. You can alias them with
274 ; names, too and use global variables
277 ;exten => 6275,1,Macro(stdexten,6275,${MARK}) ; assuming ${MARK} is something like Zap/2
278 ;exten => mark,1,Goto(6275|1) ; alias mark to 6275
279 ;exten => 6236,1,Macro(stdexten,6236,${WIL}) ; Ditto for wil
280 ;exten => wil,1,Goto(6236|1)
282 ; Some other handy things are an extension for checking voicemail via
285 ;exten => 8500,1,VoicemailMain
286 ;exten => 8500,2,Hangup
288 ; Or a conference room (you'll need to edit meetme.conf to enable this room)
290 ;exten => 8600,1,Meetme,1234
292 ; Or playing an announce to the called party, as soon it answers
294 ;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg))
296 ; For more information on applications, just type "show applications" at your
297 ; friendly Asterisk CLI prompt.