Advertisement
mrtain

extensions.conf 6/09/12

Sep 6th, 2012
177
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;--------------------------------------------------------------------------------;
  2. ; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
  3. ; this file must be done via the web gui. There are alternative files to make ;
  4. ; custom modifications, details at: http://freepbx.org/configuration_files ;
  5. ;--------------------------------------------------------------------------------;
  6. ;
  7. ; This file is part of FreePBX.
  8. ;
  9. ; FreePBX is free software: you can redistribute it and/or modify
  10. ; it under the terms of the GNU General Public License as published by
  11. ; the Free Software Foundation, either version 2 of the License, or
  12. ; (at your option) any later version.
  13. ;
  14. ; FreePBX is distributed in the hope that it will be useful,
  15. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. ; GNU General Public License for more details.
  18. ;
  19. ; You should have received a copy of the GNU General Public License
  20. ; along with FreePBX. If not, see <http://www.gnu.org/licenses/>.
  21. ;
  22. ; Copyright (C) 2004 Coalescent Systems Inc (Canada)
  23. ; Copyright (C) 2006 Why Pay More 4 Less Pty Ltd (Australia)
  24. ; Copyright (C) 2007 Astrogen LLC (USA)
  25. ;--------------------------------------------------------------------------------;
  26.  
  27.  
  28. ;*******************************************************************************
  29. ; AUTO-GENERATED AND CUSOTM USER DIALPLAN INCLUDED HERE *
  30. ;*******************************************************************************
  31. ;
  32.  
  33.  
  34. ;--------------------------------------------------------------------------------;
  35. ; Customizations to this dialplan should be made in extensions_custom.conf
  36. ; See extensions_custom.conf.sample for an example.
  37. ;
  38. ; If you need to use [macro-dialout-trunk-predial-hook], [ext-did-custom], or
  39. ; [from-internal-custom] for example, place these in this file or they will get overwritten.
  40. ;
  41. ; WARNING ABOUT: #include extensions_override_freepbx.conf
  42. ;
  43. ; This include file is put first to allow the auto-generated dialplan in FreePBX
  44. ; to be overwritten if necessary. Overriding auto-generated dialplan should be done
  45. ; with extreme caution. In almost all cases any custom dialplan SHOULD be put in
  46. ; extensions_custom.conf which will not hurt a FreePBX generated dialplan. In some
  47. ; very rare and custom situations users may have a need to override what FreePBX
  48. ; automatically generates. If so anything in this file will do that. If you come up
  49. ; with situations where you need to modify the existing dialplan or macros, put it
  50. ; here.
  51. ;
  52. #include extensions_override_freepbx.conf
  53. #include extensions_additional.conf
  54. #include extensions_custom.conf
  55. ;--------------------------------------------------------------------------------;
  56.  
  57.  
  58.  
  59. ;*******************************************************************************
  60. ; DIALPLAN OPEN TO THE PUBLIC, USING INBOUND DIDS AND SIMILAR *
  61. ;*******************************************************************************
  62. ;
  63.  
  64. ;-------------------------------------------------------------------------------
  65. ; from-digital:
  66. ;
  67. ; Context to set for PRI's and equivalent
  68. ;
  69. [from-digital]
  70. include => from-pstn
  71. ;-------------------------------------------------------------------------------
  72.  
  73. ;-------------------------------------------------------------------------------
  74. ; from-analog:
  75. ;
  76. ; Context to set for analog DAHDi cards and equivalent
  77. ;
  78. [from-analog]
  79. include => from-dahdi
  80. ;-------------------------------------------------------------------------------
  81.  
  82. ;-------------------------------------------------------------------------------
  83. ; from-trunk:
  84. ;
  85. ; Context is really just an aliax of from-pstn
  86. ;
  87. [from-trunk]
  88. include => from-pstn
  89. ;-------------------------------------------------------------------------------
  90.  
  91. ;-------------------------------------------------------------------------------
  92. ; from-pstn:
  93. ;
  94. ; Entry context for calls from the outside world to hit FreePBX
  95. [from-pstn]
  96. include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
  97. include => ext-did
  98. include => ext-did-post-custom
  99. include => from-did-direct
  100. include => ext-did-catchall ; THIS MUST COME AFTER ext-did
  101. ;-------------------------------------------------------------------------------
  102.  
  103. ;-------------------------------------------------------------------------------
  104. ; from-pstn-e164-us:
  105. ;
  106. ; The context is designed for providers who send calls in e164 format and is
  107. ; biased towards NPA calls, callerid and dialing rules. It will do the following:
  108. ;
  109. ; DIDs in an NPA e164 format of +1NXXNXXXXXX will be converted to 10 digit DIDs
  110. ;
  111. ; DIDs in any other format will be delivered as they are, including e164 non NPA
  112. ; DIDs which means they will need the full format including the + in the inbound
  113. ; route.
  114. ;
  115. ; CallerID(number) presented in e164 NPA format will be trimmed to a 10 digit CID
  116. ;
  117. ; CallerID(number) presented in e164 non-NPA (country code other than 1) will be
  118. ; reformated from: +<CountryCode><Number> to 011<CountryCode><Number>
  119. ;
  120. [from-pstn-e164-us]
  121. exten => _+1NXXNXXXXXX/_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
  122. exten => _+1NXXNXXXXXX/_NXXNXXXXXX,2,Goto(from-pstn,${EXTEN:2},1)
  123. exten => _+1NXXNXXXXXX/_+X.,1,Set(CALLERID(number)=011${CALLERID(number):1})
  124. exten => _+1NXXNXXXXXX/_011X.,n,Goto(from-pstn,${EXTEN:2},1)
  125. exten => _+1NXXNXXXXXX,1,Goto(from-pstn,${EXTEN:2},1)
  126. exten => _[0-9+]./_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
  127. exten => _[0-9+]./_NXXNXXXXXX,n,Goto(from-pstn,${EXTEN},1)
  128. exten => _[0-9+]./_+X.,1,Set(CALLERID(number)=011${CALLERID(number):1})
  129. exten => _[0-9+]./_011X.,n,Goto(from-pstn,${EXTEN},1)
  130. exten => _[0-9+].,1,Goto(from-pstn,${EXTEN},1)
  131. exten => s/_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
  132. exten => s/_NXXNXXXXXX,n,Goto(from-pstn,${EXTEN},1)
  133. exten => s/_+X.,1,Set(CALLERID(number)=011${CALLERID(number):1})
  134. exten => s/_011X.,n,Goto(from-pstn,${EXTEN},1)
  135. exten => s,1,Goto(from-pstn,${EXTEN},1)
  136. ;-------------------------------------------------------------------------------
  137.  
  138. ;-------------------------------------------------------------------------------
  139. ; from-pstn-to-did:
  140. ;
  141. ; The context is designed for providers who send the DID in the TO: SIP header
  142. ; only. The format of this header is:
  143. ;
  144. ; To: <sip:2125551212@172.31.74.25>
  145. ;
  146. ; So the DID must be extracted between the sip: and the @, which this does
  147. ;
  148. [from-pstn-toheader]
  149. exten => _.,1,Goto(from-pstn,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)
  150. ;-------------------------------------------------------------------------------
  151.  
  152. ;-------------------------------------------------------------------------------
  153. ; from-sip-external
  154. ;
  155. ; This context is the default SIP context unless otherwise changed in the SIP
  156. ; Settings module or other sip configuration locations. This context is hit by
  157. ; either anonymous SIP calls or mis-configured SIP trunks when the incoming call
  158. ; can not be matched with a SIP section.
  159. ;
  160. [from-sip-external]
  161. exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})
  162. exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
  163. exten => _.,n,Goto(s,1)
  164. exten => s,1,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?checklang:noanonymous)
  165. exten => s,n(checklang),GotoIf($["${SIPLANG}"!=""]?setlanguage:from-trunk,${DID},1)
  166. exten => s,n(setlanguage),Set(CHANNEL(language)=${SIPLANG})
  167. exten => s,n,Goto(from-trunk,${DID},1)
  168. exten => s,n(noanonymous),Set(TIMEOUT(absolute)=15)
  169. exten => s,n,Answer
  170. exten => s,n,Wait(2)
  171. exten => s,n,Playback(ss-noservice)
  172. exten => s,n,Playtones(congestion)
  173. exten => s,n,Congestion(5)
  174. exten => h,1,Hangup
  175. exten => i,1,Hangup
  176. exten => t,1,Hangup
  177. ;-------------------------------------------------------------------------------
  178.  
  179.  
  180.  
  181. ;*******************************************************************************
  182. ; INTERNAL DIALPLAN, NOT OPEN TO THE PUBLIC WORLD *
  183. ;*******************************************************************************
  184. ;
  185.  
  186. ;-------------------------------------------------------------------------------
  187. ; from-internal:
  188. ;
  189. ; Internal dialplan that most internal phones have access to
  190. ;
  191. [from-internal]
  192. include => from-internal-noxfer
  193. include => from-internal-xfer
  194. include => bad-number ; auto-generated
  195. ;-------------------------------------------------------------------------------
  196.  
  197. ;-------------------------------------------------------------------------------
  198. ; from-internal-noxfer:
  199. ;
  200. ; Place to put internal dialplan that should not be accessible during a blind
  201. ; transfer, this context will not be visible during such.
  202. ;
  203. [from-internal-noxfer]
  204. include => from-internal-noxfer-custom
  205. include => from-internal-noxfer-additional ; auto-generated
  206. ;-------------------------------------------------------------------------------
  207.  
  208. ;-------------------------------------------------------------------------------
  209. ; from-internal-xfer:
  210. ;
  211. ; Place to put most internal dialplan, will be visible during normal calls and
  212. ; blind transfers.
  213. ;
  214. [from-internal-xfer]
  215. include => from-internal-custom
  216. include => from-internal-additional ; auto-generated
  217. exten => s,1,Macro(hangupcall)
  218. exten => h,1,Macro(hangupcall)
  219. ;-------------------------------------------------------------------------------
  220.  
  221.  
  222.  
  223. ;*******************************************************************************
  224. ; INTERNAL MACROS & SPECIAL CONTEXTS *
  225. ;*******************************************************************************
  226. ;
  227.  
  228. ;-------------------------------------------------------------------------------
  229. ; from-did-direct:
  230. ;
  231. ; forces ext-findmefollow to take precedence over ext-local. Also exposed to
  232. ; the public side to allow an extension number to be used as an external DID
  233. ; without requiring inbound routes to be created, common in many PRI installations
  234. ; where the last 4 digits are used as the extnension and DIDs are delivered in
  235. ; 4 digit formats.
  236. ;
  237. [from-did-direct]
  238. include => ext-findmefollow
  239. include => ext-local
  240. ;-------------------------------------------------------------------------------
  241.  
  242. ;-------------------------------------------------------------------------------
  243. ; macro-dial:
  244. ;
  245. ; Rings one or more extensions. Handles things like call forwarding and DND
  246. ; We don't call dial directly for anything internal anymore.
  247. ; ARGS: $TIMER, $OPTIONS, $EXT1, $EXT2, $EXT3, ...
  248. ; Use a Macro call such as the following:
  249. ;
  250. ; Macro(dial,$DIAL_TIMER,$DIAL_OPTIONS,$EXT1,$EXT2,$EXT3,...)
  251. ;
  252. [macro-dial]
  253. exten => s,1,GotoIf($["${MOHCLASS}" = ""]?dial)
  254. exten => s,n,SetMusicOnHold(${MOHCLASS})
  255. exten => s,n(dial),AGI(dialparties.agi)
  256. exten => s,n,NoOp(Returned from dialparties with no extensions to call and DIALSTATUS: ${DIALSTATUS})
  257.  
  258. exten => s,n+2(normdial),Dial(${ds}) ; dialparties will set the priority to 10 if $ds is not null
  259. exten => s,n,Set(DIALSTATUS=${IF($["${DIALSTATUS_CW}"!="" ]?${DIALSTATUS_CW}:${DIALSTATUS})})
  260. exten => s,n,GosubIf($[("${SCREEN}" != "" & ("${DIALSTATUS}" = "TORTURE" | "${DIALSTATUS}" = "DONTCALL")) | "${DIALSTATUS}" = "ANSWER"]?${DIALSTATUS},1)
  261.  
  262. exten => s,20(huntdial),NoOp(Returned from dialparties with hunt groups to dial )
  263. exten => s,n,Set(HuntLoop=0)
  264. exten => s,n(a22),GotoIf($[${HuntMembers} >= 1]?a30) ; if this is from rg-group, don't strip prefix
  265. exten => s,n,NoOp(Returning there are no members left in the hunt group to ring)
  266.  
  267. ; dialparties.agi has setup the dialstring for each hunt member in a variable labeled HuntMember0, HuntMember1 etc for each iteration
  268. ; and The total number in HuntMembers. So for each iteration, we will update the CALLTRACE Data.
  269. ;
  270. exten => s,n+2(a30),Set(HuntMember=HuntMember${HuntLoop})
  271. exten => s,n,GotoIf($[$["${CALLTRACE_HUNT}" != "" ] & $[$["${RingGroupMethod}" = "hunt" ] | $["${RingGroupMethod}" = "firstavailable"] | $["${RingGroupMethod}" = "firstnotonphone"]]]?a32:a35)
  272.  
  273. exten => s,n(a32),Set(CT_EXTEN=${CUT(FILTERED_DIAL,,$[${HuntLoop} + 1])})
  274. exten => s,n,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
  275. exten => s,n,Goto(s,a42)
  276.  
  277. ;Set Call Trace for each hunt member we are going to call "Memory groups have multiple members to set CALL TRACE For" hence the loop
  278. ;
  279. exten => s,n(a35),GotoIf($[$["${CALLTRACE_HUNT}" != "" ] & $["${RingGroupMethod}" = "memoryhunt" ]]?a36:a50)
  280. exten => s,n(a36),Set(CTLoop=0)
  281. exten => s,n(a37),GotoIf($[${CTLoop} > ${HuntLoop}]?a42) ; if this is from rg-group, don't strip prefix
  282. exten => s,n,Set(CT_EXTEN=${CUT(FILTERED_DIAL,,$[${CTLoop} + 1])})
  283. exten => s,n,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
  284. exten => s,n,Set(CTLoop=$[1 + ${CTLoop}])
  285. exten => s,n,Goto(s,a37)
  286.  
  287. exten => s,n(a42),Dial(${${HuntMember}}${ds})
  288. exten => s,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?ANSWER,1)
  289. exten => s,n,Set(HuntLoop=$[1 + ${HuntLoop}])
  290. exten => s,n,GotoIf($[$[$["foo${RingGroupMethod}" != "foofirstavailable"] & $["foo${RingGroupMethod}" != "foofirstnotonphone"]] | $["foo${DialStatus}" = "fooBUSY"]]?a46)
  291. exten => s,n,Set(HuntMembers=0)
  292. exten => s,n(a46),Set(HuntMembers=$[${HuntMembers} - 1])
  293. exten => s,n,Goto(s,a22)
  294.  
  295. exten => s,n(a50),DBdel(CALLTRACE/${CT_EXTEN})
  296. exten => s,n,Goto(s,a42)
  297.  
  298. ; For call screening
  299. exten => NOANSWER,1,Macro(vm,${SCREEN_EXTEN},BUSY,${IVR_RETVM})
  300. exten => NOANSWER,n,GotoIf($["${IVR_RETVM}" != "RETURN" | "${IVR_CONTEXT}" = ""]?bye)
  301. exten => NOANSWER,n,Return
  302. exten => NOANSWER,n(bye),Macro(hangupcall)
  303. exten => TORTURE,1,Goto(app-blackhole,musiconhold,1)
  304. exten => TORTURE,n,Macro(hangupcall)
  305. exten => DONTCALL,1,Answer
  306. exten => DONTCALL,n,Wait(1)
  307. exten => DONTCALL,n,Zapateller()
  308. exten => DONTCALL,n,Playback(ss-noservice)
  309. exten => DONTCALL,n,Macro(hangupcall)
  310. exten => ANSWER,1,Noop(Call successfully answered - Hanging up now)
  311. exten => ANSWER,n,Macro(hangupcall,)
  312.  
  313. ; make sure hungup calls go here so that proper cleanup occurs from call confirmed calls and the like
  314. ;
  315. exten => h,1,Macro(hangupcall)
  316. ;-------------------------------------------------------------------------------
  317.  
  318. ;-------------------------------------------------------------------------------
  319. ; macro-get-vmcontext:
  320. ;
  321. ; returns the user's voicemail context
  322. ;
  323. [macro-get-vmcontext]
  324. exten => s,1,Set(VMCONTEXT=${DB(AMPUSER/${ARG1}/voicemail)})
  325. exten => s,2,GotoIf($["foo${VMCONTEXT}" = "foo"]?200:300)
  326. exten => s,200,Set(VMCONTEXT=default)
  327. exten => s,300,NoOp()
  328. ;-------------------------------------------------------------------------------
  329.  
  330. ;-------------------------------------------------------------------------------
  331. ; macro-outisbusy:
  332. ;
  333. ; called if all trunks are busy. This macro is overwridden by the
  334. ; Outbound Route Messages module if installed and configured to provide
  335. ; better messages or choices of tones.
  336. ;
  337. [macro-outisbusy]
  338. exten => s,1,Progress
  339. exten => s,n,Playback(all-circuits-busy-now,noanswer)
  340. exten => s,n,Playback(pls-try-call-later,noanswer)
  341. exten => s,n,Macro(hangupcall)
  342. ;-------------------------------------------------------------------------------
  343.  
  344. ;-------------------------------------------------------------------------------
  345. ; macro-dialout-trunk-predial-hook:
  346. ;
  347. ; this macro intentionally left blank so it may be safely overwritten for any custom
  348. ; requirements that an installation may have.
  349. ;
  350. ; the macro is called by macro-dialout-trunk just prior to making a Dial() attempt
  351. ; to a trunk.
  352. ;
  353. ; MACRO RETURN CODE: ${PREDIAL_HOOK_RET}
  354. ; if set to "BYPASS" then this trunk will be skipped
  355. ;
  356. ;
  357. [macro-dialout-trunk-predial-hook]
  358. exten => s,1,MacroExit()
  359. ;-------------------------------------------------------------------------------
  360.  
  361. ;-------------------------------------------------------------------------------
  362. ; macro-user-logon:
  363. ;
  364. ; Used to log a user onto an adhoc device. Most of the work is done by
  365. ; user_login_out.agi AGI script
  366. ;
  367. [macro-user-logon]
  368. exten => s,1,Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)})
  369. exten => s,n,Answer()
  370. exten => s,n,Wait(1)
  371. exten => s,n,GotoIf($["${DEVICETYPE}" = "fixed"]?s-FIXED,1)
  372. ; get user's extension
  373. ;
  374. exten => s,n,Set(AMPUSER=${ARG1})
  375. exten => s,n,GotoIf($["${AMPUSER}" != ""]?gotpass)
  376. exten => s,n(playagain),Read(AMPUSER,please-enter-your-extension-then-press-pound,,,4)
  377. ; get user's password and authenticate
  378. ;
  379. exten => s,n,GotoIf($["${AMPUSER}" = ""]?s-MAXATTEMPTS,1)
  380. exten => s,n(gotpass),GotoIf($["${DB_EXISTS(AMPUSER/${AMPUSER}/password)}" = "0"]?s-NOUSER,1)
  381. exten => s,n,Set(AMPUSERPASS=${DB_RESULT})
  382. exten => s,n,GotoIf($[${LEN(${AMPUSERPASS})} = 0]?s-NOPASSWORD,1)
  383. ; do not continue if the user has already logged onto this device
  384. ;
  385. exten => s,n,Set(DEVICEUSER=${DB(DEVICE/${CALLERID(number)}/user)})
  386. exten => s,n,GotoIf($["${DEVICEUSER}" = "${AMPUSER}"]?s-ALREADYLOGGEDON,1)
  387. exten => s,n,Authenticate(${AMPUSERPASS})
  388. exten => s,n,AGI(user_login_out.agi,login,${CALLERID(number)},${AMPUSER})
  389. exten => s,n,Playback(agent-loginok)
  390.  
  391. exten => s-FIXED,1,NoOp(Device is FIXED and cannot be logged into)
  392. exten => s-FIXED,n,Playback(ha/phone)
  393. exten => s-FIXED,n,SayDigits(${CALLERID(number)})
  394. exten => s-FIXED,n,Playback(is-curntly-unavail&vm-goodbye)
  395. exten => s-FIXED,n,Hangup ;TODO should play msg indicated device cannot be logged into
  396.  
  397. exten => s-ALREADYLOGGEDON,1,NoOp(This device has already been logged into by this user)
  398. exten => s-ALREADYLOGGEDON,n,Playback(vm-goodbye)
  399. exten => s-ALREADYLOGGEDON,n,Hangup ;TODO should play msg indicated device is already logged into
  400.  
  401. exten => s-NOPASSWORD,1,NoOp(This extension does not exist or no password is set)
  402. exten => s-NOPASSWORD,n,Playback(pbx-invalid)
  403. exten => s-NOPASSWORD,n,Goto(s,playagain)
  404.  
  405. exten => s-MAXATTEMPTS,1,NoOp(Too many login attempts)
  406. exten => s-MAXATTEMPTS,n,Playback(vm-goodbye)
  407. exten => s-MAXATTEMPTS,n,Hangup
  408.  
  409. exten => s-NOUSER,1,NoOp(Invalid extension ${AMPUSER} entered)
  410. exten => s-NOUSER,n,Playback(pbx-invalid)
  411. exten => s-NOUSER,n,Goto(s,playagain)
  412. ;-------------------------------------------------------------------------------
  413.  
  414. ;-------------------------------------------------------------------------------
  415. ; macro-user-logoff:
  416. ;
  417. ; Used to log a user off of an adhoc device. Most of the work is done by
  418. ; user_login_out.agi AGI script
  419. ;
  420. [macro-user-logoff]
  421. exten => s,1,Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)})
  422. exten => s,n,GotoIf($["${DEVICETYPE}" = "fixed"]?s-FIXED,1)
  423. exten => s,n,AGI(user_login_out.agi,logout,${CALLERID(number)})
  424. exten => s,n(done),Playback(agent-loggedoff)
  425.  
  426. exten => s-FIXED,1,NoOp(Device is FIXED and cannot be logged out of)
  427. exten => s-FIXED,n,Playback(an-error-has-occured&vm-goodbye)
  428. exten => s-FIXED,n,Hangup ;TODO should play msg indicated device cannot be logged into
  429. ;-------------------------------------------------------------------------------
  430.  
  431. ;-------------------------------------------------------------------------------
  432. ; macro-privacy-mgr:
  433. ;
  434. ; Privacy Manager Macro makes sure that any calls that don't pass the privacy manager are presented
  435. ; with congestion since there have been observed cases of the call continuing if not stopped with a
  436. ; congestion, and this provides a slightly more friendly 'sorry' message in case the user is
  437. ; legitimately trying to be cooperative.
  438. ;
  439. ; Note: the following options are configurable in privacy.conf:
  440. ;
  441. ; maxretries = 3 ; default value, number of retries before failing
  442. ; minlength = 10 ; default value, number of digits to be accepted as valid CID
  443. ;
  444. [macro-privacy-mgr]
  445. exten => s,1,Set(KEEPCID=${CALLERID(num)})
  446. exten => s,n,GotoIf($["foo${CALLERID(num):0:1}"="foo+"]?CIDTEST2:CIDTEST1)
  447. exten => s,n(CIDTEST1),Set(TESTCID=${MATH(1+${CALLERID(num)})})
  448. exten => s,n,Goto(TESTRESULT)
  449. exten => s,n(CIDTEST2),Set(TESTCID=${MATH(1+${CALLERID(num):1})})
  450. exten => s,n(TESTRESULT),GotoIf($["foo${TESTCID}"="foo"]?CLEARCID:PRIVMGR)
  451. exten => s,n(CLEARCID),Set(CALLERID(num)=)
  452. exten => s,n(PRIVMGR),PrivacyManager(${ARG1},${ARG2})
  453. exten => s,n,GotoIf($["${PRIVACYMGRSTATUS}"="FAILED"]?fail)
  454. exten => s,n,GosubIf($["${CALLED_BLACKLIST}" = "1"]?app-blacklist-check,s,1)
  455. exten => s,n,SetCallerPres(allowed_passed_screen); stop gap until app_privacy.c clears unavailable bit
  456. exten => s,PRIVMGR+101(fail),Noop(STATUS: ${PRIVACYMGRSTATUS} CID: ${CALLERID(num)} ${CALLERID(name)} CALLPRES: ${CALLLINGPRES})
  457. exten => s,n,Playback(sorry-youre-having-problems)
  458. exten => s,n,Playback(goodbye)
  459. exten => s,n,Playtones(congestion)
  460. exten => s,n,Congestion(5)
  461. exten => h,1,Hangup
  462. ;-------------------------------------------------------------------------------
  463.  
  464. ;-------------------------------------------------------------------------------
  465. ; default
  466. ;
  467. ; FreePBX does not use the default context. This context is used by asterisk when
  468. ; it has no other information provided and needs to deliver a call. Hitting this means
  469. ; there has been some sort of configuration error, or a potential bug somehwere.
  470. ; This context can be reached from either internal or external sources.
  471. ;
  472. [default]
  473. include => ext-local
  474. exten => s,1,Playback(vm-goodbye)
  475. exten => s,n,Noop(ERROR: FreePBX Does not use the [default] context, confguration error)
  476. exten => s,n,Macro(hangupcall)
  477. ;-------------------------------------------------------------------------------
  478.  
  479.  
  480.  
  481. ;*******************************************************************************
  482. ; DEPRECATED DIALPLAN - THESE WILL BE REMOVED, NOT USED BY FREEPBX *
  483. ;*******************************************************************************
  484. ;
  485.  
  486. ;-------------------------------------------------------------------------------
  487. ; macro-fixcid: [DEPRECATED]
  488. ;
  489. ; For some reason, if I don't run setCIDname, CALLERID(name) will be blank in my AGI
  490. ;
  491. [macro-fixcid]
  492. exten => s,1,Set(CALLERID(name)=${CALLERID(name)})
  493. ;-------------------------------------------------------------------------------
  494.  
  495.  
  496. ;-------------------------------------------------------------------------------
  497. ; macro-sayXXXX: [DEPRECATED]
  498. ;
  499. ; Text-To-Speech related macros
  500. ; These all follow common actions. First try to playback a file "tts/custom-md5"
  501. ; where "md5" is the md5() of whatever is going to be played. If that doesn't exist,
  502. ; try to playback using macro-tts-sayXXXXX (where XXXXX is text/digits/etc, same as
  503. ; the macro below). If that macro exits with MACRO_OFFSET=100, then it's done,
  504. ; otherwise, fallback to the default asterisk method.
  505. ;
  506.  
  507. ;-------------------------------------------------------------------------------
  508. ; macro-saytext: [DEPRECATED]
  509. ;
  510. ; say text is purely for text-to-speech, there is no fallback
  511. ;
  512. [macro-saytext]
  513. exten => s,1,Noop(Trying custom SayText playback for "${ARG1}")
  514. exten => s,n,Playback(tts/custom-${MD5(${ARG1})})
  515. exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done)
  516. ; call tts-saytext. This should set MACRO_OFFSET=101 if it was successful
  517. exten => s,n(tts),Macro(tts-saytext,${ARG1},${ARG2},${ARG3})
  518. exten => s,n,Noop(No text-to-speech handler for SayText, cannot say "${ARG1}")
  519. exten => s,n,Goto(done)
  520. exten => s,tts+101,Noop(tts handled saytext)
  521. ;-------------------------------------------------------------------------------
  522.  
  523. ;-------------------------------------------------------------------------------
  524. ; macro-sayname: [DEPRECATED]
  525. ;
  526. ; say name is for saying names typically, but fallsback to using SayAlpha
  527. ; (saying the word letter-by-letter)
  528. ;
  529. [macro-sayname]
  530. exten => s,1,Noop(Trying custom SayName playback for "${ARG1}")
  531. exten => s,n,Playback(tts/custom-${MD5(${ARG1})})
  532. exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done)
  533. ; call tts-sayalpha. This should set MACRO_OFFSET=101 if it was successful
  534. exten => s,n(tts),Macro(tts-sayalpha,${ARG1},${ARG2},${ARG3})
  535. exten => s,n,SayAlpha(${ARG1})
  536. exten => s,n,Goto(done)
  537. exten => s,tts+101,Noop(tts handled sayname)
  538. ;-------------------------------------------------------------------------------
  539.  
  540. ;-------------------------------------------------------------------------------
  541. ; macro-saynumber: [DEPRECATED]
  542. ;
  543. ; Say number is for saying numbers (eg "one thousand forty six")
  544. ;
  545. [macro-saynumber]
  546. exten => s,1,Noop(Trying custom SayNumber playback for "${ARG1}")
  547. exten => s,n,Playback(tts/custom-${MD5(${ARG1})})
  548. exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done)
  549. ; call tts-saynumber. This should set MACRO_OFFSET=101 if it was successful
  550. exten => s,n(tts),Macro(tts-saynumber,${ARG1},${ARG2},${ARG3})
  551. exten => s,n,SayNumber(${ARG1})
  552. exten => s,n,Goto(done)
  553. exten => s,tts+101,Noop(tts handled saynumber)
  554. ;-------------------------------------------------------------------------------
  555.  
  556. ;-------------------------------------------------------------------------------
  557. ; macro-saydigits: [DEPRECATED]
  558. ;
  559. ; Say digits is for saying digits one-by-one (eg, "one zero four six")
  560. ;
  561. [macro-saydigits]
  562. exten => s,1,Noop(Trying custom SayDigits playback for "${ARG1}")
  563. exten => s,n,Playback(tts/custom-${MD5(${ARG1})})
  564. exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done)
  565. ; call tts-saydigits. This should set MACRO_OFFSET=101 if it was successful
  566. exten => s,n(tts),Macro(tts-saydigits,${ARG1},${ARG2},${ARG3})
  567. exten => s,n,SayDigits(${ARG1})
  568. exten => s,n,Goto(done)
  569. ;-------------------------------------------------------------------------------
Advertisement
RAW Paste Data Copied
Advertisement