Advertisement
Guest User

Extensions.conf

a guest
Jan 24th, 2013
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.34 KB | None | 0 0
  1. ;!
  2. ;! Automatically generated configuration file
  3. ;! Filename: extensions.conf (/etc/asterisk/extensions.conf)
  4. ;! Generator: Manager
  5. ;! Creation Date: Wed Jan 9 22:28:06 2013
  6. ;!
  7. ; extensions.conf - the Asterisk dial plan
  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 "dialplan 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 "dialplan save" too
  32. ;
  33. writeprotect = no
  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. This is the default.
  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=no
  44. ;
  45. ;
  46. ;
  47. ; If extenpatternmatchnew is set (true, yes, etc), then a new algorithm that uses
  48. ; a Trie to find the best matching pattern is used. In dialplans
  49. ; with more than about 20-40 extensions in a single context, this
  50. ; new algorithm can provide a noticeable speedup.
  51. ; With 50 extensions, the speedup is 1.32x
  52. ; with 88 extensions, the speedup is 2.23x
  53. ; with 138 extensions, the speedup is 3.44x
  54. ; with 238 extensions, the speedup is 5.8x
  55. ; with 438 extensions, the speedup is 10.4x
  56. ; With 1000 extensions, the speedup is ~25x
  57. ; with 10,000 extensions, the speedup is 374x
  58. ; Basically, the new algorithm provides a flat response
  59. ; time, no matter the number of extensions.
  60. ;
  61. ; By default, the old pattern matcher is used.
  62. ;
  63. ; ****This is a new feature! *********************
  64. ; The new pattern matcher is for the brave, the bold, and
  65. ; the desperate. If you have large dialplans (more than about 50 extensions
  66. ; in a context), and/or high call volume, you might consider setting
  67. ; this value to "yes" !!
  68. ; Please, if you try this out, and are forced to return to the
  69. ; old pattern matcher, please report your reasons in a bug report
  70. ; on https://issues.asterisk.org. We have made good progress in providing
  71. ; something compatible with the old matcher; help us finish the job!
  72. ;
  73. ; This value can be switched at runtime using the cli command "dialplan set extenpatternmatchnew true"
  74. ; or "dialplan set extenpatternmatchnew false", so you can experiment to your hearts content.
  75. ;
  76. ;extenpatternmatchnew=no
  77. ;
  78. ; If clearglobalvars is set, global variables will be cleared
  79. ; and reparsed on a dialplan reload, or Asterisk reload.
  80. ;
  81. ; If clearglobalvars is not set, then global variables will persist
  82. ; through reloads, and even if deleted from the extensions.conf or
  83. ; one of its included files, will remain set to the previous value.
  84. ;
  85. ; NOTE: A complication sets in, if you put your global variables into
  86. ; the AEL file, instead of the extensions.conf file. With clearglobalvars
  87. ; set, a "reload" will often leave the globals vars cleared, because it
  88. ; is not unusual to have extensions.conf (which will have no globals)
  89. ; load after the extensions.ael file (where the global vars are stored).
  90. ; So, with "reload" in this particular situation, first the AEL file will
  91. ; clear and then set all the global vars, then, later, when the extensions.conf
  92. ; file is loaded, the global vars are all cleared, and then not set, because
  93. ; they are not stored in the extensions.conf file.
  94. ;
  95. clearglobalvars = no
  96. ;
  97. ; User context is where entries from users.conf are registered. The
  98. ; default value is 'default'
  99. ;
  100. ;userscontext=default
  101. ;
  102. ; You can include other config files, use the #include command
  103. ; (without the ';'). Note that this is different from the "include" command
  104. ; that includes contexts within other contexts. The #include command works
  105. ; in all asterisk configuration files.
  106. ;#include "filename.conf"
  107. ;#include <filename.conf>
  108. ;#include filename.conf
  109. ;
  110. ; You can execute a program or script that produces config files, and they
  111. ; will be inserted where you insert the #exec command. The #exec command
  112. ; works on all asterisk configuration files. However, you will need to
  113. ; activate them within asterisk.conf with the "execincludes" option. They
  114. ; are otherwise considered a security risk.
  115. ;#exec /opt/bin/build-extra-contexts.sh
  116. ;#exec /opt/bin/build-extra-contexts.sh --foo="bar"
  117. ;#exec </opt/bin/build-extra-contexts.sh --foo="bar">
  118. ;#exec "/opt/bin/build-extra-contexts.sh --foo=\"bar\""
  119. ;
  120.  
  121. ; The "Globals" category contains global variables that can be referenced
  122. ; in the dialplan with the GLOBAL dialplan function:
  123. ; ${GLOBAL(VARIABLE)}
  124. ; ${${GLOBAL(VARIABLE)}} or ${text${GLOBAL(VARIABLE)}} or any hybrid
  125. ; Unix/Linux environmental variables can be reached with the ENV dialplan
  126. ; function: ${ENV(VARIABLE)}
  127. ;
  128. [globals]
  129. CONSOLE = Console/dsp ; Console interface for demo
  130. ;CONSOLE=DAHDI/1
  131. ;CONSOLE=Phone/phone0
  132. IAXINFO = guest ; IAXtel username/password
  133. ;IAXINFO=myuser:mypass
  134. TRUNK = DAHDI/G2 ; Trunk interface
  135. ;
  136. ; Note the 'G2' in the TRUNK variable above. It specifies which group (defined
  137. ; in chan_dahdi.conf) to dial, i.e. group 2, and how to choose a channel to use
  138. ; in the specified group. The four possible options are:
  139. ;
  140. ; g: select the lowest-numbered non-busy DAHDI channel
  141. ; (aka. ascending sequential hunt group).
  142. ; G: select the highest-numbered non-busy DAHDI channel
  143. ; (aka. descending sequential hunt group).
  144. ; r: use a round-robin search, starting at the next highest channel than last
  145. ; time (aka. ascending rotary hunt group).
  146. ; R: use a round-robin search, starting at the next lowest channel than last
  147. ; time (aka. descending rotary hunt group).
  148. ;
  149. TRUNKMSD = 1 ; MSD digits to strip (usually 1 or 0)
  150. FEATURES =
  151. DIALOPTIONS =
  152. RINGTIME = 20
  153. FOLLOWMEOPTIONS =
  154. PAGING_HEADER = Intercom
  155. ;TRUNK=IAX2/user:pass@provider
  156.  
  157. ;FREENUMDOMAIN=mydomain.com ; domain to send on outbound
  158. ; freenum calls (uses outbound-freenum
  159. ; context)
  160.  
  161. ;
  162. ; WARNING WARNING WARNING WARNING
  163. ; If you load any other extension configuration engine, such as pbx_ael.so,
  164. ; your global variables may be overridden by that file. Please take care to
  165. ; use only one location to set global variables, and you will likely save
  166. ; yourself a ton of grief.
  167. ; WARNING WARNING WARNING WARNING
  168. ;
  169. ; Any category other than "General" and "Globals" represent
  170. ; extension contexts, which are collections of extensions.
  171. ;
  172. ; Extension names may be numbers, letters, or combinations
  173. ; thereof. If an extension name is prefixed by a '_'
  174. ; character, it is interpreted as a pattern rather than a
  175. ; literal. In patterns, some characters have special meanings:
  176. ;
  177. ; X - any digit from 0-9
  178. ; Z - any digit from 1-9
  179. ; N - any digit from 2-9
  180. ; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
  181. ; . - wildcard, matches anything remaining (e.g. _9011. matches
  182. ; anything starting with 9011 excluding 9011 itself)
  183. ; ! - wildcard, causes the matching process to complete as soon as
  184. ; it can unambiguously determine that no other matches are possible
  185. ;
  186. ; For example, the extension _NXXXXXX would match normal 7 digit dialings,
  187. ; while _1NXXNXXXXXX would represent an area code plus phone number
  188. ; preceded by a one.
  189. ;
  190. ; Each step of an extension is ordered by priority, which must always start
  191. ; with 1 to be considered a valid extension. The priority "next" or "n" means
  192. ; the previous priority plus one, regardless of whether the previous priority
  193. ; was associated with the current extension or not. The priority "same" or "s"
  194. ; means the same as the previously specified priority, again regardless of
  195. ; whether the previous entry was for the same extension. Priorities may be
  196. ; immediately followed by a plus sign and another integer to add that amount
  197. ; (most useful with 's' or 'n'). Priorities may then also have an alias, or
  198. ; label, in parentheses after their name which can be used in goto situations.
  199. ;
  200. ; Contexts contain several lines, one for each step of each extension. One may
  201. ; include another context in the current one as well, optionally with a date
  202. ; and time. Included contexts are included in the order they are listed.
  203. ; Switches may also be included within a context. The order of matching within
  204. ; a context is always exact extensions, pattern match extensions, includes, and
  205. ; switches. Includes are always processed depth-first. So for example, if you
  206. ; would like a switch "A" to match before context "B", simply put switch "A" in
  207. ; an included context "C", where "C" is included in your original context
  208. ; before "B".
  209. ;
  210. ;[context]
  211. ;exten => someexten,{priority|label{+|-}offset}[(alias)],application(arg1,arg2,...)
  212. ;
  213. ; Timing list for includes is
  214. ;
  215. ; <time range>,<days of week>,<days of month>,<months>[,<timezone>]
  216. ;
  217. ; Note that ranges may be specified to wrap around the ends. Also, minutes are
  218. ; fine-grained only down to the closest even minute.
  219. ;
  220. ;include => daytime,9:00-17:00,mon-fri,*,*
  221. ;include => weekend,*,sat-sun,*,*
  222. ;include => weeknights,17:02-8:58,mon-fri,*,*
  223. ;
  224. ; ignorepat can be used to instruct drivers to not cancel dialtone upon receipt
  225. ; of a particular pattern. The most commonly used example is of course '9'
  226. ; like this:
  227. ;
  228. ;ignorepat => 9
  229. ;
  230. ; so that dialtone remains even after dialing a 9. Please note that ignorepat
  231. ; only works with channels which receive dialtone from the PBX, such as DAHDI,
  232. ; Phone, and VPB. Other channels, such as SIP and MGCP, which generate their
  233. ; own dialtone and converse with the PBX only after a number is complete, are
  234. ; generally unaffected by ignorepat (unless DISA or another method is used to
  235. ; generate a dialtone after answering the channel).
  236. ;
  237.  
  238. ;
  239. ; Sample entries for extensions.conf
  240. ;
  241. ;
  242. [dundi-e164-canonical]
  243. ;include => stdexten
  244. ;
  245. ; List canonical entries here
  246. ;
  247. ;exten => 12564286000,1,Gosub(6000,stdexten(IAX2/foo))
  248. ;exten => 12564286000,n,Goto(default,s,1) ; exited Voicemail
  249. ;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7})
  250.  
  251. [dundi-e164-customers]
  252. ;
  253. ; If you are an ITSP or Reseller, list your customers here.
  254. ;
  255. ;exten => _12564286000,1,Dial(SIP/customer1)
  256. ;exten => _12564286001,1,Dial(IAX2/customer2)
  257.  
  258. [dundi-e164-via-pstn]
  259. ;
  260. ; If you are freely delivering calls to the PSTN, list them here
  261. ;
  262. ;exten => _1256428XXXX,1,Dial(DAHDI/G2/${EXTEN:7}) ; Expose all of 256-428
  263. ;exten => _1256325XXXX,1,Dial(DAHDI/G2/${EXTEN:7}) ; Ditto for 256-325
  264.  
  265. [dundi-e164-local]
  266. ;
  267. ; Context to put your dundi IAX2 or SIP user in for
  268. ; full access
  269. ;
  270. include => dundi-e164-canonical
  271. include => dundi-e164-customers
  272. include => dundi-e164-via-pstn
  273.  
  274. [dundi-e164-switch]
  275. ;
  276. ; Just a wrapper for the switch
  277. ;
  278. switch => DUNDi/e164
  279.  
  280. [dundi-e164-lookup]
  281. ;
  282. ; Locally to lookup, try looking for a local E.164 solution
  283. ; then try DUNDi if we don't have one.
  284. ;
  285. include => dundi-e164-local
  286. include => dundi-e164-switch
  287. ;
  288. ; DUNDi can also be implemented as a Macro instead of using
  289. ; the Local channel driver.
  290. ;
  291. [macro-dundi-e164]
  292. ;
  293. ; ARG1 is the extension to Dial
  294. ;
  295. ; Extension "s" is not a wildcard extension that matches "anything".
  296. ; In macros, it is the start extension. In most other cases,
  297. ; you have to goto "s" to execute that extension.
  298. ;
  299. ; Note: In old versions of Asterisk the PBX in some cases defaulted to
  300. ; extension "s" when a given extension was wrong (like in AMI originate).
  301. ; This is no longer the case.
  302. ;
  303. ; For wildcard matches, see above - all pattern matches start with
  304. ; an underscore.
  305. exten => s,1,Goto(${ARG1},1)
  306. include => dundi-e164-lookup
  307.  
  308. ;
  309. ; Here are the entries you need to participate in the IAXTEL
  310. ; call routing system. Most IAXTEL numbers begin with 1-700, but
  311. ; there are exceptions. For more information, and to sign
  312. ; up, please go to www.gnophone.com or www.iaxtel.com
  313. ;
  314. [iaxtel700]
  315. exten => _91700XXXXXXX,1,Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel)
  316.  
  317. ;
  318. ; The SWITCH statement permits a server to share the dialplan with
  319. ; another server. Use with care: Reciprocal switch statements are not
  320. ; allowed (e.g. both A -> B and B -> A), and the switched server needs
  321. ; to be on-line or else dialing can be severly delayed.
  322. ;
  323. [iaxprovider]
  324. ;switch => IAX2/user:[key]@myserver/mycontext
  325.  
  326. [trunkint]
  327. ;
  328. ; International long distance through trunk
  329. ;
  330. exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
  331. exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${FILTER(0-9,${EXTEN:${GLOBAL(TRUNKMSD)}})})
  332.  
  333. [trunkld]
  334. ;
  335. ; Long distance context accessed through trunk
  336. ;
  337. exten => _91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1})
  338. exten => _91NXXNXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  339.  
  340. [trunklocal]
  341. ;
  342. ; Local seven-digit dialing accessed through trunk interface
  343. ;
  344. exten => _9NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  345.  
  346. [trunktollfree]
  347. ;
  348. ; Long distance context accessed through trunk interface
  349. ;
  350. exten => _91800NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  351. exten => _91888NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  352. exten => _91877NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  353. exten => _91866NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  354.  
  355. [international]
  356. ;
  357. ; Master context for international long distance
  358. ;
  359. ignorepat => 9
  360. include => longdistance
  361. include => trunkint
  362.  
  363. [longdistance]
  364. ;
  365. ; Master context for long distance
  366. ;
  367. ignorepat => 9
  368. include => local
  369. include => trunkld
  370.  
  371. [local]
  372. ;
  373. ; Master context for local, toll-free, and iaxtel calls only
  374. ;
  375. ignorepat => 9
  376. include => default
  377. include => trunklocal
  378. include => iaxtel700
  379. include => trunktollfree
  380. include => iaxprovider
  381.  
  382. ;Include parkedcalls (or the context you define in features conf)
  383. ;to enable call parking.
  384. include => parkedcalls
  385. ;
  386. ; You can use an alternative switch type as well, to resolve
  387. ; extensions that are not known here, for example with remote
  388. ; IAX switching you transparently get access to the remote
  389. ; Asterisk PBX
  390. ;
  391. ; switch => IAX2/user:password@bigserver/local
  392. ;
  393. ; An "lswitch" is like a switch but is literal, in that
  394. ; variable substitution is not performed at load time
  395. ; but is passed to the switch directly (presumably to
  396. ; be substituted in the switch routine itself)
  397. ;
  398. ; lswitch => Loopback/12${EXTEN}@othercontext
  399. ;
  400. ; An "eswitch" is like a switch but the evaluation of
  401. ; variable substitution is performed at runtime before
  402. ; being passed to the switch routine.
  403. ;
  404. ; eswitch => IAX2/context@${CURSERVER}
  405.  
  406. ; The following two contexts are a template to enable the ability to dial
  407. ; ISN numbers. For more information about what an ISN number is, please see
  408. ; http://www.freenum.org.
  409. ;
  410. ; This is the dialing hook. use:
  411. ; include => outbound-freenum
  412.  
  413. [outbound-freenum]
  414. ; We'll add more digits as needed. The purpose is to dial things
  415. ; like extension numbers at domains (ITAD number) so we're matching
  416. ; on lengths of 1 through 6 prior to the separator (the asterisk [*])
  417. ;
  418. exten => _X*X!,1,Goto(outbound-freenum2,${EXTEN},1)
  419. exten => _XX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
  420. exten => _XXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
  421. exten => _XXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
  422. exten => _XXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
  423. exten => _XXXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
  424.  
  425. [outbound-freenum2]
  426. ; This is the handler which performs the dialing logic. It is called
  427. ; from the [outbound-freenum] context
  428. ;
  429. exten => _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN})
  430. same => n,Set(SUFFIX=${CUT(EXTEN,*,2-)}) ; make sure the suffix is all digits as well
  431. same => n,GotoIf($["${FILTER(0-9,${SUFFIX})}" != "${SUFFIX}"]?fn-CONGESTION,1)
  432. ; filter out bad characters per the README-SERIOUSLY.best-practices.txt document
  433. same => n,Set(TIMEOUT(absolute)=10800)
  434. same => n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)}) ; perform our lookup with freenum.org
  435. same => n,GotoIf($["${isnresult}" != ""]?from)
  436. same => n,Set(DIALSTATUS=CONGESTION)
  437. same => n,Goto(fn-CONGESTION,1)
  438. same => n(from),Set(__SIPFROMUSER=${CALLERID(num)})
  439. same => n,GotoIf($["${GLOBAL(FREENUMDOMAIN)}" = ""]?dial) ; check if we set the FREENUMDOMAIN global variable in [global]
  440. same => n,Set(__SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)}) ; if we did set it, then we'll use it for our outbound dialing domain
  441. same => n(dial),Dial(SIP/${isnresult},40)
  442. same => n,Goto(fn-${DIALSTATUS},1)
  443.  
  444. exten => fn-BUSY,1,Busy()
  445.  
  446. exten => _f[n]-.,1,NoOp(ISN: ${DIALSTATUS})
  447. same => n,Congestion()
  448.  
  449. [macro-trunkdial]
  450. ;
  451. ; Standard trunk dial macro (hangs up on a dialstatus that should
  452. ; terminate call)
  453. ; ${ARG1} - What to dial
  454. ;
  455. exten => s,1,Dial(${ARG1})
  456. exten => s,n,Goto(s-${DIALSTATUS},1)
  457. exten => s-NOANSWER,1,Hangup
  458. exten => s-BUSY,1,Hangup
  459. exten => _s-.,1,NoOp
  460.  
  461. [stdexten]
  462. ;
  463. ; Standard extension subroutine:
  464. ; ${EXTEN} - Extension
  465. ; ${ARG1} - Device(s) to ring
  466. ; ${ARG2} - Optional context in Voicemail
  467. ;
  468. ; Note that the current version will drop through to the next priority in the
  469. ; case of their pressing '#'. This gives more flexibility in what do to next:
  470. ; you can prompt for a new extension, or drop the call, or send them to a
  471. ; general delivery mailbox, or...
  472. ;
  473. ; The use of the LOCAL() function is purely for convenience. Any variable
  474. ; initially declared as LOCAL() will disappear when the innermost Gosub context
  475. ; in which it was declared returns. Note also that you can declare a LOCAL()
  476. ; variable on top of an existing variable, and its value will revert to its
  477. ; previous value (before being declared as LOCAL()) upon Return.
  478. ;
  479. exten => _X.,50000(stdexten),NoOp(Start stdexten)
  480. exten => _X.,n,Set(LOCAL(ext)=${EXTEN})
  481. exten => _X.,n,Set(LOCAL(dev)=${ARG1})
  482. exten => _X.,n,Set(LOCAL(cntx)=${ARG2})
  483. exten => _X.,n,Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})})
  484. exten => _X.,n,Dial(${dev},20) ; Ring the interface, 20 seconds maximum
  485. exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
  486.  
  487. exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce
  488. exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start
  489.  
  490. exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce
  491. exten => stdexten-BUSY,n,Return() ; If they press #, return to start
  492.  
  493. exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer
  494.  
  495. exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain
  496. exten => a,n,Return()
  497.  
  498. [stdPrivacyexten]
  499. ;
  500. ; Standard extension subroutine:
  501. ; ${ARG1} - Extension
  502. ; ${ARG2} - Device(s) to ring
  503. ; ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority)
  504. ; ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)`
  505. ; ${ARG5} - Context in voicemail (if empty, then "default")
  506. ;
  507. ; See above note in stdexten about priority handling on exit.
  508. ;
  509. exten => _X.,60000(stdPrivacyexten),NoOp(Start stdPrivacyexten)
  510. exten => _X.,n,Set(LOCAL(ext)=${ARG1})
  511. exten => _X.,n,Set(LOCAL(dev)=${ARG2})
  512. exten => _X.,n,Set(LOCAL(dontcntx)=${ARG3})
  513. exten => _X.,n,Set(LOCAL(tortcntx)=${ARG4})
  514. exten => _X.,n,Set(LOCAL(cntx)=${ARG5})
  515.  
  516. exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""])
  517. exten => _X.,n,Dial(${dev},20,p) ; Ring the interface, 20 seconds maximum, call screening
  518. ; option (or use P for databased call _X.creening)
  519. exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
  520.  
  521. exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce
  522. exten => stdexten-NOANSWER,n,NoOp(Finish stdPrivacyexten NOANSWER)
  523. exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start
  524.  
  525. exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce
  526. exten => stdexten-BUSY,n,NoOp(Finish stdPrivacyexten BUSY)
  527. exten => stdexten-BUSY,n,Return() ; If they press #, return to start
  528.  
  529. exten => stdexten-DONTCALL,1,Goto(${dontcntx},s,1) ; Callee chose to send this call to a polite "Don't call again" script.
  530.  
  531. exten => stdexten-TORTURE,1,Goto(${tortcntx},s,1) ; Callee chose to send this call to a telemarketer torture script.
  532.  
  533. exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer
  534.  
  535. exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain
  536. exten => a,n,Return
  537.  
  538. [macro-page];
  539. ;
  540. ; Paging macro:
  541. ;
  542. ; Check to see if SIP device is in use and DO NOT PAGE if they are
  543. ;
  544. ; ${ARG1} - Device to page
  545.  
  546. exten => s,1,ChanIsAvail(${ARG1},s) ; s is for ANY call
  547. exten => s,n,GoToIf($[${AVAILSTATUS} = "1"]?autoanswer:fail)
  548. exten => s,n(autoanswer),Set(_ALERT_INFO="RA") ; This is for the PolyComs
  549. exten => s,n,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others
  550. exten => s,n,NoOp() ; Add others here and Post on the Wiki!!!!
  551. exten => s,n,Dial(${ARG1})
  552. exten => s,n(fail),Hangup
  553.  
  554.  
  555. [demo]
  556. include => stdexten
  557. ;
  558. ; We start with what to do when a call first comes in.
  559. ;
  560. exten => s,1,Wait(1) ; Wait a second, just for fun
  561. exten => s,n,Answer ; Answer the line
  562. exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
  563. exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
  564. exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message
  565. exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions
  566. exten => s,n,WaitExten ; Wait for an extension to be dialed.
  567.  
  568. exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
  569. exten => 2,n,Goto(s,instruct)
  570.  
  571. exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
  572. exten => 3,n,Goto(s,restart) ; Start with the congratulations
  573.  
  574. exten => 1000,1,Goto(default,s,1)
  575. ;
  576. ; We also create an example user, 1234, who is on the console and has
  577. ; voicemail, etc.
  578. ;
  579. exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
  580. ; (but skip if channel is not up)
  581. exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}))
  582. exten => 1234,n,Goto(default,s,1) ; exited Voicemail
  583.  
  584. exten => 1235,1,Voicemail(1234,u) ; Right to voicemail
  585.  
  586. exten => 1236,1,Dial(Console/dsp) ; Ring forever
  587. exten => 1236,n,Voicemail(1234,b) ; Unless busy
  588.  
  589. ;
  590. ; # for when they're done with the demo
  591. ;
  592. exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
  593. exten => #,n,Hangup ; Hang them up.
  594.  
  595. ;
  596. ; A timeout and "invalid extension rule"
  597. ;
  598. exten => t,1,Goto(#,1) ; If they take too long, give up
  599. exten => i,1,Playback(invalid) ; "That's not valid, try again"
  600.  
  601. ;
  602. ; Create an extension, 500, for dialing the
  603. ; Asterisk demo.
  604. ;
  605. exten => 500,1,Playback(demo-abouttotry) ; Let them know what's going on
  606. exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo
  607. exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site
  608. exten => 500,n,Goto(s,6) ; Return to the start over message.
  609.  
  610. ;
  611. ; Create an extension, 600, for evaluating echo latency.
  612. ;
  613. exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
  614. exten => 600,n,Echo ; Do the echo test
  615. exten => 600,n,Playback(demo-echodone) ; Let them know it's over
  616. exten => 600,n,Goto(s,6) ; Start over
  617.  
  618. ;
  619. ; You can use the Macro Page to intercom a individual user
  620. exten => 76245,1,Macro(page,SIP/Grandstream1)
  621. ; or if your peernames are the same as extensions
  622. exten => _7XXX,1,Macro(page,SIP/${EXTEN})
  623. ;
  624. ;
  625. ; System Wide Page at extension 7999
  626. ;
  627. exten => 7999,1,Set(TIMEOUT(absolute)=60)
  628. exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
  629.  
  630. ; Give voicemail at extension 8500
  631. ;
  632. exten => 8500,1,VoicemailMain
  633. exten => 8500,n,Goto(s,6)
  634. ;
  635. ; Here's what a phone entry would look like (IXJ for example)
  636. ;
  637. ;exten => 1265,1,Dial(Phone/phone0,15)
  638. ;exten => 1265,n,Goto(s,5)
  639.  
  640. ;
  641. ; The page context calls up the page macro that sets variables needed for auto-answer
  642. ; It is in is own context to make calling it from the Page() application as simple as
  643. ; Local/{peername}@page
  644. ;
  645. [page]
  646. exten => _X.,1,Macro(page,SIP/${EXTEN})
  647.  
  648. ;[mainmenu]
  649. ;
  650. ; Example "main menu" context with submenu
  651. ;
  652. ;exten => s,1,Answer
  653. ;exten => s,n,Background(thanks) ; "Thanks for calling press 1 for sales, 2 for support, ..."
  654. ;exten => s,n,WaitExten
  655. ;exten => 1,1,Goto(submenu,s,1)
  656. ;exten => 2,1,Hangup
  657. ;include => default
  658. ;
  659. ;[submenu]
  660. ;exten => s,1,Ringing ; Make them comfortable with 2 seconds of ringback
  661. ;exten => s,n,Wait,2
  662. ;exten => s,n,Background(submenuopts) ; "Thanks for calling the sales department. Press 1 for steve, 2 for..."
  663. ;exten => s,n,WaitExten
  664. ;exten => 1,1,Goto(default,steve,1)
  665. ;exten => 2,1,Goto(default,mark,2)
  666.  
  667. [public]
  668. ;
  669. ; ATTENTION: If your Asterisk is connected to the internet and you do
  670. ; not have allowguest=no in sip.conf, everybody out there may use your
  671. ; public context without authentication. In that case you want to
  672. ; double check which services you offer to the world.
  673. ;
  674. include => demo
  675.  
  676. [default]
  677. ;include = demo ; This line was commented by ASTERISK GUI
  678.  
  679. ;
  680. ; An extension like the one below can be used for FWD, Nikotel, sipgate etc.
  681. ; Note that you must have a [sipprovider] section in sip.conf
  682. ;
  683. ;exten => _41X.,1,Dial(SIP/${FILTER(0-9,${EXTEN:2})}@sipprovider,,r)
  684.  
  685. ; Real extensions would go here. Generally you want real extensions to be
  686. ; 4 or 5 digits long (although there is no such requirement) and start with a
  687. ; single digit that is fairly large (like 6 or 7) so that you have plenty of
  688. ; room to overlap extensions and menu options without conflict. You can alias
  689. ; them with names, too, and use global variables
  690.  
  691. ;exten => 6245,hint,SIP/Grandstream1&SIP/Xlite1(Joe Schmoe) ; Channel hints for presence
  692. ;exten => 6245,1,Dial(SIP/Grandstream1,20,rt) ; permit transfer
  693. ;exten => 6245,n(dial),Dial(${HINT},20,rtT) ; Use hint as listed
  694. ;exten => 6245,n,Voicemail(6245,u) ; Voicemail (unavailable)
  695. ;exten => 6245,s+1,Hangup ; s+1, same as n
  696. ;exten => 6245,dial+101,Voicemail(6245,b) ; Voicemail (busy)
  697. ;exten => 6361,1,Dial(IAX2/JaneDoe,,rm) ; ring without time limit
  698. ;exten => 6389,1,Dial(MGCP/aaln/1@192.168.0.14)
  699. ;exten => 6390,1,Dial(JINGLE/caller/callee) ; Dial via jingle using labels
  700. ;exten => 6391,1,Dial(JINGLE/asterisk@digium.com/mogorman@astjab.org) ;Dial via jingle using asterisk as the transport and calling mogorman.
  701. ;exten => 6394,1,Dial(Local/6275/n) ; this will dial ${MARK}
  702.  
  703. ;exten => 6275,1,Gosub(${EXTEN},stdexten(${MARK}))
  704. ; assuming ${MARK} is something like DAHDI/2
  705. ;exten => 6275,n,Goto(default,s,1) ; exited Voicemail
  706. ;exten => mark,1,Goto(6275,1) ; alias mark to 6275
  707. ;exten => 6536,1,Gosub(${EXTEN},stdexten(${WIL}))
  708. ; Ditto for wil
  709. ;exten => 6536,n,Goto(default,s,1) ; exited Voicemail
  710. ;exten => wil,1,Goto(6236,1)
  711.  
  712. ;If you want to subscribe to the status of a parking space, this is
  713. ;how you do it. Subscribe to extension 6600 in sip, and you will see
  714. ;the status of the first parking lot with this extensions' help
  715. ;exten => 6600,hint,park:701@parkedcalls
  716. ;exten => 6600,1,noop
  717. ;
  718. ; You can also monitor the status of a queue by providing a hint for a
  719. ; particular queue name.
  720. ;exten => 8502,hint,Queue:markq
  721. ;exten => 8502,1,Queue(markq)
  722. ;
  723.  
  724. ;To subscribe to the availability of a free member in the 'markq' queue.
  725. ;Note: '_avail' is added to the QueueName
  726. ;exten => 8501,hint,Queue:markq_avail
  727. ;exten => 8501,1,Queue(markq)
  728.  
  729. ; Some other handy things are an extension for checking voicemail via
  730. ; voicemailmain
  731. ;
  732. ;exten => 8500,1,VoicemailMain
  733. ;exten => 8500,n,Hangup
  734. ;
  735. ; Or a conference room (you'll need to edit meetme.conf to enable this room)
  736. ;
  737. ;exten => 8600,1,Meetme(1234)
  738. ;
  739. ; Or playing an announcement to the called party, as soon it answers
  740. ;
  741. ;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg))
  742. ;
  743.  
  744. ; example of a compartmentalized company called "acme"
  745. ;
  746. ; this is the context that your incoming IAX/SIP trunk dumps you in...
  747. ;[acme-incoming]
  748. ;exten => s,1,Wait(1)
  749. ;exten => s,n,Answer()
  750. ;exten => s,n(menu),Playback(acme/vm-brief-menu)
  751. ;exten => s,n(exten),Background(vm-enter-num-to-call)
  752. ;exten => s,n,WaitExten(5)
  753. ;exten => s,n(goodbye),Playback(vm-goodbye)
  754. ;exten => s,n(end),Hangup()
  755. ;
  756. ;include => acme-extens
  757. ;
  758. ;exten => i,1,Playback(vm-invalid)
  759. ;exten => i,n,Goto(s,exten) ; optionally, transfer to operator
  760. ;
  761. ;exten => t,1,Goto(s,goodbye)
  762. ;
  763. ; this is the context our internal SIP hardphones use (see sip.conf)
  764. ;
  765. ;[acme-internal]
  766. ;exten => s,1,Answer()
  767. ;exten => s,n(exten),Background(vm-enter-num-to-call)
  768. ;exten => s,n,WaitExten(5)
  769. ;exten => s,n(goodbye),Playback(vm-goodbye)
  770. ;exten => s,n(end),Hangup()
  771. ;
  772. ;include => trunkint
  773. ;include => trunkld
  774. ;include => trunklocal
  775. ;
  776. ;include => acme-extens
  777. ;
  778. ; you can test what your system sounds like to outside callers by dialing this
  779. ;exten => 777,1,DISA(no-password,acme-incoming)
  780. ;
  781. ; grouping of acme's extensions... never used directly, always included.
  782. ;
  783. ;[acme-extens]
  784. ;include => stdexten
  785. ;exten => 111,1,Gosub(111,stdexten(SIP/pete_1,acme))
  786. ;exten => 111,n,Goto(s,exten)
  787. ;
  788. ;exten => 112,1,Gosub(112,stdexten(SIP/nancy_1,acme))
  789. ;exten => 112,n,Goto(s,end)
  790. ;
  791. ; end of acme example
  792.  
  793. ;
  794. ; Time context: you can patch this in via the following.
  795. ;
  796. ; [acme-internal]
  797. ; ...
  798. ; exten => 777,1,Gosub(time)
  799. ; exten => 777,n,Hangup()
  800. ;
  801. ; ...
  802. ; include => time
  803. ;
  804. ; Note: if you're geographically spread out, you can have SIP extensions
  805. ; specify their own local timezone in sip.conf as:
  806. ;
  807. ; [boi]
  808. ; type=friend
  809. ; context=acme-internal
  810. ; callerid="Boise Ofc. <2083451111>"
  811. ; ...
  812. ; ; use system-wide default timezone of MST7MDT
  813. ;
  814. ; [lws]
  815. ; type=friend
  816. ; context=acme-internal
  817. ; callerid="Lewiston Ofc. <2087431111>"
  818. ; ...
  819. ; setvar=timezone=PST8PDT
  820. ;
  821. ; "timezone" isn't a 'reserved' name in any way, and other places where
  822. ; the timezone is significant (e.g. calls to "SayUnixTime()", etc) will
  823. ; require modification as well. Note that voicemail.conf already has
  824. ; a mechanism for timezones.
  825. ;
  826.  
  827. [time]
  828. exten => _X.,30000(time),NoOp(Time: ${EXTEN} ${timezone})
  829. exten => _X.,n,Wait(0.25)
  830. exten => _X.,n,Answer()
  831. ; the amount of delay is set for English; you may need to adjust this time
  832. ; for other languages if there's no pause before the synchronizing beep.
  833. exten => _X.,n,Set(FUTURETIME=$[${EPOCH} + 12])
  834. exten => _X.,n,SayUnixTime(${FUTURETIME},Zulu,HNS)
  835. exten => _X.,n,SayPhonetic(z)
  836. ; use the timezone associated with the extension (sip only), or system-wide
  837. ; default if one hasn't been set.
  838. exten => _X.,n,SayUnixTime(${FUTURETIME},${timezone},HNS)
  839. exten => _X.,n,Playback(spy-local)
  840. exten => _X.,n,WaitUntil(${FUTURETIME})
  841. exten => _X.,n,Playback(beep)
  842. exten => _X.,n,Return()
  843.  
  844. ;
  845. ; ANI context: use in the same way as "time" above
  846. ;
  847.  
  848. [ani]
  849. exten => _X.,40000(ani),NoOp(ANI: ${EXTEN})
  850. exten => _X.,n,Wait(0.25)
  851. exten => _X.,n,Answer()
  852. exten => _X.,n,Playback(vm-from)
  853. exten => _X.,n,SayDigits(${CALLERID(ani)})
  854. exten => _X.,n,Wait(1.25)
  855. exten => _X.,n,SayDigits(${CALLERID(ani)}) ; playback again in case of missed digit
  856. exten => _X.,n,Return()
  857. ; For more information on applications, just type "core show applications" at your
  858. ; friendly Asterisk CLI prompt.
  859. ;
  860. ; "core show application <command>" will show details of how you
  861. ; use that particular application in this file, the dial plan.
  862. ; "core show functions" will list all dialplan functions
  863. ; "core show function <COMMAND>" will show you more information about
  864. ; one function. Remember that function names are UPPER CASE.
  865. [macro-stdexten]
  866. exten = s,1,Set(__DYNAMIC_FEATURES=${FEATURES})
  867. exten = s,2,Set(ORIG_ARG1=${ARG1})
  868. exten = s,3,GotoIf($["${FOLLOWME_${ARG1}}" = "1"]?6:4)
  869. exten = s,4,Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
  870. exten = s,5,Goto(s-${DIALSTATUS},1)
  871. exten = s,6,Macro(stdexten-followme,${ARG1},${ARG2})
  872. exten = s-NOANSWER,1,Voicemail(${ORIG_ARG1},u)
  873. exten = s-NOANSWER,2,Goto(default,s,1)
  874. exten = s-BUSY,1,Voicemail(${ORIG_ARG1},b)
  875. exten = s-BUSY,2,Goto(default,s,1)
  876. exten = _s-.,1,Goto(s-NOANSWER,1)
  877. exten = a,1,VoicemailMain(${ORIG_ARG1})
  878. [macro-stdexten-followme]
  879. exten = s,1,Answer
  880. exten = s,2,Set(ORIG_ARG1=${ARG1})
  881. exten = s,3,Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
  882. exten = s,4,Set(__FMCIDNUM=${CALLERID(num)})
  883. exten = s,5,Set(__FMCIDNAME=${CALLERID(name)})
  884. exten = s,6,Followme(${ORIG_ARG1},${FOLLOWMEOPTIONS})
  885. exten = s,7,Voicemail(${ORIG_ARG1},u)
  886. exten = s-NOANSWER,1,Voicemail(${ORIG_ARG1},u)
  887. exten = s-BUSY,1,Voicemail(${ORIG_ARG1},b)
  888. exten = s-BUSY,2,Goto(default,s,1)
  889. exten = _s-.,1,Goto(s-NOANSWER,1)
  890. exten = a,1,VoicemailMain(${ORIG_ARG1})
  891. [macro-pagingintercom]
  892. exten = s,1,SIPAddHeader(Alert-Info: ${PAGING_HEADER})
  893. exten = s,2,Page(${ARG1},${ARG2})
  894. exten = s,3,Hangup
  895. [conferences]
  896. [ringgroups]
  897. [queues]
  898. [voicemenus]
  899. [voicemailgroups]
  900. [directory]
  901. [page_an_extension]
  902. [pagegroups]
  903. [asterisk_guitools]
  904. exten = executecommand,1,System(${command})
  905. exten = executecommand,n,Hangup()
  906. exten = record_vmenu,1,Answer
  907. exten = record_vmenu,n,Playback(vm-intro)
  908. exten = record_vmenu,n,Record(${var1},0,500,k)
  909. exten = record_vmenu,n,Playback(vm-saved)
  910. exten = record_vmenu,n,Playback(vm-goodbye)
  911. exten = record_vmenu,n,Hangup
  912. exten = play_file,1,Answer
  913. exten = play_file,n,Playback(${var1})
  914. exten = play_file,n,Hangup
  915. [macro-local-callingrule-cid-0.1]
  916. exten = s,1,Set(CALLERID(all)=${IF($[${LEN(${ARG4})} > 2]?${ARG4}:)})
  917. exten = s,n,Goto(${ARG1},${ARG2},${ARG3})
  918. [macro-trunkdial-failover-0.3]
  919. exten = s,1,GotoIf($[${LEN(${FMCIDNUM})} > 6]?1-fmsetcid,1)
  920. exten = s,n,GotoIf($[${LEN(${GLOBAL_OUTBOUNDCIDNAME})} > 1]?1-setgbobname,1)
  921. exten = s,n,Set(CALLERID(num)=${IF($[${LEN(${CID_${CALLERID(num)}})} > 2]?${CID_${CALLERID(num)}}:)})
  922. exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}:)})
  923. exten = s,n,GotoIf($[${LEN(${CALLERID(num)})} > 6]?1-dial,1)
  924. exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${CID_${ARG3}})} > 6]?${CID_${ARG3}}:${GLOBAL_OUTBOUNDCID})})
  925. exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}:)})
  926. exten = s,n,Goto(1-dial,1)
  927. exten = 1-setgbobname,1,Set(CALLERID(name)=${GLOBAL_OUTBOUNDCIDNAME})
  928. exten = 1-setgbobname,n,Goto(s,3)
  929. exten = 1-fmsetcid,1,Set(CALLERID(num)=${FMCIDNUM})
  930. exten = 1-fmsetcid,n,Set(CALLERID(name)=${FMCIDNAME})
  931. exten = 1-fmsetcid,n,Goto(s,4)
  932. exten = 1-dial,1,Dial(${ARG1})
  933. exten = 1-dial,n,Gotoif(${LEN(${ARG2})} > 0 ?1-${DIALSTATUS},1:1-out,1)
  934. exten = 1-CHANUNAVAIL,1,Dial(${ARG2})
  935. exten = 1-CHANUNAVAIL,n,Hangup()
  936. exten = 1-CONGESTION,1,Dial(${ARG2})
  937. exten = 1-CONGESTION,n,Hangup()
  938. exten = 1-out,1,Hangup()
  939. [queue-member-manager]
  940. exten = handle_member,1,Verbose(2, Looping through queues to log in or out queue members)
  941. exten = handle_member,n,Set(thisActiveMember=${CHANNEL(channeltype)}/${CHANNEL(peername)})
  942. exten = handle_member,n,Set(queue_field=2)
  943. exten = handle_member,n,Set(thisQueueXtn=${CUT(QUEUES,\,,${queue_field})})
  944. exten = handle_member,n,While($[${EXISTS(${thisQueueXtn})}])
  945. exten = handle_member,n,Macro(member-loginlogout)
  946. exten = handle_member,n,Set(queue_field=$[${queue_field} + 1])
  947. exten = handle_member,n,Set(thisQueueXtn=${CUT(QUEUES,\,,${queue_field})})
  948. exten = handle_member,n,EndWhile()
  949. [macro-member-loginlogout]
  950. exten = s,1,Verbose(2, Logging queue member in or out of the request queue)
  951. exten = s,n,Set(thisQueue=${thisQueueXtn})
  952. exten = s,n,Set(queueMembers=${QUEUE_MEMBER_LIST(${thisQueue})})
  953. exten = s,n,Set(field=1)
  954. exten = s,n,Set(logged_in=0)
  955. exten = s,n,Set(thisQueueMember=${CUT(queueMembers,\,,${field})})
  956. exten = s,n,While($[${EXISTS(${thisQueueMember})}])
  957. exten = s,n,GotoIf($["${thisQueueMember}" != "${thisActiveMember}"]?check_next)
  958. exten = s,n,Set(logged_in=1)
  959. exten = s,n,ExitWhile()
  960. exten = s,n(check_next),Set(field=$[${field} + 1])
  961. exten = s,n,Set(thisQueueMember=${CUT(queueMembers,\,,${field})})
  962. exten = s,n,EndWhile()
  963. exten = s,n,MacroIf($[${logged_in} = 0]?q_login:q_logout)
  964. [macro-q_login]
  965. exten = s,1,Verbose(2, Logging ${thisActiveMember} into the ${thisQueue} queue)
  966. exten = s,n,AddQueueMember(${thisQueue},${thisActiveMember})
  967. exten = s,n,Playback(silence/1)
  968. exten = s,n,ExecIf($["${AQMSTATUS}" = "ADDED"]?Playback(agent-loginok):Playback(an-error-has-occurred))
  969. [macro-q_logout]
  970. exten = s,1,Verbose(2, Logged ${thisActiveMember} out of ${thisQueue} queue)
  971. exten = s,n,RemoveQueueMember(${thisQueue},${thisActiveMember})
  972. exten = s,n,Playback(silence/1)
  973. exten = s,n,ExecIf($["${RQMSTATUS}" = "REMOVED"]?Playback(agent-loggedoff):Playback(an-error-has-occurred))
  974. [CallingRule_Longdistance]
  975. exten = _91XXXXXXXXXX!,1,Macro(trunkdial-failover-0.3,${}/${FILTER(0123456789,${EXTEN:1})}, , , )
  976. [CallingRule_IAXTEL]
  977. exten = _91700XXXXXXX!,1,Macro(trunkdial-failover-0.3,${}/${FILTER(0123456789,${EXTEN:1})}, , , )
  978. [CallingRule_Local_AreaCode]
  979. exten = _9256XXXXXXX!,1,Macro(trunkdial-failover-0.3,${}/${FILTER(0123456789,${EXTEN:4})}, , , )
  980. [CallingRule_International]
  981. exten = _9011XXXXX.,1,Macro(trunkdial-failover-0.3,${}/${FILTER(0123456789,${EXTEN:1})}, , , )
  982. [CallingRule_Local_7_digits]
  983. exten = _9XXXXXXX!,1,Macro(trunkdial-failover-0.3,${}/${FILTER(0123456789,${EXTEN:1})}, , , )
  984. [CallingRule_Emergency]
  985. exten = _911!,1,Macro(trunkdial-failover-0.3,${}/${FILTER(0123456789,${EXTEN:1})}, , , )
  986. [DLPN_DialPlan1]
  987. include = default
  988. include = parkedcalls
  989. include = conferences
  990. include = ringgroups
  991. include = voicemenus
  992. include = queues
  993. include = voicemailgroups
  994. include = directory
  995. include = pagegroups
  996. include = page_an_extension
  997. ;
  998. [astsms]
  999. exten => _.,1,NoOp(SMS receiving dialplan invoked)
  1000. exten => _.,n,NoOp(To ${MESSAGE(to)})
  1001. exten => _.,n,NoOp(From ${MESSAGE(from)})
  1002. exten => _.,n,NoOp(Body ${MESSAGE(body)})
  1003. exten => _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
  1004. exten => _.,n,MessageSend(${ACTUALTO},${MESSAGE(from)})
  1005. exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
  1006. exten => _.,n,GotoIf($["${MESSAGE_SEND_STATUS}" != "SUCCESS"]?sendfailedmsg)
  1007. exten => _.,n,Hangup()
  1008. ;
  1009. ; Handle failed messaging
  1010. exten => _.,n(sendfailedmsg),Set(MESSAGE(body)="[${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}] Your message to ${EXTEN} has failed. Retry later.")
  1011. exten => _.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)})
  1012. exten => _.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
  1013. exten => _.,n,MessageSend(${ACTUALFROM},ServiceCenter)
  1014. exten => _.,n,Hangup()
  1015. exten => _.,n,Hangup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement