freeswitch.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <?xml version="1.0"?>
  2. <document type="freeswitch/xml">
  3. <X-PRE-PROCESS cmd="set" data="auto_answer=false"/>
  4. <X-PRE-PROCESS cmd="set" data="domain=$${local_ip_v4}"/>
  5. <X-PRE-PROCESS cmd="set" data="hold_music=local_stream://moh"/>
  6. <X-PRE-PROCESS cmd="set" data="codec_prefs=G7221@32000h,G7221@16000h,G722,PCMU,PCMA,GSM"/>
  7. <X-PRE-PROCESS cmd="set" data="external_rtp_ip=stun:stun.freeswitch.org"/>
  8. <X-PRE-PROCESS cmd="set" data="external_sip_ip=stun:stun.freeswitch.org"/>
  9. <X-PRE-PROCESS cmd="set" data="console_loglevel=info"/>
  10. <X-PRE-PROCESS cmd="set" data="us-ring=%(2000, 4000, 440.0, 480.0)"/>
  11. <X-PRE-PROCESS cmd="set" data="bong-ring=v=-7;%(100,0,941.0,1477.0);v=-7;>=2;+=.1;%(1400,0,350,440)"/>
  12. <X-PRE-PROCESS cmd="set" data="sit=%(274,0,913.8);%(274,0,1370.6);%(380,0,1776.7)"/>
  13. <section name="configuration" description="Various Configuration">
  14. <configuration name="cdr_csv.conf" description="CDR CSV Format">
  15. <settings>
  16. <param name="default-template" value="example"/>
  17. <param name="rotate-on-hup" value="true"/>
  18. <param name="legs" value="a"/>
  19. </settings>
  20. <templates>
  21. <template name="example">"${caller_id_name}","${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${uuid}","${bleg_uuid}","${accountcode}","${read_codec}","${write_codec}"</template>
  22. </templates>
  23. </configuration>
  24. <configuration name="console.conf" description="Console Logger">
  25. <mappings>
  26. <map name="all" value="console,debug,info,notice,warning,err,crit,alert"/>
  27. </mappings>
  28. <settings>
  29. <param name="colorize" value="true"/>
  30. <param name="loglevel" value="$${console_loglevel}"/>
  31. </settings>
  32. </configuration>
  33. <configuration name="enum.conf" description="ENUM Module">
  34. <settings>
  35. <param name="default-root" value="e164.org"/>
  36. <param name="default-isn-root" value="freenum.org"/>
  37. <param name="query-timeout" value="10"/>
  38. <param name="auto-reload" value="true"/>
  39. </settings>
  40. <routes>
  41. <route service="E2U+SIP" regex="sip:(.*)" replace="sofia/softphone/$1"/>
  42. </routes>
  43. </configuration>
  44. <configuration name="local_stream.conf" description="stream files from local dir">
  45. <directory name="moh/48000" path="$${base_dir}/sounds/music/48000">
  46. <param name="rate" value="48000"/>
  47. <param name="shuffle" value="true"/>
  48. <param name="channels" value="1"/>
  49. <param name="interval" value="10"/>
  50. <param name="timer-name" value="soft"/>
  51. </directory>
  52. </configuration>
  53. <configuration name="logfile.conf" description="File Logging">
  54. <settings>
  55. <param name="rotate-on-hup" value="true"/>
  56. </settings>
  57. <profiles>
  58. <profile name="default">
  59. <settings>
  60. </settings>
  61. <mappings>
  62. <map name="all" value="debug,info,notice,warning,err,crit,alert"/>
  63. </mappings>
  64. </profile>
  65. </profiles>
  66. </configuration>
  67. <configuration name="modules.conf" description="Modules">
  68. <modules>
  69. <load module="mod_console"/>
  70. <load module="mod_logfile"/>
  71. <load module="mod_enum"/>
  72. <load module="mod_cdr_csv"/>
  73. <load module="mod_sofia"/>
  74. <load module="mod_loopback"/>
  75. <load module="mod_commands"/>
  76. <load module="mod_dptools"/>
  77. <load module="mod_dialplan_xml"/>
  78. <load module="mod_spandsp"/>
  79. <load module="mod_ilbc"/>
  80. <load module="mod_speex"/>
  81. <load module="mod_silk"/>
  82. <load module="mod_siren"/>
  83. <load module="mod_sndfile"/>
  84. <load module="mod_tone_stream"/>
  85. <load module="mod_local_stream"/>
  86. <load module="mod_portaudio"/>
  87. <load module="mod_event_socket"/>
  88. </modules>
  89. </configuration>
  90. <configuration name="portaudio.conf" description="Soundcard Endpoint">
  91. <settings>
  92. <param name="indev" value=""/>
  93. <!-- device to use for output -->
  94. <param name="outdev" value=""/>
  95. <!--<param name="ringdev" value=""/>-->
  96. <param name="ring-file" value="tone_stream://%(2000,4000,440.0,480.0);loops=20"/>
  97. <param name="ring-interval" value="5"/>
  98. <param name="hold-file" value="$${hold_music}"/>
  99. <!--<param name="timer-name" value="soft"/>-->
  100. <param name="dialplan" value="XML"/>
  101. <param name="cid-name" value="$${outbound_caller_name}"/>
  102. <param name="cid-num" value="$${outbound_caller_number}"/>
  103. <param name="sample-rate" value="48000"/>
  104. <param name="codec-ms" value="10"/>
  105. </settings>
  106. </configuration>
  107. <configuration name="event_socket.conf" description="Socket Client">
  108. <settings>
  109. <param name="nat-map" value="false"/>
  110. <param name="listen-ip" value="127.0.0.1"/>
  111. <param name="listen-port" value="8022"/>
  112. <param name="password" value="ClueCon"/>
  113. </settings>
  114. </configuration>
  115. <configuration name="post_load_modules.conf" description="Modules">
  116. <modules>
  117. </modules>
  118. </configuration>
  119. <configuration name="sofia.conf" description="sofia Endpoint">
  120. <global_settings>
  121. <param name="log-level" value="0"/>
  122. <param name="auto-restart" value="true"/>
  123. <param name="debug-presence" value="0"/>
  124. </global_settings>
  125. <profiles>
  126. <profile name="softphone">
  127. <settings>
  128. <!--<param name="media-option" value="bypass-media-after-att-xfer"/>-->
  129. <param name="user-agent-string" value="FreeSWITCH/FSComm"/>
  130. <!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> -->
  131. <param name="debug" value="0"/>
  132. <param name="sip-trace" value="no"/>
  133. <param name="context" value="public"/>
  134. <param name="rfc2833-pt" value="101"/>
  135. <!-- port to bind to for sip traffic -->
  136. <param name="sip-port" value="12345"/>
  137. <param name="dialplan" value="XML"/>
  138. <param name="dtmf-duration" value="100"/>
  139. <param name="codec-prefs" value="$${codec_prefs}"/>
  140. <param name="use-rtp-timer" value="true"/>
  141. <param name="rtp-timer-name" value="soft"/>
  142. <!-- ip address to use for rtp, DO NOT USE HOSTNAMES ONLY IP ADDRESSES -->
  143. <param name="rtp-ip" value="$${local_ip_v4}"/>
  144. <!-- ip address to bind to, DO NOT USE HOSTNAMES ONLY IP ADDRESSES -->
  145. <param name="sip-ip" value="$${local_ip_v4}"/>
  146. <param name="hold-music" value="$${hold_music}"/>
  147. <param name="apply-nat-acl" value="rfc1918"/>
  148. <!--<param name="enable-timer" value="false"/>-->
  149. <!--<param name="enable-100rel" value="true"/>-->
  150. <!--<param name="minimum-session-expires" value="120"/>-->
  151. <!--<param name="dtmf-type" value="info"/>-->
  152. <param name="manage-presence" value="false"/>
  153. <!--<param name="bitpacking" value="aal2"/> -->
  154. <param name="max-proceeding" value="3"/>
  155. <!--<param name="session-timeout" value="120"/>-->
  156. <!--set to 'greedy' if you want your codec list to take precedence -->
  157. <param name="inbound-codec-negotiation" value="generous"/>
  158. <!-- if you want to send any special bind params of your own -->
  159. <!--<param name="bind-params" value="transport=udp"/>-->
  160. <!--Uncomment to let calls hit the dialplan *before* you decide if the codec is ok-->
  161. <!--<param name="inbound-late-negotiation" value="true"/>-->
  162. <!--<param name="accept-blind-reg" value="true"/> -->
  163. <!--<param name="accept-blind-auth" value="true"/> -->
  164. <!--<param name="suppress-cng" value="true"/> -->
  165. <param name="nonce-ttl" value="60"/>
  166. <!--<param name="NDLB-broken-auth-hash" value="true"/>-->
  167. <!--<param name="NDLB-received-in-nat-reg-contact" value="true"/>-->
  168. <param name="auth-calls" value="false"/>
  169. <param name="auth-all-packets" value="false"/>
  170. <param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
  171. <param name="ext-sip-ip" value="$${external_sip_ip}"/>
  172. <!-- rtp inactivity timeout -->
  173. <param name="rtp-timeout-sec" value="300"/>
  174. <param name="rtp-hold-timeout-sec" value="1800"/>
  175. <!-- VAD choose one (out is a good choice); -->
  176. <!-- <param name="vad" value="in"/> -->
  177. <!-- <param name="vad" value="out"/> -->
  178. <!-- <param name="vad" value="both"/> -->
  179. <param name="disable-register" value="true"/>
  180. <!--<param name="NDLB-force-rport" value="true"/>-->
  181. <param name="challenge-realm" value="auto_from"/>
  182. <!--<param name="disable-rtp-auto-adjust" value="true"/>-->
  183. <!--<param name="inbound-use-callid-as-uuid" value="true"/>-->
  184. <!--<param name="outbound-use-uuid-as-callid" value="true"/>-->
  185. <!--<param name="auto-rtp-bugs" data="clear"/>-->
  186. </settings>
  187. </profile>
  188. </profiles>
  189. </configuration>
  190. <configuration name="switch.conf" description="Core Configuration">
  191. <cli-keybindings>
  192. <key name="1" value="help"/>
  193. <key name="2" value="status"/>
  194. <key name="3" value="pa answer"/>
  195. <key name="4" value="pa hangup"/>
  196. <key name="5" value="sofia status"/>
  197. <key name="6" value="reloadxml"/>
  198. <key name="7" value="console loglevel 0"/>
  199. <key name="8" value="console loglevel 7"/>
  200. <key name="9" value="sofia status profile softphone"/>
  201. <key name="10" value="fsctl pause"/>
  202. <key name="11" value="fsctl resume"/>
  203. <key name="12" value="version"/>
  204. </cli-keybindings>
  205. <settings>
  206. <param name="colorize-console" value="true"/>
  207. <param name="max-sessions" value="20"/>
  208. <param name="sessions-per-second" value="5"/>
  209. <param name="loglevel" value="debug"/>
  210. <param name="crash-protection" value="false"/>
  211. <param name="dump-cores" value="yes"/>
  212. <param name="rtp-start-port" value="16384"/>
  213. <param name="rtp-end-port" value="16484"/>
  214. </settings>
  215. </configuration>
  216. </section>
  217. <section name="dialplan" description="Regex/XML Dialplan">
  218. <context name="default">
  219. <extension name="codec_and_sip_uri">
  220. <condition field="destination_number" expression="^sip:(.*):(.*)$">
  221. <action application="export" data="origination_caller_id_number=${fscomm_caller_id_num}"/>
  222. <action application="export" data="origination_caller_id_name=${fscomm_caller_id_name}"/>
  223. <action application="info"/>
  224. <action application="bridge" data="{absolute_codec_string=$1}sofia/softphone/$2"/>
  225. </condition>
  226. </extension>
  227. <extension name="sip_uri">
  228. <condition field="destination_number" expression="^sip:(.*)$">
  229. <action application="export" data="origination_caller_id_number=${fscomm_caller_id_num}"/>
  230. <action application="export" data="origination_caller_id_name=${fscomm_caller_id_name}"/>
  231. <action application="info"/>
  232. <action application="bridge" data="sofia/softphone/$1"/>
  233. </condition>
  234. </extension>
  235. <extension name="codec_and_number">
  236. <condition field="destination_number" expression="^(.*):(.*)@(.*)$">
  237. <action application="export" data="origination_caller_id_number=${fscomm_caller_id_num}"/>
  238. <action application="export" data="origination_caller_id_name=${fscomm_caller_id_name}"/>
  239. <action application="info"/>
  240. <action application="bridge" data="{absolute_codec_string=$1}sofia/gateway/$3/$2"/>
  241. </condition>
  242. </extension>
  243. <extension name="number">
  244. <condition field="destination_number" expression="^(.*)@(.*)$">
  245. <action application="export" data="origination_caller_id_number=${fscomm_caller_id_num}"/>
  246. <action application="export" data="origination_caller_id_name=${fscomm_caller_id_name}"/>
  247. <action application="info"/>
  248. <action application="bridge" data="sofia/gateway/$2/$1"/>
  249. </condition>
  250. </extension>
  251. <extension name="number">
  252. <condition field="destination_number" expression="^(.*)$">
  253. <!-- Default gateway is set by FSComm when default account is selected -->
  254. <action application="export" data="origination_caller_id_number=${fscomm_caller_id_num}"/>
  255. <action application="export" data="origination_caller_id_name=${fscomm_caller_id_name}"/>
  256. <action application="info"/>
  257. <action application="bridge" data="sofia/gateway/${default_gateway}/$1"/>
  258. </condition>
  259. </extension>
  260. </context>
  261. <context name="public">
  262. <extension name="public_extensions">
  263. <condition field="$${auto_answer}" expression="^true$"/>
  264. <condition field="destination_number" expression="^(.*)$">
  265. <action application="export" data="origination_caller_id_number=${fscomm_caller_id_num}"/>
  266. <action application="export" data="origination_caller_id_name=${fscomm_caller_id_name}"/>
  267. <action application="info"/>
  268. <action application="bridge" data="portaudio/auto_answer"/>
  269. </condition>
  270. </extension>
  271. <extension name="public_extensions">
  272. <condition field="${sip_to_params}" expression="intercom=true"/>
  273. <condition field="${alert_info}" expression="Ring;Answer"/>
  274. <condition field="destination_number" expression="^(.*)$">
  275. <action application="export" data="origination_caller_id_number=${fscomm_caller_id_num}"/>
  276. <action application="export" data="origination_caller_id_name=${fscomm_caller_id_name}"/>
  277. <action application="info"/>
  278. <action application="bridge" data="portaudio/auto_answer"/>
  279. </condition>
  280. </extension>
  281. <extension name="public_extensions">
  282. <condition field="destination_number" expression="^(.*)$">
  283. <action application="export" data="origination_caller_id_number=${fscomm_caller_id_num}"/>
  284. <action application="export" data="origination_caller_id_name=${fscomm_caller_id_name}"/>
  285. <action application="info"/>
  286. <action application="set" data="ringback=${us-ring}"/>
  287. <action application="pre_answer"/>
  288. <action application="bridge" data="portaudio"/>
  289. </condition>
  290. </extension>
  291. </context>
  292. </section>
  293. </document>