default.xml 35 KB

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