2
0

freeswitch.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. </modules>
  87. </configuration>
  88. <configuration name="portaudio.conf" description="Soundcard Endpoint">
  89. <settings>
  90. <param name="indev" value=""/>
  91. <!-- device to use for output -->
  92. <param name="outdev" value=""/>
  93. <!--<param name="ringdev" value=""/>-->
  94. <param name="ring-file" value="tone_stream://%(2000,4000,440.0,480.0);loops=20"/>
  95. <param name="ring-interval" value="5"/>
  96. <param name="hold-file" value="$${hold_music}"/>
  97. <!--<param name="timer-name" value="soft"/>-->
  98. <param name="dialplan" value="XML"/>
  99. <param name="cid-name" value="$${outbound_caller_name}"/>
  100. <param name="cid-num" value="$${outbound_caller_number}"/>
  101. <param name="sample-rate" value="48000"/>
  102. <param name="codec-ms" value="10"/>
  103. </settings>
  104. </configuration>
  105. <configuration name="post_load_modules.conf" description="Modules">
  106. <modules>
  107. </modules>
  108. </configuration>
  109. <configuration name="sofia.conf" description="sofia Endpoint">
  110. <global_settings>
  111. <param name="log-level" value="0"/>
  112. <param name="auto-restart" value="true"/>
  113. <param name="debug-presence" value="0"/>
  114. </global_settings>
  115. <profiles>
  116. <profile name="softphone">
  117. <gateways>
  118. <X-PRE-PROCESS cmd="include" data="accounts/*.xml"/>
  119. </gateways>
  120. <settings>
  121. <!--<param name="media-option" value="bypass-media-after-att-xfer"/>-->
  122. <!-- Can be set to "_undef_" to remove the User-Agent header -->
  123. <param name="user-agent-string" value="FreeSWITCH/SoftPhone"/>
  124. <!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> -->
  125. <param name="debug" value="0"/>
  126. <param name="sip-trace" value="no"/>
  127. <param name="context" value="public"/>
  128. <param name="rfc2833-pt" value="101"/>
  129. <!-- port to bind to for sip traffic -->
  130. <param name="sip-port" value="12345"/>
  131. <param name="dialplan" value="XML"/>
  132. <param name="dtmf-duration" value="100"/>
  133. <param name="codec-prefs" value="$${codec_prefs}"/>
  134. <param name="use-rtp-timer" value="true"/>
  135. <param name="rtp-timer-name" value="soft"/>
  136. <!-- ip address to use for rtp, DO NOT USE HOSTNAMES ONLY IP ADDRESSES -->
  137. <param name="rtp-ip" value="$${local_ip_v4}"/>
  138. <!-- ip address to bind to, DO NOT USE HOSTNAMES ONLY IP ADDRESSES -->
  139. <param name="sip-ip" value="$${local_ip_v4}"/>
  140. <param name="hold-music" value="$${hold_music}"/>
  141. <param name="apply-nat-acl" value="rfc1918"/>
  142. <!--<param name="enable-timer" value="false"/>-->
  143. <!--<param name="enable-100rel" value="true"/>-->
  144. <!--<param name="minimum-session-expires" value="120"/>-->
  145. <!--<param name="dtmf-type" value="info"/>-->
  146. <param name="manage-presence" value="false"/>
  147. <!--<param name="bitpacking" value="aal2"/> -->
  148. <param name="max-proceeding" value="3"/>
  149. <!--<param name="session-timeout" value="120"/>-->
  150. <!--set to 'greedy' if you want your codec list to take precedence -->
  151. <param name="inbound-codec-negotiation" value="generous"/>
  152. <!-- if you want to send any special bind params of your own -->
  153. <!--<param name="bind-params" value="transport=udp"/>-->
  154. <!--Uncomment to let calls hit the dialplan *before* you decide if the codec is ok-->
  155. <!--<param name="inbound-late-negotiation" value="true"/>-->
  156. <!--<param name="accept-blind-reg" value="true"/> -->
  157. <!--<param name="accept-blind-auth" value="true"/> -->
  158. <!--<param name="suppress-cng" value="true"/> -->
  159. <param name="nonce-ttl" value="60"/>
  160. <!--<param name="NDLB-broken-auth-hash" value="true"/>-->
  161. <!--<param name="NDLB-received-in-nat-reg-contact" value="true"/>-->
  162. <param name="auth-calls" value="false"/>
  163. <param name="auth-all-packets" value="false"/>
  164. <param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
  165. <param name="ext-sip-ip" value="$${external_sip_ip}"/>
  166. <!-- rtp inactivity timeout -->
  167. <param name="rtp-timeout-sec" value="300"/>
  168. <param name="rtp-hold-timeout-sec" value="1800"/>
  169. <!-- VAD choose one (out is a good choice); -->
  170. <!-- <param name="vad" value="in"/> -->
  171. <!-- <param name="vad" value="out"/> -->
  172. <!-- <param name="vad" value="both"/> -->
  173. <param name="disable-register" value="true"/>
  174. <!--<param name="NDLB-force-rport" value="true"/>-->
  175. <param name="challenge-realm" value="auto_from"/>
  176. <!--<param name="disable-rtp-auto-adjust" value="true"/>-->
  177. <!--<param name="inbound-use-callid-as-uuid" value="true"/>-->
  178. <!--<param name="outbound-use-uuid-as-callid" value="true"/>-->
  179. <!--<param name="auto-rtp-bugs" data="clear"/>-->
  180. </settings>
  181. </profile>
  182. </profiles>
  183. </configuration>
  184. <configuration name="switch.conf" description="Core Configuration">
  185. <cli-keybindings>
  186. <key name="1" value="help"/>
  187. <key name="2" value="status"/>
  188. <key name="3" value="pa answer"/>
  189. <key name="4" value="pa hangup"/>
  190. <key name="5" value="sofia status"/>
  191. <key name="6" value="reloadxml"/>
  192. <key name="7" value="console loglevel 0"/>
  193. <key name="8" value="console loglevel 7"/>
  194. <key name="9" value="sofia status profile softphone"/>
  195. <key name="10" value="fsctl pause"/>
  196. <key name="11" value="fsctl resume"/>
  197. <key name="12" value="version"/>
  198. </cli-keybindings>
  199. <settings>
  200. <param name="colorize-console" value="true"/>
  201. <param name="max-sessions" value="20"/>
  202. <param name="sessions-per-second" value="5"/>
  203. <param name="loglevel" value="debug"/>
  204. <param name="crash-protection" value="false"/>
  205. <param name="dump-cores" value="yes"/>
  206. <param name="rtp-start-port" value="16384"/>
  207. <param name="rtp-end-port" value="16484"/>
  208. </settings>
  209. </configuration>
  210. </section>
  211. <section name="dialplan" description="Regex/XML Dialplan">
  212. <context name="default">
  213. <extension name="codec_and_sip_uri">
  214. <condition field="destination_number" expression="^sip:(.*):(.*)$">
  215. <action application="bridge" data="{absolute_codec_string=$1}sofia/softphone/$2"/>
  216. </condition>
  217. </extension>
  218. <extension name="sip_uri">
  219. <condition field="destination_number" expression="^sip:(.*)$">
  220. <action application="bridge" data="sofia/softphone/$1"/>
  221. </condition>
  222. </extension>
  223. <extension name="codec_and_number">
  224. <condition field="destination_number" expression="^(.*):(.*)@(.*)$">
  225. <action application="bridge" data="{absolute_codec_string=$1}sofia/gateway/$3/$2"/>
  226. </condition>
  227. </extension>
  228. <extension name="number">
  229. <condition field="destination_number" expression="^(.*)@(.*)$">
  230. <action application="bridge" data="sofia/gateway/$2/$1"/>
  231. </condition>
  232. </extension>
  233. <extension name="number">
  234. <condition field="destination_number" expression="^(.*)$">
  235. <action application="bridge" data="sofia/gateway/${default_gateway}/$1"/>
  236. </condition>
  237. </extension>
  238. </context>
  239. <context name="public">
  240. <extension name="public_extensions">
  241. <condition field="$${auto_answer}" expression="^true$"/>
  242. <condition field="destination_number" expression="^(.*)$">
  243. <action application="info"/>
  244. <action application="bridge" data="portaudio/auto_answer"/>
  245. </condition>
  246. </extension>
  247. <extension name="public_extensions">
  248. <condition field="${sip_to_params}" expression="intercom=true"/>
  249. <condition field="${alert_info}" expression="Ring;Answer"/>
  250. <condition field="destination_number" expression="^(.*)$">
  251. <action application="info"/>
  252. <action application="bridge" data="portaudio/auto_answer"/>
  253. </condition>
  254. </extension>
  255. <extension name="public_extensions">
  256. <condition field="destination_number" expression="^(.*)$">
  257. <action application="info"/>
  258. <action application="set" data="ringback=${us-ring}"/>
  259. <action application="pre_answer"/>
  260. <action application="bridge" data="portaudio"/>
  261. </condition>
  262. </extension>
  263. </context>
  264. </section>
  265. </document>