2
0

freeswitch.xml 11 KB

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