Guest User

dialplan.xml

a guest
Mar 10th, 2010
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. NOTICE:
  4.  
  5. This context is usually accessed via authenticated callers on the sip profile on port 5060
  6. or transfered callers from the public context which arrived via the sip profile on port 5080.
  7.  
  8. Authenticated users will use the user_context variable on the user to determine what context
  9. they can access. You can also add a user in the directory with the cidr= attribute acl.conf.xml
  10. will build the domains ACL using this value.
  11. -->
  12. <!-- http://wiki.freeswitch.org/wiki/Dialplan_XML -->
  13. <include>
  14. <context name="default">
  15.  
  16. <extension name="unloop">
  17. <condition field="${unroll_loops}" expression="^true$"/>
  18. <condition field="${sip_looped_call}" expression="^true$">
  19. <action application="deflect" data="${destination_number}"/>
  20. </condition>
  21. </extension>
  22.  
  23. <!-- Example of doing things based on time of day.
  24.  
  25. year = 4 digit year. Example year="2009"
  26. yday = 1-365
  27. mon = 1-12
  28. mday = 1-31
  29. week = 1-52
  30. mweek= 1-6
  31. wday = 1-7
  32. hour = 0-23
  33. minute = 0-59
  34. minute-of-day = 1-1440
  35.  
  36. Example:
  37. <condition minute-of-day="540-1080"> (9am to 6pm EVERY day)
  38. do something ...
  39. </condition>
  40. -->
  41. <extension name="tod_example" continue="true">
  42. <condition wday="2-6" hour="9-18">
  43. <action application="set" data="open=true"/>
  44. </condition>
  45. </extension>
  46.  
  47. <!-- Example of routing based on holidays
  48.  
  49. This example covers all US Federal holidays except for inauguration day.
  50. -->
  51.  
  52. <extension name="holiday_example" continue="true">
  53. <condition mday="1" mon="1">
  54. <!-- new year's day -->
  55. <action application="set" data="open=false"/>
  56. </condition>
  57. <condition wday="2" mweek="3" mon="1">
  58. <!-- martin luther king day is the 3rd monday in january -->
  59. <action application="set" data="open=false"/>
  60. </condition>
  61. <condition wday="2" mweek="3" mon="2">
  62. <!-- president's day is the 3rd monday in february -->
  63. <action application="set" data="open=false"/>
  64. </condition>
  65. <condition wday="2" mon="5" mday="25-31">
  66. <!-- memorial day is the last monday in may (the only monday between the 25th and the 31st) -->
  67. <action application="set" data="open=false"/>
  68. </condition>
  69. <condition mday="4" mon="7">
  70. <!-- independence day -->
  71. <action application="set" data="open=false"/>
  72. </condition>
  73. <condition wday="2" mweek="1" mon="9">
  74. <!-- labor day is the 1st monday in september -->
  75. <action application="set" data="open=false"/>
  76. </condition>
  77. <condition wday="2" mweek="2" mon="10">
  78. <!-- columbus day is the 2nd monday in october -->
  79. <action application="set" data="open=false"/>
  80. </condition>
  81. <condition mday="11" mon="11">
  82. <!-- veteran's day -->
  83. <action application="set" data="open=false"/>
  84. </condition>
  85. <condition wday="5-6" mweek="4" mon="11">
  86. <!-- thanksgiving is the 4th thursday in november and usually there's an extension for black friday -->
  87. <action application="set" data="open=false"/>
  88. </condition>
  89. <condition mday="25" mon="12">
  90. <!-- Christmas -->
  91. <action application="set" data="open=false"/>
  92. </condition>
  93. </extension>
  94.  
  95. <extension name="global-intercept">
  96. <condition field="destination_number" expression="^\*886$">
  97. <action application="answer"/>
  98. <action application="intercept" data="${hash(select/${domain_name}-last_dial/global)}"/>
  99. <action application="sleep" data="2000"/>
  100. </condition>
  101. </extension>
  102.  
  103. <extension name="group-intercept">
  104. <condition field="destination_number" expression="^\*8$">
  105. <action application="answer"/>
  106. <action application="intercept" data="${hash(select/${domain_name}-last_dial/${callgroup})}"/>
  107. <action application="sleep" data="2000"/>
  108. </condition>
  109. </extension>
  110.  
  111. <extension name="intercept-ext">
  112. <condition field="destination_number" expression="^\*\*(\d+)$">
  113. <action application="answer"/>
  114. <action application="intercept" data="${hash(select/${domain_name}-last_dial_ext/$1)}"/>
  115. <action application="sleep" data="2000"/>
  116. </condition>
  117. </extension>
  118.  
  119. <extension name="redial">
  120. <condition field="destination_number" expression="^\*870$">
  121. <action application="transfer" data="${hash(select/${domain_name}-last_dial/${caller_id_number})}"/>
  122. </condition>
  123. </extension>
  124.  
  125. <extension name="global" continue="true">
  126. <condition field="${call_debug}" expression="^true$" break="never">
  127. <action application="info"/>
  128. </condition>
  129. <!--
  130. This is an example of how to auto detect if telephone-event is missing and activate inband detection
  131. -->
  132. <!--
  133. <condition field="${switch_r_sdp}" expression="a=rtpmap:(\d+)\stelephone-event/8000" break="never">
  134. <action application="set" data="rtp_payload_number=$1"/>
  135. <anti-action application="start_dtmf"/>
  136. </condition>
  137. -->
  138. <condition field="${sip_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$" break="never">
  139. <action application="set" data="sip_secure_media=true"/>
  140. <!-- Offer SRTP on outbound legs if we have it on inbound. -->
  141. <!-- <action application="export" data="sip_secure_media=true"/> -->
  142. </condition>
  143. <condition>
  144. <action application="hash" data="insert/${domain_name}-spymap/${caller_id_number}/${uuid}"/>
  145. <action application="hash" data="insert/${domain_name}-last_dial/${caller_id_number}/${destination_number}"/>
  146. <action application="hash" data="insert/${domain_name}-last_dial/global/${uuid}"/>
  147. </condition>
  148. </extension>
  149.  
  150. <!-- If sip_req_host is not a local domain then this has to be an external sip uri -->
  151. <!--
  152. <extension name="external_sip_uri" continue="true">
  153. <condition field="source" expression="mod_sofia"/>
  154. <condition field="${outside_call}" expression="^$"/>
  155. <condition field="${domain_exists(${sip_req_host})}" expression="true">
  156. <anti-action application="bridge" data="sofia/${use_profile}/${sip_to_uri}"/>
  157. </condition>
  158. </extension>
  159. -->
  160. <!--
  161. Snom button demo, call 9000 to make button 2 mapped to transfer the current call to a conference
  162. -->
  163.  
  164. <extension name="snom-demo-2">
  165. <condition field="destination_number" expression="^\*9001$">
  166. <action application="eval" data="${snom_bind_key(2 off DND ${sip_from_user} ${sip_from_host} ${sofia_profile_name} message notused)}"/>
  167. <action application="transfer" data="3000"/>
  168. </condition>
  169. </extension>
  170.  
  171. <extension name="snom-demo-1">
  172. <condition field="destination_number" expression="^\*9000$">
  173. <!--<key> <light> <label> <user> <host> <profile> <action_name> <action>-->
  174. <action application="eval" data="${snom_bind_key(2 on DND ${sip_from_user} ${sip_from_host} ${sofia_profile_name} message api+uuid_transfer ${uuid} 9001)}"/>
  175. <action application="playback" data="$${hold_music}"/>
  176. </condition>
  177. </extension>
  178.  
  179. <extension name="eavesdrop">
  180. <condition field="destination_number" expression="^\*88(.*)$|^\*0(.*)$">
  181. <action application="answer"/>
  182. <action application="eavesdrop" data="${hash(select/${domain_name}-spymap/$1)}"/>
  183. </condition>
  184. </extension>
  185.  
  186. <extension name="eavesdrop">
  187. <condition field="destination_number" expression="^\*779$">
  188. <action application="answer"/>
  189. <action application="set" data="eavesdrop_indicate_failed=tone_stream://%(500, 0, 320)"/>
  190. <action application="set" data="eavesdrop_indicate_new=tone_stream://%(500, 0, 620)"/>
  191. <action application="set" data="eavesdrop_indicate_idle=tone_stream://%(250, 0, 920)"/>
  192. <action application="eavesdrop" data="all"/>
  193. </condition>
  194. </extension>
  195.  
  196. <extension name="call_privacy">
  197. <condition field="destination_number" expression="^\*67(\d+)$">
  198. <action application="privacy" data="full"/>
  199. <action application="set" data="sip_h_Privacy=id"/>
  200. <action application="set" data="privacy=yes"/>
  201. <action application="transfer" data="$1 XML default"/>
  202. </condition>
  203. </extension>
  204.  
  205. <extension name="call_return">
  206. <condition field="destination_number" expression="^\*69$|^869$|^lcr$">
  207. <action application="transfer" data="${hash(select/${domain_name}-call_return/${caller_id_number})}"/>
  208. </condition>
  209. </extension>
  210.  
  211. <extension name="del-group">
  212. <condition field="destination_number" expression="^\**80(\d{2})$">
  213. <action application="answer"/>
  214. <action application="group" data="delete:$1@${domain_name}:${sofia_contact(${sip_from_user}@${domain_name})}"/>
  215. <action application="gentones" data="%(1000, 0, 320)"/>
  216. </condition>
  217. </extension>
  218.  
  219. <extension name="add-group">
  220. <condition field="destination_number" expression="^\**81(\d{2})$">
  221. <action application="answer"/>
  222. <action application="group" data="insert:$1@${domain_name}:${sofia_contact(${sip_from_user}@${domain_name})}"/>
  223. <action application="gentones" data="%(1000, 0, 640)"/>
  224. </condition>
  225. </extension>
  226.  
  227. <extension name="call-group-simo">
  228. <condition field="destination_number" expression="^\**82(\d{2})$">
  229. <action application="bridge" data="{leg_timeout=15,ignore_early_media=true}${group(call:$1@${domain_name})}"/>
  230. </condition>
  231. </extension>
  232.  
  233. <extension name="call-group-order">
  234. <condition field="destination_number" expression="^\*83(\d{2})$">
  235. <action application="bridge" data="{leg_timeout=15,ignore_early_media=true}${group(call:$1@${domain_name}:order)}"/>
  236. </condition>
  237. </extension>
  238.  
  239. <extension name="extension-intercom">
  240. <condition field="destination_number" expression="^\*8(\d{3,6})$">
  241. <action application="set" data="dialed_extension=$1"/>
  242. <action application="export" data="sip_auto_answer=true"/>
  243. <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
  244. </condition>
  245. </extension>
  246.  
  247. <extension name="send_to_voicemail">
  248. <condition field="destination_number" expression="^\*99(\d{3,6})$">
  249. <action application="answer"/>
  250. <action application="sleep" data="1000"/>
  251. <action application="set" data="dialed_extension=$1"/>
  252. <action application="export" data="dialed_extension=$1"/>
  253. <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
  254. </condition>
  255. </extension>
  256.  
  257. <X-PRE-PROCESS cmd="include" data="default/*.xml"/>
  258.  
  259. <extension name="group_dial_sales">
  260. <condition field="destination_number" expression="^\*2000$">
  261. <action application="bridge" data="${group_call(sales@${domain_name})}"/>
  262. </condition>
  263. </extension>
  264.  
  265. <extension name="group_dial_support">
  266. <condition field="destination_number" expression="^\*2001$">
  267. <action application="bridge" data="group/support@${domain_name}"/>
  268. </condition>
  269. </extension>
  270.  
  271. <extension name="group_dial_billing">
  272. <condition field="destination_number" expression="^\*2002$">
  273. <action application="bridge" data="group/billing@${domain_name}"/>
  274. </condition>
  275. </extension>
  276.  
  277. <!-- voicemail operator extension -->
  278. <!--
  279. <extension name="operator">
  280. <condition field="destination_number" expression="^operator$|^0$">
  281. <action application="set" data="transfer_ringback=$${hold_music}"/>
  282. <action application="transfer" data="1000 XML features"/>
  283. </condition>
  284. </extension>
  285. -->
  286.  
  287. <!-- voicemail main extension, used when * is pressed from an external number -->
  288. <extension name="vmain">
  289. <condition field="destination_number" expression="^vmain$">
  290. <action application="answer"/>
  291. <action application="sleep" data="1000"/>
  292. <action application="voicemail" data="check default ${domain_name} ${dialed_extension}"/>
  293. </condition>
  294. </extension>
  295.  
  296. <!-- voicemail main0 extension -->
  297. <extension name="vmain1">
  298. <condition field="destination_number" expression="^vmain1$|^\*97$|^\*4000$">
  299. <action application="answer"/>
  300. <action application="sleep" data="1000"/>
  301. <action application="voicemail" data="check default ${domain_name}"/>
  302. </condition>
  303. </extension>
  304.  
  305. <!-- voicemail main1 extension -->
  306. <extension name="vmain2">
  307. <condition field="destination_number" expression="^vmain2$|^\*98$">
  308. <action application="answer"/>
  309. <action application="sleep" data="1000"/>
  310. <action application="voicemail" data="check default ${domain_name} ${sip_from_user}"/>
  311. </condition>
  312. </extension>
  313.  
  314. <!-- dial via SIP uri -->
  315. <extension name="sip_uri">
  316. <condition field="destination_number" expression="^sip:(.*)$">
  317. <action application="bridge" data="sofia/${use_profile}/$1"/>
  318. </condition>
  319. </extension>
  320.  
  321. <!--
  322. start a dynamic conference with the settings of the "default" conference profile in conference.conf.xml
  323. -->
  324. <extension name="nb_conferences">
  325. <condition field="destination_number" expression="^\*(30\d{2})$">
  326. <action application="answer"/>
  327. <action application="conference" data="$1-${domain_name}@default"/>
  328. </condition>
  329. </extension>
  330.  
  331. <extension name="wb_conferences">
  332. <condition field="destination_number" expression="^\*(31\d{2})$">
  333. <action application="answer"/>
  334. <action application="conference" data="$1-${domain_name}@wideband"/>
  335. </condition>
  336. </extension>
  337.  
  338. <extension name="uwb_conferences">
  339. <condition field="destination_number" expression="^\*(32\d{2})$">
  340. <action application="answer"/>
  341. <action application="conference" data="$1-${domain_name}@ultrawideband"/>
  342. </condition>
  343. </extension>
  344.  
  345. <!-- MONO 48kHz conferences -->
  346. <extension name="cdquality_conferences">
  347. <condition field="destination_number" expression="^\*(33\d{2})$">
  348. <action application="answer"/>
  349. <action application="conference" data="$1-${domain_name}@cdquality"/>
  350. </condition>
  351. </extension>
  352.  
  353. <!-- dial the FreeSWITCH conference via SIP-->
  354. <extension name="freeswitch_public_conf_via_sip">
  355. <condition field="destination_number" expression="^\*9(888|1616|3232)$">
  356. <action application="export" data="hold_music=silence"/>
  357. <!--
  358. This will take the SAS from the b-leg and send it to the display on the a-leg phone.
  359. Known working with Polycom and Snom maybe others.
  360. -->
  361. <!--
  362. <action application="set" data="exec_after_bridge_app=${sched_api(+4 zrtp expand uuid_display ${uuid} \${uuid_getvar(\${uuid_getvar(${uuid} signal_bond)} zrtp_sas1_string )} \${uuid_getvar(\${uuid_getvar(${uuid} signal_bond)} zrtp_sas2_string )} )}"/>
  363. <action application="export" data="nolocal:zrtp_secure_media=true"/>
  364. -->
  365. <action application="bridge" data="sofia/${use_profile}/$1@conference.freeswitch.org"/>
  366. </condition>
  367. </extension>
  368.  
  369. <!--
  370. This extension will start a conference and invite a group.
  371. At anytime the participant can dial *2 to bridge directly to the boss.
  372. All other callers are then hung up on.
  373. -->
  374. <extension name="mad_boss_intercom">
  375. <condition field="destination_number" expression="^\*0911$">
  376. <action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss1"/>
  377. <action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
  378. <action application="set" data="conference_auto_outcall_timeout=60"/>
  379. <action application="set" data="conference_auto_outcall_flags=mute"/>
  380. <action application="set" data="conference_auto_outcall_prefix={sip_auto_answer=true,execute_on_answer='bind_meta_app 2 a s1 transfer::intercept:${uuid} inline'}"/>
  381. <action application="set" data="sip_exclude_contact=${network_addr}"/>
  382. <action application="conference_set_auto_outcall" data="${group_call(sales)}"/>
  383. <action application="conference" data="madboss_intercom1@default+flags{endconf|deaf}"/>
  384. </condition>
  385. </extension>
  386.  
  387. <!--
  388. This extension will start a conference and invite a few of people.
  389. At anytime the participant can dial *2 to bridge directly to the boss.
  390. All other callers are then hung up on.
  391. -->
  392. <extension name="mad_boss_intercom">
  393. <condition field="destination_number" expression="^\*0912$">
  394. <action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss2"/>
  395. <action application="set" data="conference_auto_outcall_caller_id_number=0912"/>
  396. <action application="set" data="conference_auto_outcall_timeout=60"/>
  397. <action application="set" data="conference_auto_outcall_flags=mute"/>
  398. <action application="set" data="conference_auto_outcall_prefix={sip_auto_answer=true,execute_on_answer='bind_meta_app 2 a s1 transfer::intercept:${uuid} inline'}"/>
  399. <action application="set" data="sip_exclude_contact=${network_addr}"/>
  400. <action application="conference_set_auto_outcall" data="loopback/9999"/>
  401. <action application="conference" data="madboss_intercom2@default+flags{endconf|deaf}"/>
  402. </condition>
  403. </extension>
  404.  
  405. <!--This extension will start a conference and invite several people upon entering -->
  406. <extension name="mad_boss">
  407. <condition field="destination_number" expression="^\*0913$">
  408. <!--These params effect the outcalls made once you join-->
  409. <action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss"/>
  410. <action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
  411. <action application="set" data="conference_auto_outcall_timeout=60"/>
  412. <action application="set" data="conference_auto_outcall_flags=none"/>
  413. <!--<action application="set" data="conference_auto_outcall_announce=say:You have been called into an emergency conference"/>-->
  414. <!--Add as many of these as you need, These are the people you are going to call-->
  415. <action application="conference_set_auto_outcall" data="loopback/9999"/>
  416. <action application="conference" data="madboss3@default"/>
  417. </condition>
  418. </extension>
  419.  
  420. <!-- a sample IVR -->
  421. <extension name="ivr_demo">
  422. <condition field="destination_number" expression="^\*5000$">
  423. <action application="answer"/>
  424. <action application="sleep" data="2000"/>
  425. <action application="ivr" data="demo_ivr"/>
  426. </condition>
  427. </extension>
  428.  
  429. <!-- Create a conference on the fly and pull someone in at the same time. -->
  430. <extension name="dynamic_conference">
  431. <condition field="destination_number" expression="^\*5001$">
  432. <action application="conference" data="bridge:mydynaconf:sofia/${use_profile}/1234@conference.freeswitch.org"/>
  433. </condition>
  434. </extension>
  435.  
  436. <extension name="rtp_multicast_page">
  437. <condition field="destination_number" expression="^\*pagegroup$|^\*7243$">
  438. <action application="answer"/>
  439. <action application="esf_page_group"/>
  440. </condition>
  441. </extension>
  442.  
  443. <!--
  444. Parking extensions... transferring calls to 5900 will park them in a queue.
  445. -->
  446. <extension name="park">
  447. <condition field="destination_number" expression="^\*5900$">
  448. <action application="set" data="fifo_music=$${hold_music}"/>
  449. <action application="fifo" data="5900@${domain_name} in"/>
  450. </condition>
  451. </extension>
  452.  
  453. <!--
  454. Parking pickup extension. Calling 5901 will pickup the call.
  455. -->
  456. <extension name="unpark">
  457. <condition field="destination_number" expression="^\*5901$">
  458. <action application="answer"/>
  459. <action application="fifo" data="5900@${domain_name} out nowait"/>
  460. </condition>
  461. </extension>
  462.  
  463. <!--
  464. Valet park retrieval, works with valet_park extension below.
  465. Retrieve a valet parked call by dialing 6000 + park number + #
  466. -->
  467. <extension name="valet_park">
  468. <condition field="destination_number" expression="^(6000)$">
  469. <action application="answer"/>
  470. <action application="valet_park" data="valet_parking_lot ask 1 11 10000 ivr/ivr-enter_ext_pound.wav"/>
  471. </condition>
  472. </extension>
  473.  
  474. <!--
  475. Valet park 6001-6099. Blind x-fer to 6001, 6002, etc. to valet park the call.
  476. Dial 6001, 6002, etc. to retrieve a call that is already valet parked.
  477. After call is retrieved, park extension is free for another call.
  478. -->
  479. <extension name="valet_park">
  480. <condition field="destination_number" expression="^(60\d[1-9])$">
  481. <action application="answer"/>
  482. <action application="valet_park" data="valet_parking_lot $1"/>
  483. </condition>
  484. </extension>
  485.  
  486. <!--
  487. This extension is used with Snom phones.
  488.  
  489. Set a function key to park+lot (lot being a number or name.)
  490. Set type to Park+Orbit. You can then park and pickup using
  491. the softkey on the phone. Should work with other phones.
  492. -->
  493. <extension name="park">
  494. <condition field="source" expression="mod_sofia"/>
  495. <condition field="destination_number" expression="park\+(\d+)">
  496. <action application="fifo" data="$1@${domain_name} in undef $${hold_music}"/>
  497. </condition>
  498. </extension>
  499. <!--
  500. The extension is parking pickup with a to param of the fifo we are calling
  501. Some phones send things like orbit= and you can extract that info.
  502. -->
  503. <extension name="unpark">
  504. <condition field="source" expression="mod_sofia"/>
  505. <condition field="destination_number" expression="^parking$"/>
  506. <condition field="${sip_to_params}" expression="fifo\=(\d+)">
  507. <action application="answer"/>
  508. <action application="fifo" data="$1@${domain_name} out nowait"/>
  509. </condition>
  510. </extension>
  511.  
  512. <!--
  513. This extension is used with Linksys phones.
  514.  
  515. Set a Phone tab option Call Park Serv to yes. You can park and
  516. pickup using soft keys "park" and "unpark" found during
  517. active call when moving navigation button. The other option
  518. is to use phone's star codes (defaults to *38 and *39).
  519. -->
  520. <extension name="park">
  521. <condition field="source" expression="mod_sofia"/>
  522. <condition field="destination_number" expression="callpark"/>
  523. <condition field="${sip_refer_to}">
  524. <expression><![CDATA[<sip:callpark@${domain_name};orbit=(\d+)>]]></expression>
  525. <action application="fifo" data="$1@${domain_name} in undef $${hold_music}"/>
  526. </condition>
  527. </extension>
  528.  
  529. <!--
  530. This extension is used with Linksys phones.
  531.  
  532. The extension is parking pickup with a to param of the fifo
  533. we are calling. Linksys sends orbit=<parkingslotnumber>
  534. and we extract that info.
  535. -->
  536. <extension name="unpark">
  537. <condition field="source" expression="mod_sofia"/>
  538. <condition field="destination_number" expression="pickup"/>
  539. <condition field="${sip_to_params}" expression="orbit\=(\d+)">
  540. <action application="answer"/>
  541. <action application="fifo" data="$1@${domain_name} out nowait"/>
  542. </condition>
  543. </extension>
  544.  
  545. <!--
  546. Here are some examples of how to override the ringback heard by the
  547. far end. You have two variables that you can use to override this.
  548.  
  549. ringback - used when a call isn't answered. (early media)
  550. transfer_ringback - used when the call is already answered. (post answer)
  551. -->
  552.  
  553. <!-- Demonstration of how to override the ringback in various situations -->
  554. <extension name="wait">
  555. <condition field="destination_number" expression="^wait$">
  556. <action application="pre_answer"/>
  557. <action application="sleep" data="20000"/>
  558. <action application="answer"/>
  559. <action application="sleep" data="1000"/>
  560. <action application="playback" data="voicemail/vm-goodbye.wav"/>
  561. <action application="hangup"/>
  562. </condition>
  563. </extension>
  564.  
  565. <extension name="fax_receive">
  566. <condition field="destination_number" expression="^\*9978$">
  567. <action application="answer" />
  568. <action application="playback" data="silence_stream://2000"/>
  569. <action application="rxfax" data="/tmp/rxfax.tif"/>
  570. <action application="hangup"/>
  571. </condition>
  572. </extension>
  573.  
  574. <extension name="fax_transmit">
  575. <condition field="destination_number" expression="^\*9979$">
  576. <action application="txfax" data="/tmp/txfax.tif"/>
  577. <action application="hangup"/>
  578. </condition>
  579. </extension>
  580.  
  581. <!-- Send a 180 and let the far end generate ringback. -->
  582. <extension name="ringback_180">
  583. <condition field="destination_number" expression="^\*9980$">
  584. <action application="ring_ready"/>
  585. <action application="sleep" data="20000"/>
  586. <action application="answer"/>
  587. <action application="sleep" data="1000"/>
  588. <action application="playback" data="voicemail/vm-goodbye.wav"/>
  589. <action application="hangup"/>
  590. </condition>
  591. </extension>
  592.  
  593. <!-- Send a 183 and send uk-ring as the ringtone. (early media) -->
  594. <extension name="ringback_183_uk_ring">
  595. <condition field="destination_number" expression="^\*9981$">
  596. <action application="set" data="ringback=$${uk-ring}"/>
  597. <action application="bridge" data="loopback/wait"/>
  598. </condition>
  599. </extension>
  600.  
  601. <!-- Send a 183 and use music as the ringtone. (early media) -->
  602. <extension name="ringback_183_music_ring">
  603. <condition field="destination_number" expression="^\*9982$">
  604. <action application="set" data="ringback=$${hold_music}"/>
  605. <action application="bridge" data="loopback/wait"/>
  606. </condition>
  607. </extension>
  608.  
  609. <!-- Answer the call and use music as the ringtone. (post answer) -->
  610. <extension name="ringback_post_answer_uk_ring">
  611. <condition field="destination_number" expression="^\*9983$">
  612. <action application="set" data="transfer_ringback=$${uk-ring}"/>
  613. <action application="answer"/>
  614. <action application="bridge" data="loopback/wait"/>
  615. </condition>
  616. </extension>
  617.  
  618. <!-- Answer the call and use music as the ringtone. (post answer) -->
  619. <extension name="ringback_post_answer_music">
  620. <condition field="destination_number" expression="^\*9984$">
  621. <action application="set" data="transfer_ringback=$${hold_music}"/>
  622. <action application="answer"/>
  623. <action application="bridge" data="loopback/wait"/>
  624. </condition>
  625. </extension>
  626.  
  627. <extension name="ClueCon">
  628. <condition field="destination_number" expression="^\*9991$">
  629. <action application="set" data="effective_caller_id_name=ClueCon IVR"/>
  630. <action application="bridge" data="sofia/$${domain}/2000@bkw.org"/>
  631. </condition>
  632. </extension>
  633.  
  634. <extension name="show_info">
  635. <condition field="destination_number" expression="^\*9992$">
  636. <action application="answer"/>
  637. <action application="info"/>
  638. <action application="sleep" data="250"/>
  639. <action application="hangup"/>
  640. </condition>
  641. </extension>
  642.  
  643. <extension name="video_record">
  644. <condition field="destination_number" expression="^\*9993$">
  645. <action application="answer"/>
  646. <action application="record_fsv" data="/tmp/testrecord.fsv"/>
  647. </condition>
  648. </extension>
  649.  
  650. <extension name="video_playback">
  651. <condition field="destination_number" expression="^\*9994$">
  652. <action application="answer"/>
  653. <action application="play_fsv" data="/tmp/testrecord.fsv"/>
  654. </condition>
  655. </extension>
  656.  
  657. <extension name="delay_echo">
  658. <condition field="destination_number" expression="^\*9995$">
  659. <action application="answer"/>
  660. <action application="delay_echo" data="5000"/>
  661. </condition>
  662. </extension>
  663.  
  664. <extension name="echo">
  665. <condition field="destination_number" expression="^\*9996$">
  666. <action application="answer"/>
  667. <action application="echo"/>
  668. </condition>
  669. </extension>
  670.  
  671. <extension name="milliwatt">
  672. <condition field="destination_number" expression="^\*9997$">
  673. <action application="answer"/>
  674. <action application="playback" data="tone_stream://%(251,0,1004);loops=-1"/>
  675. </condition>
  676. </extension>
  677.  
  678. <extension name="tone_stream">
  679. <condition field="destination_number" expression="^\*9998$">
  680. <action application="answer"/>
  681. <action application="playback" data="tone_stream://path=${base_dir}/conf/tetris.ttml;loops=10"/>
  682. </condition>
  683. </extension>
  684.  
  685. <!-- install zrtp_agent.lua into scripts (ZRTP == 9787) -->
  686. <extension name="zrtp_enrollement">
  687. <condition field="destination_number" expression="^\*9787$">
  688. <action application="answer"/>
  689. <action application="lua" data="zrtp_agent.lua"/>
  690. </condition>
  691. </extension>
  692.  
  693. <!--
  694. You will no longer hear the bong tone. The wav file is playing stating the call is secure.
  695. The file will not play unless you have both TLS and SRTP active.
  696. -->
  697.  
  698. <extension name="hold_music">
  699. <condition field="destination_number" expression="^\*9999$"/>
  700. <condition field="${sip_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$">
  701. <action application="answer"/>
  702. <action application="execute_extension" data="is_secure XML features"/>
  703. <action application="playback" data="$${hold_music}"/>
  704. <anti-action application="set" data="zrtp_secure_media=true"/>
  705. <anti-action application="answer"/>
  706. <anti-action application="playback" data="silence_stream://2000"/>
  707. <anti-action application="execute_extension" data="is_zrtp_secure XML features"/>
  708. <anti-action application="playback" data="$${hold_music}"/>
  709. </condition>
  710. </extension>
  711.  
  712. <!--
  713. dial the extension 3, 4, 5, or 6 digit extensions for 30 seconds and go to voicemail if the
  714. call fails (continue_on_fail=true), otherwise hang up after a successful
  715. bridge (hangup_after-bridge=true)
  716. -->
  717. <extension name="Local_Extension">
  718. <condition field="destination_number" expression="(^\d{3,6}$)">
  719. <action application="set" data="dialed_extension=$1"/>
  720. <action application="export" data="dialed_extension=$1"/>
  721. <!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
  722. <action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
  723. <!--<action application="bind_meta_app" data="2 b s record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>-->
  724. <action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
  725. <action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
  726. <action application="set" data="ringback=${us-ring}"/>
  727. <action application="set" data="transfer_ringback=$${hold_music}"/>
  728. <action application="set" data="call_timeout=30"/>
  729. <!-- <action application="set" data="sip_exclude_contact=${network_addr}"/> -->
  730. <action application="set" data="hangup_after_bridge=true"/>
  731. <!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
  732. <action application="set" data="continue_on_fail=true"/>
  733. <action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
  734. <action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
  735. <action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
  736. <!--<action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>-->
  737. <action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
  738. <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
  739. <action application="answer"/>
  740. <action application="sleep" data="1000"/>
  741. <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
  742. </condition>
  743. </extension>
  744.  
  745. <!--
  746. You can place files in the default directory to get included.
  747. -->
  748. <!--<X-PRE-PROCESS cmd="include" data="default/*.xml"/>-->
  749.  
  750. <!--
  751. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  752.  
  753. Anything you put below this line will usually get ignored due to the file in
  754. default/99999_enum.xml as it will transfer the call to the enum dialplan.
  755.  
  756. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  757. -->
  758.  
  759. <extension name="enum">
  760. <condition field="${module_exists(mod_enum)}" expression="true"/>
  761. <condition field="destination_number" expression="^(.*)$">
  762. <action application="transfer" data="$1 enum"/>
  763. </condition>
  764. </extension>
  765.  
  766. <!--
  767. <extension name="refer">
  768. <condition field="${sip_refer_to}">
  769. <expression><![CDATA[<sip:${destination_number}@${domain_name}>]]></expression>
  770. </condition>
  771. <condition field="${sip_refer_to}">
  772. <expression><![CDATA[<sip:(.*)@(.*)>]]></expression>
  773. <action application="set" data="refer_user=$1"/>
  774. <action application="set" data="refer_domain=$2"/>
  775. <action application="info"/>
  776. <action application="bridge" data="sofia/${use_profile}/${refer_user}@${refer_domain}"/>
  777. </condition>
  778. </extension>
  779. -->
  780. <!--
  781. This is an example of how to override the RURI on an outgoing invite to a registered contact.
  782. -->
  783. <!--
  784. <extension name="ruri">
  785. <condition field="destination_number" expression="^ruri$">
  786. <action application="bridge" data="sofia/${ruri_profile}/${ruri_user}${regex(${sofia_contact(${ruri_contact})}|^[^\@]+(.*)|%1)}"/>
  787. </condition>
  788. </extension>
  789.  
  790. <extension name="7004">
  791. <condition field="destination_number" expression="^\*7004$">
  792. <action application="set" data="ruri_profile=default"/>
  793. <action application="set" data="ruri_user=2000"/>
  794. <action application="set" data="ruri_contact=1001@${domain_name}"/>
  795. <action application="execute_extension" data="ruri"/>
  796. </condition>
  797. </extension>
  798. -->
  799.  
  800. <!-- SEE WARNING ABOVE IF YOU ARE TRYING TO ADD EXTENSIONS HERE! -->
  801.  
  802. </context>
  803. </include>
RAW Paste Data