Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.82 KB | None | 0 0
  1. exten => 8500,1,Answer
  2. exten => 8500,n,WaitExten()
  3. exten => 8500,1,Playback(digits/1)
  4. exten => 8500,2,Playback(digits/2)
  5. exten => 8500,3,Playback(digits/3)
  6. exten => 8500,4,Playback(digits/4)
  7.  
  8. ;
  9. ; Static extension configuration file, used by
  10. ; the pbx_config module. This is where you configure all your
  11. ; inbound and outbound calls in Asterisk.
  12. ;
  13. ; This configuration file is reloaded
  14. ; - With the "extensions reload" command in the CLI
  15. ; - With the "reload" command (that reloads everything) in the CLI
  16.  
  17. ;
  18. ; The "General" category is for certain variables.
  19. ;
  20. [general]
  21. ;
  22. ; If static is set to no, or omitted, then the pbx_config will rewrite
  23. ; this file when extensions are modified. Remember that all comments
  24. ; made in the file will be lost when that happens.
  25. ;
  26. ; XXX Not yet implemented XXX
  27. ;
  28. static=yes
  29. ;
  30. ; if static=yes and writeprotect=no, you can save dialplan by
  31. ; CLI command 'save dialplan' too
  32. ;
  33. writeprotect=yes
  34. ;
  35. ; If autofallthrough is set, then if an extension runs out of
  36. ; things to do, it will terminate the call with BUSY, CONGESTION
  37. ; or HANGUP depending on Asterisk's best guess (strongly recommended).
  38. ;
  39. ; If autofallthrough is not set, then if an extension runs out of
  40. ; things to do, asterisk will wait for a new extension to be dialed
  41. ; (this is the original behavior of Asterisk 1.0 and earlier).
  42. ;
  43. autofallthrough=yes
  44. ;
  45. ; If clearglobalvars is set, global variables will be cleared
  46. ; and reparsed on an extensions reload, or Asterisk reload.
  47. ;
  48. ; If clearglobalvars is not set, then global variables will persist
  49. ; through reloads, and even if deleted from the extensions.conf or
  50. ; one of its included files, will remain set to the previous value.
  51. ;
  52. clearglobalvars=no
  53. ;
  54. ; If priorityjumping is set to 'yes', then applications that support
  55. ; 'jumping' to a different priority based on the result of their operations
  56. ; will do so (this is backwards compatible behavior with pre-1.2 releases
  57. ; of Asterisk). Individual applications can also be requested to do this
  58. ; by passing a 'j' option in their arguments.
  59. ;
  60. priorityjumping=yes
  61. ;
  62. ; You can include other config files, use the #include command
  63. ; (without the ';'). Note that this is different from the "include" command
  64. ; that includes contexts within other contexts. The #include command works
  65. ; in all asterisk configuration files.
  66. ;#include "filename.conf"
  67.  
  68. ; The "Globals" category contains global variables that can be referenced
  69. ; in the dialplan with ${VARIABLE} or ${ENV(VARIABLE)} for Environmental
  70. ; variables,
  71. ; ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
  72. ;
  73. ;[globals]
  74. #include "exten_gvars.inc"
  75. ;
  76. ; Sample entries for extensions.conf
  77. ;
  78. ;
  79. [dundi-e164-canonical]
  80. ;
  81. ; List canonical entries here
  82. ;
  83. ;exten => 12564286000,1,Macro(std-exten,6000,IAX2/foo)
  84. ;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7})
  85.  
  86. [dundi-e164-customers]
  87. ;
  88. ; If you are an ITSP or Reseller, list your customers here.
  89. ;
  90. ;exten => _12564286000,1,Dial(SIP/customer1)
  91. ;exten => _12564286001,1,Dial(IAX2/customer2)
  92.  
  93. [dundi-e164-via-pstn]
  94. ;
  95. ; If you are freely delivering calls to the PSTN, list them here
  96. ;
  97. ;exten => _1256428XXXX,1,Dial(Zap/g2/${EXTEN:7}) ; Expose all of 256-428
  98. ;exten => _1256325XXXX,1,Dial(Zap/g2/${EXTEN:7}) ; Ditto for 256-325
  99.  
  100. [dundi-e164-local]
  101. ;
  102. ; Context to put your dundi IAX2 or SIP user in for
  103. ; full access
  104. ;
  105. include => dundi-e164-canonical
  106. include => dundi-e164-customers
  107. include => dundi-e164-via-pstn
  108.  
  109. [dundi-e164-switch]
  110. ;
  111. ; Just a wrapper for the switch
  112. ;
  113. switch => DUNDi/e164
  114.  
  115. [dundi-e164-lookup]
  116. ;
  117. ; Locally to lookup, try looking for a local E.164 solution
  118. ; then try DUNDi if we don't have one.
  119. ;
  120. include => dundi-e164-local
  121. include => dundi-e164-switch
  122. ;
  123. ; DUNDi can also be implemented as a Macro instead of using
  124. ; the Local channel driver.
  125. ;
  126. [macro-dundi-e164]
  127. ;
  128. ; ARG1 is the extension to Dial
  129. ;
  130. exten => s,1,Goto(${ARG1},1)
  131. include => dundi-e164-lookup
  132.  
  133. ;
  134. ; Here are the entries you need to participate in the IAXTEL
  135. ; call routing system. Most IAXTEL numbers begin with 1-700, but
  136. ; there are exceptions. For more information, and to sign
  137. ; up, please go to www.gnophone.com or www.iaxtel.com
  138. ;
  139. [iaxtel700]
  140. exten => _91700XXXXXXX,1,Dial(IAX2/${IAXINFO}@iaxtel.com/${EXTEN:1}@iaxtel)
  141.  
  142. ;
  143. ; The SWITCH statement permits a server to share the dialplan with
  144. ; another server. Use with care: Reciprocal switch statements are not
  145. ; allowed (e.g. both A -> B and B -> A), and the switched server needs
  146. ; to be on-line or else dialing can be severly delayed.
  147. ;
  148. [iaxprovider]
  149. ;switch => IAX2/user:[key]@myserver/mycontext
  150.  
  151. [trunk]
  152. exten => _01,1,Dial(${trunk1})
  153. exten => _01,2,Congestion
  154. exten => _01.,1,Dial(${trunk1}/${EXTEN:2})
  155. exten => _01.,2,Congestion
  156. exten => _02.,1,Dial(${trunk2}/${EXTEN:2})
  157. exten => _02.,2,Congestion
  158.  
  159. [trunkint]
  160. ;
  161. ; International long distance through trunk
  162. ;
  163. exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
  164. exten => _9011.,n,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
  165.  
  166. [trunkld]
  167. ;
  168. ; Long distance context accessed through trunk
  169. ;
  170. exten => _91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1})
  171. exten => _91NXXNXXXXXX,n,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
  172.  
  173. [trunklocal]
  174. ;
  175. ; Local seven-digit dialing accessed through trunk interface
  176. ;
  177. exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
  178.  
  179. [trunktollfree]
  180. ;
  181. ; Long distance context accessed through trunk interface
  182. ;
  183. exten => _91800NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
  184. exten => _91888NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
  185. exten => _91877NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
  186. exten => _91866NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})
  187.  
  188. [international]
  189. ;
  190. ; Master context for international long distance
  191. ;
  192. ignorepat => 9
  193. include => longdistance
  194. include => trunkint
  195.  
  196. [longdistance]
  197. ;
  198. ; Master context for long distance
  199. ;
  200. ignorepat => 9
  201. include => local
  202. include => trunkld
  203.  
  204. [local]
  205. ;
  206. ; Master context for local, toll-free, and iaxtel calls only
  207. ;
  208. ignorepat => 9
  209. include => default
  210. include => parkedcalls
  211. include => trunklocal
  212. include => iaxtel700
  213. include => trunktollfree
  214. include => iaxprovider
  215. ;
  216. ; You can use an alternative switch type as well, to resolve
  217. ; extensions that are not known here, for example with remote
  218. ; IAX switching you transparently get access to the remote
  219. ; Asterisk PBX
  220. ;
  221. ; switch => IAX2/user:password@bigserver/local
  222. ;
  223. ; An "lswitch" is like a switch but is literal, in that
  224. ; variable substitution is not performed at load time
  225. ; but is passed to the switch directly (presumably to
  226. ; be substituted in the switch routine itself)
  227. ;
  228. ; lswitch => Loopback/12${EXTEN}@othercontext
  229. ;
  230. ; An "eswitch" is like a switch but the evaluation of
  231. ; variable substitution is performed at runtime before
  232. ; being passed to the switch routine.
  233. ;
  234. ; eswitch => IAX2/context@${CURSERVER}
  235.  
  236. [macro-stdexten];
  237. ;
  238. ; Standard extension macro:
  239. ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
  240. ; ${ARG2} - Device(s) to ring
  241. ;
  242. exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
  243. exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
  244.  
  245. exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
  246. exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
  247.  
  248. exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
  249. exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
  250.  
  251. exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
  252.  
  253. exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain
  254.  
  255. [macro-stdPrivacyexten];
  256. ;
  257. ; Standard extension macro:
  258. ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
  259. ; ${ARG2} - Device(s) to ring
  260. ; ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority)
  261. ; ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)`
  262. ;
  263. exten => s,1,Dial(${ARG2},20|p) ; Ring the interface, 20 seconds maximum, call screening option (or use P for databased call screening)
  264. exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
  265.  
  266. exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
  267. exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
  268.  
  269. exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
  270. exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
  271.  
  272. exten => s-DONTCALL,1,Goto(${ARG3},s,1) ; Callee chose to send this call to a polite "Don't call again" script.
  273.  
  274. exten => s-TORTURE,1,Goto(${ARG4},s,1) ; Callee chose to send this call to a telemarketer torture script.
  275.  
  276. exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
  277.  
  278. exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain
  279.  
  280. [internal]
  281. exten => 3000,1,Dial(${ip3000},30,Ttm)
  282. exten => 3000,2,Voicemail(u3000)
  283. exten => 3000,3,Hangup
  284. exten => 3000,102,Voicemail(b3000)
  285. exten => 3000,103,Hangup
  286. exten => 3001,1,Dial(${ip3001},30,Ttm)
  287. exten => 3001,2,Voicemail(u3001)
  288. exten => 3001,3,Hangup
  289. exten => 3001,102,Voicemail(b3001)
  290. exten => 3001,103,Hangup
  291. exten => 3002,1,Dial(${ip3002},30,Ttm)
  292. exten => 3002,2,Voicemail(u3002)
  293. exten => 3002,3,Hangup
  294. exten => 3002,102,Voicemail(b3002)
  295. exten => 3002,103,Hangup
  296. exten => 3003,1,Dial(${ip3003},30,Ttm)
  297. exten => 3003,2,Voicemail(u3003)
  298. exten => 3003,3,Hangup
  299. exten => 3003,102,Voicemail(b3003)
  300. exten => 3003,103,Hangup
  301.  
  302.  
  303. [demo]
  304. ;
  305. ; We start with what to do when a call first comes in.
  306. ;
  307. exten => s,1,Wait,1 ; Wait a second, just for fun
  308. exten => s,n,Answer ; Answer the line
  309. exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
  310. exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
  311. exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message
  312. exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions
  313. exten => s,n,WaitExten ; Wait for an extension to be dialed.
  314.  
  315. ;exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
  316. ;exten => 2,n,Goto(s,instruct)
  317.  
  318. ;exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
  319. ;exten => 3,n,Goto(s,restart) ; Start with the congratulations
  320.  
  321.  
  322.  
  323. ;
  324. ; Create an extension, 5, for dialing the Skype Test Call.
  325. ;
  326. ;exten => 5,1,Playback(transfer,skip) ; "Please hold while..."
  327. ;exten => 5,2,Celliax2Skype(echo123) ; call the Skype Test Call
  328. ;exten => 5,3,Goto(s,restart) ; Return to the start over message.
  329. ;
  330. ; Skype Contacts Directory
  331. ;exten => 6,1,Celliax_Skype_Directory(default|default|f)
  332.  
  333. ; Create an extension, 8, for dialing MYCELLNUMBER
  334. ; via Celliax (you can't use this if you are calling on the one
  335. ; only Celliax channel. But you can call from IAX, SIP, PSTN, etc...)
  336. ;
  337. ;exten => 8,1,Playback(transfer,skip) ; "Please hold while..."
  338. ;exten => 8,2,Dial(CELLIAX/GSM0/${MYCELLNUMBER}) ; dial MYCELLNUMBER from the Celliax channel named by the input audio device it use
  339.  
  340.  
  341.  
  342. exten => 1000,1,Goto(default,s,1)
  343. ; We also create an example user, 1234, who is on the console and has
  344. ; voicemail, etc.
  345. ;
  346. exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
  347. ; (but skip if channel is not up)
  348. exten => 1234,n,Macro(stdexten,1234,${ip3000})
  349.  
  350. exten => 1235,1,Voicemail(u3000}) ; Right to voicemail
  351.  
  352. exten => 1236,1,Dial(${ip3000}) ; Ring forever
  353. exten => 1236,n,Voicemail(u3000}) ; Unless busy
  354.  
  355.  
  356. ;
  357. ; # for when they're done with the demo
  358. ;
  359. exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
  360. exten => #,n,Hangup ; Hang them up.
  361.  
  362. ;
  363. ; A timeout and "invalid extension rule"
  364. ;
  365. exten => t,1,Goto(#,1) ; If they take too long, give up
  366. exten => i,1,Playback(invalid) ; "That's not valid, try again"
  367.  
  368. ;
  369. ; Create an extension, 500, for dialing the
  370. ; Asterisk demo.
  371. ;
  372. exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
  373. exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo
  374. exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site
  375. exten => 500,n,Goto(s,6) ; Return to the start over message.
  376. ;
  377. ; Create an extension, 501, for dialing the
  378. ; AsteriskWin32 demo.
  379. ;
  380. exten => 501,1,Playback(pls-wait-connect-call); Let them know what's going on
  381. exten => 501,n,Dial(IAX2/guest@demo.asteriskwin32.com/s@default) ; Call the AsteriskWin32 demo
  382. exten => 501,n,Playback(cannot-complete-network-error) ; Couldn't connect to the demo site
  383. exten => 501,n,Playback(pls-try-call-later)
  384. exten => 501,n,Goto(s,6) ; Return to the start over message.
  385.  
  386. ;
  387. ; Create an extension, 600, for evaluating echo latency.
  388. ;
  389. exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
  390. exten => 600,n,Echo ; Do the echo test
  391. exten => 600,n,Playback(demo-echodone) ; Let them know it's over
  392. exten => 600,n,Goto(s,6) ; Start over
  393.  
  394. ;
  395. ; Give voicemail at extension 8500
  396. ;
  397. exten => 8500,1,Answer
  398. exten => 8500,n,WaitExten()
  399. exten => 8500,1,Playback(digits/1)
  400. exten => 8500,2,Playback(digits/2)
  401. exten => 8500,3,Playback(digits/3)
  402. exten => 8500,4,Playback(digits/4)
  403.  
  404.  
  405.  
  406. exten => 123,1,Answer
  407. exten => 123,n,Background(demo-moreinfo)
  408. exten => 123,n,WaitExten()
  409. exten => 1,1,Playback(digits/1)
  410. exten => 2,1,Playback(digits/2)
  411. exten => 3,1,Playback(digits/3)
  412. exten => 4,1,Playback(digits/4)
  413.  
  414. [default]
  415. ;
  416. ; By default we include the demo. In a production system, you
  417. ; probably don't want to have the demo there.
  418. ;
  419. include => demo
  420. include => parkedcalls
  421. include => trunk
  422. include => internal
  423.  
  424.  
  425. exten => 99990,1,Answer
  426. exten => 99990,2,AGI(agi-test.agi)
  427. exten => 99990,3,Hangup
  428. exten => 99991,1,Answer
  429. exten => 99991,2,EAGI(eagi-test)
  430. exten => 99991,3,Hangup
  431. exten => 99992,1,Answer
  432. exten => 99992,2,Wait(1)
  433. exten => 99992,3,SayUnixTime()
  434. exten => 99992,4,Hangup
  435. exten => 99999,1,Answer
  436. exten => 99999,2,Wait(1)
  437. exten => 99999,3,MusicOnHold
  438.  
  439.  
  440. [skype]
  441. exten => s,1,Answer;
  442. exten => s,2,Skype2Celliax(${MYCELLNUMBER}); Connect the Skype incoming call with the cellphone at MYCELLNUMBER
  443. exten => s,3,Hangup ; Hang them up.
  444.  
  445. exten => 100,1,dial(SIP/mysjphone)
  446. exten => mysjphone,1,goto(100,1) ; To be able to dial with text, "mysjphone"
  447.  
  448.  
  449.  
  450. exten => 123,1,Answer
  451. exten => 123,n,Background(main-menu)
  452. exten => 123,n,WaitExten()
  453. exten => 1,1,Playback(digits/1)
  454. exten => 2,1,Playback(digits/2)
  455. exten => 3,1,Playback(digits/3)
  456. exten => 4,1,Playback(digits/4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement