freeswitch配置记录

2018-09-11 03:12:28   工作备份

 

1、conf/vars.xml

  1. <X-PRE-PROCESS cmd="set" data="default_password=11111111"/>
  2. <X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/>
  3. <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/>
  4. <X-PRE-PROCESS cmd="set" data="sound_prefix=$${sounds_dir}"/>

2、conf/internal.xml

  1. <param name="accept-blind-reg" value="true"/>
  2. <param name="ws-binding" value=":5066"/>
  3. <param name="wss-binding" value=":7443"/>
  4. <param name="apply-candidate-acl" value="ipv4"/>

3、autoload_configs/event_socket.conf.xml 设置主控

  1. <configuration name="event_socket.conf" description="Socket Client">
  2. <settings>
  3. <param name="nat-map" value="false"/>
  4. <param name="listen-ip" value="::"/>
  5. <param name="listen-port" value="8021"/>
  6. <param name="password" value="ClueCon"/>
  7. <param name="apply-inbound-acl" value="lan"/>
  8. <!--<param name="stop-on-bind-error" value="true"/>-->
  9. </settings>
  10. </configuration>

4、acl.conf.xml

  1. <list name="ipv4" default="allow">
  2. <node type="allow" cidr="0.0.0.0/0"/>
  3. </list>

5、 话单处理(取消)

  1. C:\Program Files\FreeSWITCH\conf\autoload_configs\modules.conf.xml中释放<load module="mod_xml_cdr"/> 的注释。
  2.  C:\Program Files\FreeSWITCH\conf\autoload_configs\xml_cdr.conf.xml中修改注释,将
  3. <param name="url" value="http://localhost:7786/huaDan/postHuaDan"/>中的value指向你的HTTP服务器地址。

6、 开启录音功能 conf/dialplan/default.xml、conf/dialplan/public/outbound_did.xml(取消)

  1. conf/dialplan/outbound_did.xml
  2. <include>
  3. <extension name="Local_inbound_deal">
  4. <condition field="destination_number" expression="^([0-9]\d+)$">
  5. <action application="export" data="dialed_extension=$1"/>
  6. <action application="set" data="call_timeout=30"/>
  7. <action application="set" data="continue_on_fail=true"/>
  8. <action application="export" data="record_sample_rate=8000"/>
  9. <action application="export" data="RECORD_STEREO=true"/>
  10. <action application="set" data="media_bug_answer_req=true"/>
  11. <action application="set" data="RECORD_TITLE=Recording ${destination_number} ${caller_id_number} ${strftime(%Y-%m-%d %H:%M)}"/>
  12. <action application="set" data="RECORD_COPYRIGHT=(c) 2011"/>
  13. <action application="set" data="RECORD_SOFTWARE=FreeSWITCH"/>
  14. <action application="set" data="RECORD_ARTIST=FreeSWITCH"/>
  15. <action application="set" data="RECORD_COMMENT=FreeSWITCH"/>
  16. <action application="set" data="RECORD_DATE=${strftime(%Y-%m-%d %H:%M)}"/>
  17. <!-- <action application="set" data="RECORD_STEREO=true"/> -->
  18. <action application="record_session" data="$${base_dir}/recordings/${strftime(%Y)}/${strftime(%m%d)}/${caller_id_number}/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.mp3"/>
  19. <action application="export" data="hangup_after_bridge=false"/>
  20. <action application="socket" data="192.168.33.109:8084 async full"/>
  21. </condition>
  22. </extension>
  23. </include>
  24. conf/dialplan/public/default.xml
  25. <extension name="Local_ExtensionEsl">
  26. <condition field="destination_number" expression="^([0-9]\d+)$">
  27. <action application="info"/>
  28. <!-- <action application="answer"/> -->
  29. <action application="export" data="dialed_extension=$1"/>
  30. <action application="set" data="call_timeout=30"/>
  31. <action application="set" data="continue_on_fail=true"/>
  32. <action application="export" data="record_sample_rate=8000"/>
  33. <action application="export" data="RECORD_STEREO=true"/>
  34. <action application="set" data="media_bug_answer_req=true"/>
  35. <action application="set" data="RECORD_TITLE=Recording ${destination_number} ${caller_id_number} ${strftime(%Y-%m-%d %H:%M)}"/>
  36. <action application="set" data="RECORD_COPYRIGHT=(c) 2011"/>
  37. <action application="set" data="RECORD_SOFTWARE=FreeSWITCH"/>
  38. <action application="set" data="RECORD_ARTIST=FreeSWITCH"/>
  39. <action application="set" data="RECORD_COMMENT=FreeSWITCH"/>
  40. <action application="set" data="RECORD_DATE=${strftime(%Y-%m-%d %H:%M)}"/>
  41. <!-- <action application="set" data="RECORD_STEREO=true"/> -->
  42. <action application="record_session" data="$${base_dir}/recordings/${strftime(%Y)}/${strftime(%m%d)}/${caller_id_number}/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.mp3"/>
  43. <action application="export" data="park_after_bridge=true"/>
  44. <action application="export" data="hangup_after_bridge=false"/>
  45. <action application="socket" data="192.168.33.109:8084 async full"/>
  46. </condition>
  47. </extension>

7.conf/autoload_configs/modules.conf.xml 动态配置注册

  1. //打开注释
  2. <load module="mod_xml_curl"/>

8.conf/autoload_configs/xml_curl.conf.xml

  1. <binding name="directory">
  2. <param name="gateway-url" value="http://192.168.33.109/api/fs_curl"/>
  3. </binding>

9.编译地址:https://blog.csdn.net/u012121105/article/details/74238595
问题解决:https://blog.csdn.net/singleroot/article/details/52298620