2
0

default.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <!--
  2. NOTICE:
  3. This context is usually accessed via authenticated callers on the sip profile on port 5060
  4. or transferred callers from the public context which arrived via the sip profile on port 5080.
  5. Authenticated users will use the user_context variable on the user to determine what context
  6. they can access. You can also add a user in the directory with the cidr= attribute acl.conf.xml
  7. will build the domains acl using this value.
  8. -->
  9. <?xml version="1.0" encoding="utf-8"?>
  10. <!-- http://wiki.freeswitch.org/wiki/Dialplan_XML -->
  11. <include>
  12. <context name="default">
  13. <extension name="unloop">
  14. <condition field="$${unroll_loops}" expression="^true$"/>
  15. <condition field="${sip_looped_call}" expression="^true$">
  16. <action application="deflect" data="${destination_number}"/>
  17. </condition>
  18. </extension>
  19. <!--
  20. Try to get the domain from the sip_auth_realm otherwise it will
  21. default domain in vars.xml for cases it can't figure it out.
  22. -->
  23. <extension name="set_domain" continue="true">
  24. <condition field="${domain_name}" expression="^$"/>
  25. <condition field="source" expression="mod_sofia"/>
  26. <condition field="${sip_auth_realm}" expression="^$">
  27. <action application="set" data="domain_name=$${domain}"/>
  28. <anti-action application="set" data="domain_name=${sip_auth_realm}"/>
  29. </condition>
  30. </extension>
  31. <!-- Set the domain -->
  32. <extension name="set_domain_freetdm" continue="true">
  33. <condition field="${domain_name}" expression="^$"/>
  34. <condition field="source" expression="mod_freetdm">
  35. <action application="set" data="domain_name=$${domain}"/>
  36. </condition>
  37. </extension>
  38. <!-- Example of doing things based on time of day. -->
  39. <extension name="tod_example" continue="true">
  40. <!-- man strftime - M-F, 9AM to 6PM -->
  41. <condition field="${strftime(%w)}" expression="^([1-5])$"/>
  42. <condition field="${strftime(%H%M)}" expression="^((09|1[0-7])[0-5][0-9]|1800)$">
  43. <action application="set" data="open=true"/>
  44. </condition>
  45. </extension>
  46. <extension name="global-intercept">
  47. <condition field="destination_number" expression="^886$">
  48. <action application="answer"/>
  49. <action application="intercept" data="${db(select/${domain_name}-last_dial/global)}"/>
  50. <action application="sleep" data="2000"/>
  51. </condition>
  52. </extension>
  53. <extension name="group-intercept">
  54. <condition field="destination_number" expression="^\*8$">
  55. <action application="answer"/>
  56. <action application="intercept" data="${db(select/${domain_name}-last_dial/${callgroup})}"/>
  57. <action application="sleep" data="2000"/>
  58. </condition>
  59. </extension>
  60. <extension name="intercept-ext">
  61. <condition field="destination_number" expression="^\*\*(\d+)$">
  62. <action application="answer"/>
  63. <action application="intercept" data="${db(select/${domain_name}-last_dial_ext/$1)}"/>
  64. <action application="sleep" data="2000"/>
  65. </condition>
  66. </extension>
  67. <extension name="redial">
  68. <condition field="destination_number" expression="^870$">
  69. <action application="transfer" data="${db(select/${domain_name}-last_dial/${caller_id_number})}"/>
  70. </condition>
  71. </extension>
  72. <extension name="global" continue="true">
  73. <condition field="${network_addr}" expression="^$" break="never">
  74. <action application="set" data="use_profile=${cond(${acl($${local_ip_v4} rfc1918)} == true ? nat : default)}"/>
  75. <anti-action application="set" data="use_profile=${cond(${acl(${network_addr} rfc1918)} == true ? nat : default)}"/>
  76. </condition>
  77. <!-- This will setup some variables if the user isn't authenticated. -->
  78. <condition field="${numbering_plan}" expression="^$" break="never">
  79. <action application="set_user" data="default@${domain_name}"/>
  80. </condition>
  81. <condition field="$${call_debug}" expression="^true$" break="never">
  82. <action application="info"/>
  83. </condition>
  84. <condition field="${rtp_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$" break="never">
  85. <action application="set" data="rtp_secure_media=true"/>
  86. <!-- Offer SRTP on outbound legs if we have it on inbound. -->
  87. <!-- <action application="export" data="rtp_secure_media=true"/> -->
  88. </condition>
  89. <condition>
  90. <action application="db" data="insert/${domain_name}-spymap/${caller_id_number}/${uuid}"/>
  91. <action application="db" data="insert/${domain_name}-last_dial/${caller_id_number}/${destination_number}"/>
  92. <action application="db" data="insert/${domain_name}-last_dial/global/${uuid}"/>
  93. </condition>
  94. </extension>
  95. <!-- If sip_req_host is not a local domain then this has to be an external sip uri -->
  96. <!--
  97. <extension name="external_sip_uri" continue="true">
  98. <condition field="source" expression="mod_sofia"/>
  99. <condition field="${outside_call}" expression="^$"/>
  100. <condition field="${domain_exists(${sip_req_host})}" expression="true">
  101. <anti-action application="bridge" data="sofia/${use_profile}/${sip_to_uri}"/>
  102. </condition>
  103. </extension>
  104. -->
  105. <!--
  106. snom button demo, call 9000 to make button 2 mapped to transfer the current call to a conference
  107. -->
  108. <extension name="snom-demo-2">
  109. <condition field="destination_number" expression="^9001$">
  110. <action application="eval" data="${snom_bind_key(2 off DND ${sip_from_user} ${sip_from_host} ${sofia_profile_name} message notused)}"/>
  111. <action application="transfer" data="3000"/>
  112. </condition>
  113. </extension>
  114. <extension name="snom-demo-1">
  115. <condition field="destination_number" expression="^9000$">
  116. <!--<key> <light> <label> <user> <host> <profile> <action_name> <action>-->
  117. <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)}"/>
  118. <action application="playback" data="$${hold_music}"/>
  119. </condition>
  120. </extension>
  121. <extension name="eavesdrop">
  122. <condition field="destination_number" expression="^88(.*)$|^\*0(.*)$">
  123. <action application="answer"/>
  124. <action application="eavesdrop" data="${db(select/${domain_name}-spymap/$1)}"/>
  125. </condition>
  126. </extension>
  127. <extension name="eavesdrop">
  128. <condition field="destination_number" expression="^779$">
  129. <action application="answer"/>
  130. <action application="set" data="eavesdrop_indicate_failed=tone_stream://%(500, 0, 320)"/>
  131. <action application="set" data="eavesdrop_indicate_new=tone_stream://%(500, 0, 620)"/>
  132. <action application="set" data="eavesdrop_indicate_idle=tone_stream://%(250, 0, 920)"/>
  133. <action application="eavesdrop" data="all"/>
  134. </condition>
  135. </extension>
  136. <extension name="call_return">
  137. <condition field="destination_number" expression="^\*69$|^869$|^lcr$">
  138. <action application="transfer" data="${db(select/${domain_name}-call_return/${caller_id_number})}"/>
  139. </condition>
  140. </extension>
  141. <extension name="del-group">
  142. <condition field="destination_number" expression="^80(\d{2})$">
  143. <action application="answer"/>
  144. <action application="group" data="delete:$1@${domain_name}:${sofia_contact(${sip_from_user}@${domain_name})}"/>
  145. <action application="gentones" data="%(1000, 0, 320)"/>
  146. </condition>
  147. </extension>
  148. <extension name="add-group">
  149. <condition field="destination_number" expression="^81(\d{2})$">
  150. <action application="answer"/>
  151. <action application="group" data="insert:$1@${domain_name}:${sofia_contact(${sip_from_user}@${domain_name})}"/>
  152. <action application="gentones" data="%(1000, 0, 640)"/>
  153. </condition>
  154. </extension>
  155. <extension name="call-group-simo">
  156. <condition field="destination_number" expression="^82(\d{2})$">
  157. <action application="bridge" data="{ignore_early_media=true}${group(call:$1@${domain_name})}"/>
  158. </condition>
  159. </extension>
  160. <extension name="call-group-order">
  161. <condition field="destination_number" expression="^83(\d{2})$">
  162. <action application="set" data="call_timeout=10"/>
  163. <action application="bridge" data="{ignore_early_media=true}${group(call:$1@${domain_name}:order)}"/>
  164. </condition>
  165. </extension>
  166. <extension name="extension-intercom">
  167. <!-- <condition field="${sip_to_params}" expression="intercom\=true"/> -->
  168. <condition field="destination_number" expression="^8(10[01][0-9])$">
  169. <action application="set" data="dialed_extension=$1"/>
  170. <!-- This Alert-Info seems to be a case for Intercom for Polycom which sip_auto_answer=true covers already. -->
  171. <!--<action application="export"><![CDATA[alert_info=<sip:${domain_name}>;Ring;Answer]]></action>-->
  172. <action application="export"><![CDATA[sip_h_Call-Info=<sip:${domain_name}>;answer-after=0]]></action>
  173. <action application="export" data="sip_invite_params=intercom=true"/>
  174. <action application="export" data="sip_auto_answer=true"/>
  175. <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
  176. </condition>
  177. </extension>
  178. <!--
  179. if the calling party is the called party, go to their VM
  180. if the calling party is NOT the called party dial the extension
  181. (1000-1019) for 30 seconds and go to voicemail if the
  182. call fails (continue_on_fail=true), otherwise hang up after a
  183. successful bridge (hangup_after-bridge=true)
  184. -->
  185. <extension name="Local_Extension">
  186. <condition field="destination_number" expression="^(10[01][0-9])$">
  187. <action application="set" data="dialed_extension=$1"/>
  188. <action application="export" data="dialed_extension=$1"/>
  189. </condition>
  190. <condition field="destination_number" expression="^${caller_id_number}$">
  191. <action application="set" data="voicemail_authorized=${sip_authorized}"/>
  192. <action application="answer"/>
  193. <action application="sleep" data="1000"/>
  194. <action application="voicemail" data="check default ${domain_name} ${dialed_extension}"/>
  195. <!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
  196. <anti-action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
  197. <anti-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"/>
  198. <anti-action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
  199. <anti-action application="set" data="ringback=${us-ring}"/>
  200. <anti-action application="set" data="transfer_ringback=$${hold_music}"/>
  201. <anti-action application="set" data="call_timeout=30"/>
  202. <!-- <anti-action application="set" data="sip_exclude_contact=${network_addr}"/> -->
  203. <anti-action application="set" data="hangup_after_bridge=true"/>
  204. <!--<anti-action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
  205. <anti-action application="set" data="continue_on_fail=true"/>
  206. <anti-action application="db" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
  207. <anti-action application="db" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
  208. <anti-action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
  209. <!--<anti-action application="export" data="nolocal:rtp_secure_media=${user_data(${dialed_extension}@${domain_name} var rtp_secure_media)}"/>-->
  210. <anti-action application="db" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
  211. <anti-action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
  212. <anti-action application="answer"/>
  213. <anti-action application="sleep" data="1000"/>
  214. <anti-action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>
  215. </condition>
  216. </extension>
  217. <extension name="out_test">
  218. <condition>
  219. <action application="bridge" data="sofia/external/${destination_number}@out01.voipwelcome.com"/>
  220. </condition>
  221. </extension>
  222. <!-- voicemail operator extension -->
  223. <extension name="operator">
  224. <condition field="destination_number" expression="^operator$|^0$">
  225. <action application="set" data="transfer_ringback=$${hold_music}"/>
  226. <action application="transfer" data="1000 XML features"/>
  227. </condition>
  228. </extension>
  229. <!-- voicemail main extension -->
  230. <extension name="vmain">
  231. <condition field="destination_number" expression="^vmain|4000$">
  232. <action application="answer"/>
  233. <action application="sleep" data="1000"/>
  234. <action application="voicemail" data="check default ${domain_name}"/>
  235. </condition>
  236. </extension>
  237. <!-- dial via SIP uri -->
  238. <extension name="sip_uri">
  239. <condition field="destination_number" expression="^sip:(.*)$">
  240. <action application="bridge" data="sofia/${use_profile}/$1"/>
  241. </condition>
  242. </extension>
  243. <!--
  244. start a dynamic conference with the settings of the "default" conference profile in conference.conf.xml
  245. -->
  246. <extension name="nb_conferences">
  247. <condition field="destination_number" expression="^(30\d{2})$">
  248. <action application="answer"/>
  249. <action application="conference" data="$1-${domain_name}@default"/>
  250. </condition>
  251. </extension>
  252. <extension name="wb_conferences">
  253. <condition field="destination_number" expression="^(31\d{2})$">
  254. <action application="answer"/>
  255. <action application="conference" data="$1-${domain_name}@wideband"/>
  256. </condition>
  257. </extension>
  258. <extension name="uwb_conferences">
  259. <condition field="destination_number" expression="^(32\d{2})$">
  260. <action application="answer"/>
  261. <action application="conference" data="$1-${domain_name}@ultrawideband"/>
  262. </condition>
  263. </extension>
  264. <!-- dial the freeswitch conference via SIP-->
  265. <extension name="freeswitch_public_conf_via_sip">
  266. <condition field="destination_number" expression="^9(888|1616)$">
  267. <action application="bridge" data="sofia/${use_profile}/$1@conference.freeswitch.org"/>
  268. </condition>
  269. </extension>
  270. <!--This extension will start a conference and invite several people upon entering -->
  271. <extension name="mad_boss">
  272. <condition field="destination_number" expression="^0911$">
  273. <!--These params effect the outcalls made once you join-->
  274. <action application="set" data="conference_auto_outcall_caller_id_name=Mad Boss"/>
  275. <action application="set" data="conference_auto_outcall_caller_id_number=0911"/>
  276. <action application="set" data="conference_auto_outcall_timeout=60"/>
  277. <action application="set" data="conference_utils_auto_outcall_flags=none"/>
  278. <!--<action application="set" data="conference_auto_outcall_announce=say:You have been called into an emergency conference"/>-->
  279. <!--Add as many of these as you need, These are the people you are going to call-->
  280. <action application="conference_set_auto_outcall" data="sofia/gateway/$${default_provider}/19184238080"/>
  281. <action application="conference_set_auto_outcall" data="sofia/default/888@conference.freeswitch.org"/>
  282. <action application="conference" data="cool@default"/>
  283. </condition>
  284. </extension>
  285. <!-- a sample IVR -->
  286. <extension name="ivr_demo">
  287. <condition field="destination_number" expression="^5000$">
  288. <action application="answer"/>
  289. <action application="sleep" data="2000"/>
  290. <action application="ivr" data="demo_ivr"/>
  291. </condition>
  292. </extension>
  293. <!-- Create a conference on the fly and pull someone in at the same time. -->
  294. <extension name="dynamic conference">
  295. <condition field="destination_number" expression="^5001$">
  296. <action application="conference" data="bridge:mydynaconf:sofia/${use_profile}/1234@conference.freeswitch.org"/>
  297. </condition>
  298. </extension>
  299. <extension name="rtp_multicast_page">
  300. <condition field="destination_number" expression="^pagegroup$|^7243">
  301. <action application="answer"/>
  302. <action application="esf_page_group"/>
  303. </condition>
  304. </extension>
  305. <!--
  306. Parking extensions... transferring calls to 5900 will park them in a queue.
  307. -->
  308. <extension name="park">
  309. <condition field="destination_number" expression="^5900$">
  310. <action application="set" data="fifo_music=$${hold_music}"/>
  311. <action application="fifo" data="5900@${domain_name} in"/>
  312. </condition>
  313. </extension>
  314. <!--
  315. Parking pickup extension. Calling 5901 will pickup the call.
  316. -->
  317. <extension name="unpark">
  318. <condition field="destination_number" expression="^5901$">
  319. <action application="answer"/>
  320. <action application="fifo" data="5900@${domain_name} out nowait"/>
  321. </condition>
  322. </extension>
  323. <!--
  324. This extension is used with snom phones.
  325. Set a function key to park+lot (lot being a number or name.)
  326. Set type to Park+Orbit. You can then park and pickup using
  327. the softkey on the phone. Should work with other phones.
  328. -->
  329. <extension name="park">
  330. <condition field="source" expression="mod_sofia"/>
  331. <condition field="destination_number" expression="park\+(\d+)">
  332. <action application="fifo" data="$1@${domain_name} in undef $${hold_music}"/>
  333. </condition>
  334. </extension>
  335. <!--
  336. The extension is parking pickup with a to param of the fifo we are calling
  337. Some phones send things like orbit= and you can extract that info.
  338. -->
  339. <extension name="unpark">
  340. <condition field="source" expression="mod_sofia"/>
  341. <condition field="destination_number" expression="^parking$"/>
  342. <condition field="${sip_to_params}" expression="fifo\=(\d+)">
  343. <action application="answer"/>
  344. <action application="fifo" data="$1@${domain_name} out nowait"/>
  345. </condition>
  346. </extension>
  347. <!--
  348. This extension is used with linksys phones.
  349. Set a Phone tab option Call Park Serv to yes. You can park and
  350. pickup using soft keys "park" and "unpark" found during
  351. active call when moving navigation button. The other option
  352. is to use phone's star codes (defaults to *38 and *39).
  353. -->
  354. <extension name="park">
  355. <condition field="source" expression="mod_sofia"/>
  356. <condition field="destination_number" expression="callpark"/>
  357. <condition field="${sip_refer_to}">
  358. <expression><![CDATA[<sip:callpark@${domain_name};orbit=(\d+)>]]></expression>
  359. <action application="fifo" data="$1@${domain_name} in undef $${hold_music}"/>
  360. </condition>
  361. </extension>
  362. <!--
  363. This extension is used with linksys phones.
  364. The extension is parking pickup with a to param of the fifo
  365. we are calling. Linksys sends orbit=<parkingslotnumber>
  366. and we extract that info.
  367. -->
  368. <extension name="unpark">
  369. <condition field="source" expression="mod_sofia"/>
  370. <condition field="destination_number" expression="pickup"/>
  371. <condition field="${sip_to_params}" expression="orbit\=(\d+)">
  372. <action application="answer"/>
  373. <action application="fifo" data="$1@${domain_name} out nowait"/>
  374. </condition>
  375. </extension>
  376. <!--
  377. Here are some examples of how to override the ringback heard by the
  378. far end. You have two variables that you can use to override this.
  379. ringback - used when a call isn't answered. (early media)
  380. transfer_ringback - used when the call is already answered. (post answer)
  381. -->
  382. <!-- Demonstration of how to override the ringback in various situations -->
  383. <extension name="wait">
  384. <condition field="destination_number" expression="^wait$">
  385. <action application="pre_answer"/>
  386. <action application="sleep" data="20000"/>
  387. <action application="answer"/>
  388. <action application="sleep" data="1000"/>
  389. <action application="playback" data="voicemail/vm-goodbye.wav"/>
  390. <action application="hangup"/>
  391. </condition>
  392. </extension>
  393. <!-- Send a 180 and let the far end generate ringback. -->
  394. <extension name="ringback_180">
  395. <condition field="destination_number" expression="^9980$">
  396. <action application="ring_ready"/>
  397. <action application="sleep" data="20000"/>
  398. <action application="answer"/>
  399. <action application="sleep" data="1000"/>
  400. <action application="playback" data="voicemail/vm-goodbye.wav"/>
  401. <action application="hangup"/>
  402. </condition>
  403. </extension>
  404. <!-- Send a 183 and send uk-ring as the ringtone. (early media) -->
  405. <extension name="ringback_183_uk_ring">
  406. <condition field="destination_number" expression="^9981$">
  407. <action application="set" data="ringback=$${uk-ring}"/>
  408. <action application="bridge" data="loopback/wait"/>
  409. </condition>
  410. </extension>
  411. <!-- Send a 183 and use music as the ringtone. (early media) -->
  412. <extension name="ringback_183_music_ring">
  413. <condition field="destination_number" expression="^9982$">
  414. <action application="set" data="ringback=$${hold_music}"/>
  415. <action application="bridge" data="loopback/wait"/>
  416. </condition>
  417. </extension>
  418. <!-- Answer the call and use music as the ringtone. (post answer) -->
  419. <extension name="ringback_post_answer_uk_ring">
  420. <condition field="destination_number" expression="^9983$">
  421. <action application="set" data="transfer_ringback=$${uk-ring}"/>
  422. <action application="answer"/>
  423. <action application="bridge" data="loopback/wait"/>
  424. </condition>
  425. </extension>
  426. <!-- Answer the call and use music as the ringtone. (post answer) -->
  427. <extension name="ringback_post_answer_music">
  428. <condition field="destination_number" expression="^9984$">
  429. <action application="set" data="transfer_ringback=$${hold_music}"/>
  430. <action application="answer"/>
  431. <action application="bridge" data="loopback/wait"/>
  432. </condition>
  433. </extension>
  434. <extension name="show_info">
  435. <condition field="destination_number" expression="^9992$">
  436. <action application="answer"/>
  437. <action application="info"/>
  438. <action application="sleep" data="250"/>
  439. <action application="hangup"/>
  440. </condition>
  441. </extension>
  442. <extension name="video_record">
  443. <condition field="destination_number" expression="^9993$">
  444. <action application="answer"/>
  445. <action application="record_fsv" data="/tmp/testrecord.fsv"/>
  446. </condition>
  447. </extension>
  448. <extension name="video_playback">
  449. <condition field="destination_number" expression="^9994$">
  450. <action application="answer"/>
  451. <action application="play_fsv" data="/tmp/testrecord.fsv"/>
  452. </condition>
  453. </extension>
  454. <extension name="delay_echo">
  455. <condition field="destination_number" expression="^9995$">
  456. <action application="answer"/>
  457. <action application="delay_echo" data="5000"/>
  458. </condition>
  459. </extension>
  460. <extension name="echo">
  461. <condition field="destination_number" expression="^9996$">
  462. <action application="answer"/>
  463. <action application="echo"/>
  464. </condition>
  465. </extension>
  466. <extension name="milliwatt">
  467. <condition field="destination_number" expression="^9997$">
  468. <action application="answer"/>
  469. <action application="playback" data="tone_stream://%(10000,0,1004);loops=-1"/>
  470. </condition>
  471. </extension>
  472. <extension name="tone_stream">
  473. <condition field="destination_number" expression="^9998$">
  474. <action application="answer"/>
  475. <action application="playback" data="tone_stream://path=${base_dir}/conf/tetris.ttml;loops=10"/>
  476. </condition>
  477. </extension>
  478. <!--
  479. You will no longer hear the bong tone. The wav file is playing stating the call is secure.
  480. The file will not play unless you have both TLS and SRTP active.
  481. -->
  482. <extension name="hold_music">
  483. <condition field="destination_number" expression="^9999$"/>
  484. <condition field="${rtp_has_crypto}" expression="^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$">
  485. <action application="answer"/>
  486. <action application="execute_extension" data="is_secure XML features"/>
  487. <action application="playback" data="$${hold_music}"/>
  488. <anti-action application="answer"/>
  489. <anti-action application="playback" data="$${hold_music}"/>
  490. </condition>
  491. </extension>
  492. <!--
  493. You can place files in the default directory to get included.
  494. -->
  495. <X-PRE-PROCESS cmd="include" data="default/*.xml"/>
  496. <!--
  497. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  498. Anything you put below this line will usually get ignored due to the file in
  499. default/99999_enum.xml as it will transfer the call to the enum dialplan.
  500. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  501. -->
  502. <!--
  503. This is an example of how to override the RURI on an outgoing invite to a registered contact.
  504. -->
  505. <!--
  506. <extension name="refer">
  507. <condition field="${sip_refer_to}">
  508. <expression><![CDATA[<sip:${destination_number}@${domain_name}>]]></expression>
  509. </condition>
  510. <condition field="${sip_refer_to}">
  511. <expression><![CDATA[<sip:(.*)@(.*)>]]></expression>
  512. <action application="set" data="refer_user=$1"/>
  513. <action application="set" data="refer_domain=$2"/>
  514. <action application="info"/>
  515. <action application="bridge" data="sofia/${use_profile}/${refer_user}@${refer_domain}"/>
  516. </condition>
  517. </extension>
  518. <extension name="ruri">
  519. <condition field="destination_number" expression="^ruri$">
  520. <action application="bridge" data="sofia/${ruri_profile}/${ruri_user}${regex(${sofia_contact(${ruri_contact})}|^[^\@]+(.*)|%1)}"/>
  521. </condition>
  522. </extension>
  523. <extension name="7004">
  524. <condition field="destination_number" expression="^7004$">
  525. <action application="set" data="ruri_profile=default"/>
  526. <action application="set" data="ruri_user=2000"/>
  527. <action application="set" data="ruri_contact=1001@${domain_name}"/>
  528. <action application="execute_extension" data="ruri"/>
  529. </condition>
  530. </extension>
  531. -->
  532. <!-- SEE WARNING ABOVE IF YOU ARE TRYING TO ADD EXTENSIONS HERE! -->
  533. </context>
  534. </include>