Advertisement
highsea

学习笔记freeswitch

May 3rd, 2018
644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.67 KB | None | 0 0
  1.  
  2. ### freeswitch 错误代码
  3.  
  4. https://freeswitch.org/confluence/display/FREESWITCH/Hangup+Cause+Code+Table
  5.  
  6. #### xLite连接 asterisk| fs 提示sip408错误
  7.  
  8. 1.sip408应答代码全文
  9.  
  10. 408 Request Timeout
  11. 在一段时间内,服务器不能产生一个终结应答,例如,如果它无法及时决定用户的位置。客户端可以在稍后不更改请求的内容然后重新尝试请求。
  12. 2.原因:造成无法连接的原因一般是linux防火墙造成。
  13.  
  14. 3.解决方案:
  15.  
  16. 在linux终端执行>setup
  17.  
  18. 选择防火墙直接关闭即可,如果是运行在公网上的服务器,可以选择防火墙中的定制开启相应的端口即可。
  19.  
  20. sip.conf 默认配置端口为5060
  21.  
  22. 1. 永久性生效
  23.  
  24. 开启: chkconfig iptables on
  25.  
  26. 关闭: chkconfig iptables off
  27.  
  28. 2. 即时生效,重启后失效
  29.  
  30. 开启: service iptables start
  31.  
  32. 关闭: service iptables stop
  33.  
  34. 1. 永久有效
  35.  
  36. 修改 /etc/selinux/config 文件中的 SELINUX="" 为 disabled ,然后重启。
  37.  
  38. 2. 即时生效
  39.  
  40. setenforce 0
  41.  
  42. ### fs 添加用户
  43.  
  44. fs 默认只有 20 个用户
  45.  
  46. 1. 进入 directory 目录
  47.  
  48. ```
  49. cd etc/directory/default/
  50. cp 1000.xml 1234.xml
  51. //修改 1000 为 1234
  52. //修改 effective_caller_id_name 为 “your name”
  53. <variable name="effective_caller_id_name" value="highsea"/>
  54. ```
  55.  
  56. 2. dialplan 拨号计划目录
  57.  
  58. 找到 destination_number 修改 正则,比如 ```^(10[01][0-9]|1234)$```
  59.  
  60. ```
  61. cd etc/dialplan/
  62. vim default.xml
  63. <condition field="destination_number" expression="^(10[01][0-9])$">
  64. ```
  65.  
  66. 3. reloadxml + 重启 fs
  67.  
  68.  
  69. ### fs 打开 wss websocket 链接
  70.  
  71. [freeSWITCH安装、配置与局域网测试](https://blog.csdn.net/foruok/article/details/74287842)
  72.  
  73. /etc/freeswitch/sip_profiles/internal.xml
  74. /etc/freeswitch/vars.xml
  75.  
  76.  
  77. 1. 修改vars.xml,加入:
  78.  
  79. ```
  80. <X-PRE-PROCESS cmd=="set" data="proxy_media=true"/>
  81. ```
  82.  
  83. conf/var.xml中有两个开关,要设置true
  84.  
  85. <X-PRE-PROCESS cmd="set" data="internal_ssl_enable=true"/>
  86. <X-PRE-PROCESS cmd="set" data="external_ssl_enable=true"/>
  87.  
  88.  
  89. 2. 修改sip_profiles/internal.xml,设置 **inbound-proxy-media** 和 **inbound-late-negotiation** 为true ,类似下面:
  90.  
  91. ```
  92. <!--Uncomment to set all inbound calls to proxy media mode-->
  93. <param name="inbound-proxy-media" value="true"/>
  94.  
  95. <!-- Let calls hit the dialplan before selecting codec for the a-leg -->
  96. <param name="inbound-late-negotiation" value="true"/>
  97. ```
  98.  
  99. SIP 服务的端口是 5060 ,WebSocket(ws)服务的端口是 5066 , wss 端口是 7443 。
  100.  
  101. 3. 局域网调试 打开 autoload_configs
  102.  
  103. ```
  104.  
  105. /etc/freeswitch/autoload_configs/acl.conf.xml
  106.  
  107. <list name="localnet.auto" default="allow">
  108. </list>
  109. ```
  110.  
  111. #### 测试 WebSocket
  112.  
  113. sip over websoket
  114.  
  115. nginx 代理 wss 协议服务(头部也是 http)
  116.  
  117.  
  118. ````
  119. // ws://192.168.1.43:5066
  120. //
  121. var ws = new WebSocket("wss://192.168.1.43:7443");
  122.  
  123. ws.onopen = function(evt) {
  124. console.log("Connection open ...");
  125. ws.send("Hello WebSockets!");
  126. };
  127.  
  128. ws.onmessage = function(evt) {
  129. console.log( "Received Message: " + evt.data);
  130. ws.close();
  131. };
  132.  
  133. ws.onclose = function(evt) {
  134. console.log("Connection closed.");
  135. };
  136.  
  137. ````
  138.  
  139. readyState属性返回实例对象的当前状态,共有四种。
  140.  
  141. CONNECTING:值为0,表示正在连接。
  142. OPEN:值为1,表示连接成功,可以通信了。
  143. CLOSING:值为2,表示连接正在关闭。
  144. CLOSED:值为3,表示连接已经关闭,或者打开连接失败。
  145.  
  146.  
  147.  
  148. ### 验证端口
  149.  
  150. 启动后,TCP 5060 、UDP 5060 、TCP 5066 、TCP 7443 这几个端口应该被监听。
  151.  
  152. 可以使用下面命令:
  153.  
  154. netstat -an | grep "5060"
  155.  
  156. netstat -an | grep "7443"
  157.  
  158. ### sip trunk 注册配置
  159.  
  160. 添加注册到imclub.com的sip server上,增加imsclub.com_sip_trunk.xml内容
  161.  
  162. ```
  163. freeswitch/conf/sip_profiles/external/imsclub.com_sip_trunk.xml
  164.  
  165. <include>
  166. <gateway name="imsclub.com">
  167. <param name="username" value="1019"/>
  168. <param name="password" value="1234"/>
  169. <param name="realm" value="imsclub.com"/>
  170. <param name="proxy" value="imsclub.com"/>
  171. </gateway>
  172. </include>
  173. ```
  174.  
  175.  
  176. > sip trunk基本原理
  177.  
  178. 注册到 freeswitch 的 internal 内部终端之间显然可以互相拨打,比如公司内部话机可以互相通话。但公司内部话机要想主动跟外部话机通话怎么办?这是就需要进过公司软交换中心跟 external 外部建立通信链路,而软交换中心跟 external 外部建立得通信链路可以是 SIP 或者 PSTN 的运营商网络链接。 Freeswitch 引入所谓网关概念来处理与外部链接问题,这种链路一般称之为 Trunk,故对应的有 SIP Trunk和 PSTN Trunk。
  179.  
  180. 在 Freeswitch 中配置在系统启动时注册到另一个sip服务器(即配置文件中所谓的gateway),此时 Freeswitch 作为一个 sip client ,跟其下面SIP终端注册到 freeswitch 是一样的。跟 SIP 终端一样,配置注册到网关需要 用户名,密码,以及要注册到的sip服务器ip地址和端口等参数。
  181.  
  182. 注册到网关的相关配置保存在目录
  183.  
  184. freeswitch/etc/freeswitch/sofia_profiles/external,
  185. freeswitch/etc/freeswitch/sip_profiles/external.xml 为freeswitch作为客户端注册到另一个网关的全局配置,
  186. freeswitch/etc/freeswitch/sip_profiles/external/ 目录下可以添加多个网关。
  187.  
  188.  
  189. 说明:
  190.  
  191. 1. 以上是基本配置,还有其他配置可参考 example.xml
  192. 2. 确保gateways 上的 sip server 已经添加指定的账号,否则毫无意义
  193.  
  194. 重启external生效
  195. `freeswitch@internal> sofia profile external restart`
  196.  
  197.  
  198. https://freeswitch.org/freeswitch-1-6-17-released/
  199.  
  200. wget https://f.s:8001/freeswitch-1.6.17.tar.gz --no-check-certificate
  201. wget https://f.s:8001/cd_sounds/freeswitch-sounds-music-8000-1.0.50.tar.gz --no-check-certificate
  202.  
  203.  
  204. wget https://f.s:8001/install_on_CentOS_6.5.sh --no-check-certificate
  205.  
  206. ### 添加网关配置
  207.  
  208. ```
  209.  
  210. find ./freeswitch/ -name sip_profiles
  211.  
  212. /root/freeswitch/etc/freeswitch/sip_profiles/external/
  213.  
  214. ```
  215.  
  216. ### FS常用指令
  217.  
  218. fsctl shutdown [cancel|elegant|asap|restart|now]
  219.  
  220. sofia profile external restart
  221.  
  222. sofia status profile internal reg
  223.  
  224. sofia status profile internal
  225.  
  226. show registrations
  227.  
  228. status profile external reg
  229.  
  230. sofia status
  231.  
  232.  
  233.  
  234. FreeSWITCH Version 1.6.17~64bit ( 64bit)
  235.  
  236.  
  237.  
  238. UP 0 years, 0 days, 0 hours, 32 minutes, 6 seconds, 205 milliseconds, 733 microseconds #启动时长
  239. FreeSWITCH (Version 1.6.17 64bit) is ready #主要版本号
  240. 20 session(s) since startup #自启动以来已经处理了多少个session
  241. 0 session(s) - peak 4, last 5min 0 #处理了4个
  242. 0 session(s) per Sec out of max 30, peak 2, last 5min 0 #最大支持每秒处理30个,可在配置文件里更改 cps(call per Second)
  243. 1000 session(s) max #最大允许多少个并发session
  244. min idle cpu 0.00/99.07 #最小及当前空闲CPU
  245. Current Stack Size/Max 240K/8192K #当前使用的堆栈空间以及系统预留的堆栈地址空间。
  246.  
  247. 为了调试方便,FreeSWITCH还在conf/autoload_configs/switch.conf.xml中定义了一些控制台快捷键。可以通过F1~F12这几个按键来使用它们(不过,在某些操作系统上,有些快捷键可能与操作系统相冲突,这时你就只能直接输入这些命令或重新定义它们了),也可以修改配置文件加入比较常用的命令(修改完毕后记着运行 reloadxml 命令使之生效)
  248.  
  249. ##freeswitch -waste
  250.  
  251.  
  252. ```
  253. ps aux | grep freeswitch
  254.  
  255. //呼叫注册用户 (显示来电 000000)
  256.  
  257. originate user/1003 &echo
  258.  
  259. ```
  260.  
  261. #### 开启SIP Trace: 日志
  262.  
  263. sofia global siptrace on
  264.  
  265.  
  266. 挂断原因代码表 https://freeswitch.org/confluence/display/FREESWITCH/Hangup+Cause+Code+Table
  267.  
  268.  
  269.  
  270. ### FreeSWITCH核心层定义了以下接口(来自switch_types.h,注释为作者所加):
  271.  
  272. typedef enum {
  273.  
  274. SWITCH_ENDPOINT_INTERFACE, //终点
  275. SWITCH_TIMER_INTERFACE, //定时器
  276. SWITCH_DIALPLAN_INTERFACE, //拨号计划 *
  277. SWITCH_CODEC_INTERFACE, //编码解码
  278. SWITCH_APPLICATION_INTERFACE, //应用程序
  279. SWITCH_API_INTERFACE, //命令
  280. SWITCH_FILE_INTERFACE, //文件
  281. SWITCH_SPEECH_INTERFACE, //语音合成 *
  282. SWITCH_DIRECTORY_INTERFACE, //用户目录
  283. SWITCH_CHAT_INTERFACE, //聊天计划 *
  284. SWITCH_SAY_INTERFACE, //分词短语 *
  285. SWITCH_ASR_INTERFACE, //语音识别 *
  286. SWITCH_MANAGEMENT_INTERFACE, //网管接口
  287. SWITCH_LIMIT_INTERFACE, //资源接口
  288. SWITCH_CHAT_APPLICATION_INTERFACE //聊天应用程序接口 *
  289.  
  290. } switch_module_interface_name_t;
  291.  
  292.  
  293.  
  294.  
  295. git clone –b release-1.6 https://freeswitch.org/stash/scm/sd/libvpx.git
  296. git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git
  297.  
  298. ### libvpx-1.7.0
  299. https://github.com/webmproject/libvpx/archive/v1.7.0/libvpx-1.7.0.tar.gz
  300. sed -i 's/cp -p/cp/' build/make/Makefile && mkdir libvpx-build && cd libvpx-build && ../configure --prefix=/usr --enable-shared --disable-static && make
  301.  
  302.  
  303. sed -i 's/cp -p/cp/' build/make/Makefile && mkdir libvpx-build && cd libvpx-build && ../configure --prefix=/usr --enable-pic --disable-static --enable-shared && make
  304.  
  305.  
  306.  
  307. ### yasm-1.3.0
  308. http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
  309. sed -i 's#) ytasm.*#)#' Makefile.in && ./configure --prefix=/usr && make
  310.  
  311.  
  312. ### Which-2.21 and Alternatives
  313. https://ftp.gnu.org/gnu/which/which-2.21.tar.gz
  314. ./configure --prefix=/usr && make
  315.  
  316. ### NASM-2.13.03
  317. http://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.xz
  318. tar -xf nasm-2.13.03.tar.xz --strip-components=1
  319.  
  320.  
  321. <include>
  322. <extension name="callout mjoys3h">
  323. <condition field="destination_number" expression="^0(\d+)$">
  324. <action application="bridge" data="sofia/gateway/mjoys3h/$1"/>
  325. </condition>
  326. </extension>
  327. </include>
  328.  
  329.  
  330.  
  331. <include>
  332.  
  333. <extension name="public_did">
  334.  
  335.  
  336.  
  337. 192.168.1.120
  338. 192.168.1.28 00:0C:29:5E:44:DB
  339.  
  340. ```
  341. [root@highsea-macos-vmware-centos6 ~]# tree ./freeswitch/ -L 4
  342. ./freeswitch/
  343. ├── bin # 可执行程序
  344. │   ├── freeswitch
  345. │   ├── fs_cli
  346. │   ├── fs_encode
  347. │   ├── fs_ivrd
  348. │   ├── fsxs
  349. │   ├── gentls_cert
  350. │   └── tone2wav
  351. ├── etc # 配置文件 (老版本 是 conf 目录)
  352. │   └── freeswitch # 配置conf 拨号dianplan 聊天chatplan 用户directory 分词phrase
  353. │   ├── autoload_configs # 模块级的配置文件,在系统启动时装入
  354. │   │   ├── abstraction.conf.xml
  355. │   │   ├── acl.conf.xml
  356. │   │   ├── alsa.conf.xml
  357. │   │   ├── amqp.conf.xml
  358. │   │   ├── avmd.conf.xml
  359. │   │   ├── blacklist.conf.xml
  360. │   │   ├── callcenter.conf.xml
  361. │   │   ├── cdr_csv.conf.xml
  362. │   │   ├── cdr_mongodb.conf.xml
  363. │   │   ├── cdr_pg_csv.conf.xml
  364. │   │   ├── cdr_sqlite.conf.xml
  365. │   │   ├── cepstral.conf.xml
  366. │   │   ├── cidlookup.conf.xml
  367. │   │   ├── conference.conf.xml
  368. │   │   ├── conference_layouts.conf.xml
  369. │   │   ├── console.conf.xml
  370. │   │   ├── db.conf.xml
  371. │   │   ├── dialplan_directory.conf.xml
  372. │   │   ├── dingaling.conf.xml
  373. │   │   ├── directory.conf.xml
  374. │   │   ├── distributor.conf.xml
  375. │   │   ├── easyroute.conf.xml
  376. │   │   ├── enum.conf.xml
  377. │   │   ├── erlang_event.conf.xml
  378. │   │   ├── event_multicast.conf.xml
  379. │   │   ├── event_socket.conf.xml
  380. │   │   ├── fax.conf.xml
  381. │   │   ├── fifo.conf.xml
  382. │   │   ├── format_cdr.conf.xml
  383. │   │   ├── graylog2.conf.xml
  384. │   │   ├── hash.conf.xml
  385. │   │   ├── hiredis.conf.xml
  386. │   │   ├── httapi.conf.xml
  387. │   │   ├── http_cache.conf.xml
  388. │   │   ├── ivr.conf.xml
  389. │   │   ├── java.conf.xml
  390. │   │   ├── kazoo.conf.xml
  391. │   │   ├── lcr.conf.xml
  392. │   │   ├── local_stream.conf.xml
  393. │   │   ├── logfile.conf.xml
  394. │   │   ├── lua.conf.xml
  395. │   │   ├── memcache.conf.xml
  396. │   │   ├── modules.conf.xml
  397. │   │   ├── mongo.conf.xml
  398. │   │   ├── nibblebill.conf.xml
  399. │   │   ├── opal.conf.xml
  400. │   │   ├── opus.conf.xml
  401. │   │   ├── oreka.conf.xml
  402. │   │   ├── osp.conf.xml
  403. │   │   ├── perl.conf.xml
  404. │   │   ├── pocketsphinx.conf.xml
  405. │   │   ├── portaudio.conf.xml
  406. │   │   ├── post_load_modules.conf.xml
  407. │   │   ├── presence_map.conf.xml
  408. │   │   ├── python.conf.xml
  409. │   │   ├── redis.conf.xml
  410. │   │   ├── rss.conf.xml
  411. │   │   ├── rtmp.conf.xml
  412. │   │   ├── sangoma_codec.conf.xml
  413. │   │   ├── shout.conf.xml
  414. │   │   ├── skinny.conf.xml
  415. │   │   ├── smpp.conf.xml
  416. │   │   ├── sms_flowroute.conf.xml
  417. │   │   ├── sofia.conf.xml
  418. │   │   ├── spandsp.conf.xml
  419. │   │   ├── switch.conf.xml
  420. │   │   ├── syslog.conf.xml
  421. │   │   ├── timezones.conf.xml
  422. │   │   ├── translate.conf.xml
  423. │   │   ├── tts_commandline.conf.xml
  424. │   │   ├── unicall.conf.xml
  425. │   │   ├── unimrcp.conf.xml
  426. │   │   ├── v8.conf.xml
  427. │   │   ├── verto.conf.xml
  428. │   │   ├── voicemail.conf.xml
  429. │   │   ├── voicemail_ivr.conf.xml
  430. │   │   ├── xml_cdr.conf.xml
  431. │   │   ├── xml_curl.conf.xml
  432. │   │   ├── xml_rpc.conf.xml
  433. │   │   ├── xml_scgi.conf.xml
  434. │   │   └── zeroconf.conf.xml
  435. │   ├── chatplan # 聊天计划
  436. │   │   └── default.xml
  437. │   ├── dialplan # 拨号计划
  438. │   │   ├── default
  439. │   │   ├── default.xml
  440. │   │   ├── features.xml
  441. │   │   ├── public
  442. │   │   ├── public.xml
  443. │   │   ├── skinny-patterns
  444. │   │   └── skinny-patterns.xml
  445. │   ├── directory # 用户目录 默认定义了 1000 ~ 1019 一共 20 个用户
  446. │   │   ├── default
  447. │   │   └── default.xml
  448. │   ├── extensions.conf
  449. │   ├── freeswitch.xml # 将所有配置文件“粘”到一起 | X-PRE-PROCESS 预处理指令
  450. │   ├── fur_elise.ttml
  451. │   ├── ivr_menus
  452. │   │   ├── demo_ivr.xml
  453. │   │   └── new_demo_ivr.xml
  454. │   ├── jingle_profiles
  455. │   │   ├── client.xml
  456. │   │   └── server.xml
  457. │   ├── lang
  458. │   │   ├── de
  459. │   │   ├── en
  460. │   │   ├── es
  461. │   │   ├── fr
  462. │   │   ├── he
  463. │   │   ├── pt
  464. │   │   ├── ru
  465. │   │   └── sv
  466. │   ├── mime.types
  467. │   ├── mrcp_profiles
  468. │   │   ├── loquendo-7-mrcp-v2.xml
  469. │   │   ├── nuance-1.0.0-mrcp-v1.xml
  470. │   │   ├── nuance-5.0-mrcp-v1.xml
  471. │   │   ├── nuance-5.0-mrcp-v2.xml
  472. │   │   ├── unimrcpserver-mrcp-v1.xml
  473. │   │   ├── vestec-mrcp-v1.xml
  474. │   │   └── voxeo-prophecy-8.0-mrcp-v1.xml
  475. │   ├── notify-voicemail.tpl
  476. │   ├── sip_profiles # SIP 配置文件
  477. │   │   ├── external
  478. │   │   ├── external-ipv6
  479. │   │   ├── external-ipv6.xml
  480. │   │   ├── external.xml
  481. │   │   ├── internal-ipv6.xml
  482. │   │   └── internal.xml
  483. │   ├── skinny_profiles
  484. │   │   └── internal.xml
  485. │   ├── tetris.ttml
  486. │   ├── tls
  487. │   │   ├── dtls-srtp.pem
  488. │   │   └── wss.pem
  489. │   ├── vars.xml # 通过 X-PRE-PROCESS 指令定义了全局变量
  490. │   ├── voicemail.tpl
  491. │   └── web-vm.tpl
  492. ├── include # 头文件
  493. │   └── freeswitch
  494. │   ├── libteletone_detect.h
  495. │   ├── libteletone_generate.h
  496. │   ├── libteletone.h
  497. │   ├── switch_am_config.h
  498. │   ├── switch_apr.h
  499. │   ├── switch_buffer.h
  500. │   ├── switch_caller.h
  501. │   ├── switch_channel.h
  502. │   ├── switch_config.h
  503. │   ├── switch_console.h
  504. │   ├── switch_core_db.h
  505. │   ├── switch_core_event_hook.h
  506. │   ├── switch_core.h
  507. │   ├── switch_core_media.h
  508. │   ├── switch_core_video.h
  509. │   ├── switch_cpp.h
  510. │   ├── switch_curl.h
  511. │   ├── switch_dso.h
  512. │   ├── switch_estimators.h
  513. │   ├── switch_event.h
  514. │   ├── switch_frame.h
  515. │   ├── switch.h
  516. │   ├── switch_hashtable.h
  517. │   ├── switch_image.h
  518. │   ├── switch_ivr.h
  519. │   ├── switch_jitterbuffer.h
  520. │   ├── switch_json.h
  521. │   ├── switch_limit.h
  522. │   ├── switch_loadable_module.h
  523. │   ├── switch_log.h
  524. │   ├── switch_module_interfaces.h
  525. │   ├── switch_mprintf.h
  526. │   ├── switch_nat.h
  527. │   ├── switch_odbc.h
  528. │   ├── switch_pgsql.h
  529. │   ├── switch_platform.h
  530. │   ├── switch_regex.h
  531. │   ├── switch_resample.h
  532. │   ├── switch_rtcp_frame.h
  533. │   ├── switch_rtp.h
  534. │   ├── switch_scheduler.h
  535. │   ├── switch_stun.h
  536. │   ├── switch_types.h
  537. │   ├── switch_utf8.h
  538. │   ├── switch_utils.h
  539. │   ├── switch_vpx.h
  540. │   ├── switch_xml_config.h
  541. │   ├── switch_xml.h
  542. │   └── tpl.h
  543. ├── lib # 库文件
  544. │   ├── freeswitch
  545. │   │   └── mod # 可加载 模块
  546. │   │   ├── mod_amr.la
  547. │   │   ├── mod_amr.so
  548. │   │   ├── mod_b64.la
  549. │   │   ├── mod_b64.so
  550. │   │   ├── mod_cdr_csv.la
  551. │   │   ├── mod_cdr_csv.so
  552. │   │   ├── mod_cdr_sqlite.la
  553. │   │   ├── mod_cdr_sqlite.so
  554. │   │   ├── mod_commands.la
  555. │   │   ├── mod_commands.so
  556. │   │   ├── mod_conference.la
  557. │   │   ├── mod_conference.so
  558. │   │   ├── mod_console.la
  559. │   │   ├── mod_console.so
  560. │   │   ├── mod_db.la
  561. │   │   ├── mod_db.so
  562. │   │   ├── mod_dialplan_asterisk.la
  563. │   │   ├── mod_dialplan_asterisk.so
  564. │   │   ├── mod_dialplan_xml.la
  565. │   │   ├── mod_dialplan_xml.so
  566. │   │   ├── mod_dptools.la
  567. │   │   ├── mod_dptools.so
  568. │   │   ├── mod_esf.la
  569. │   │   ├── mod_esf.so
  570. │   │   ├── mod_event_socket.la
  571. │   │   ├── mod_event_socket.so
  572. │   │   ├── mod_expr.la
  573. │   │   ├── mod_expr.so
  574. │   │   ├── mod_fifo.la
  575. │   │   ├── mod_fifo.so
  576. │   │   ├── mod_fsv.la
  577. │   │   ├── mod_fsv.so
  578. │   │   ├── mod_g723_1.la
  579. │   │   ├── mod_g723_1.so
  580. │   │   ├── mod_g729.la
  581. │   │   ├── mod_g729.so
  582. │   │   ├── mod_h26x.la
  583. │   │   ├── mod_h26x.so
  584. │   │   ├── mod_hash.la
  585. │   │   ├── mod_hash.so
  586. │   │   ├── mod_httapi.la
  587. │   │   ├── mod_httapi.so
  588. │   │   ├── mod_local_stream.la
  589. │   │   ├── mod_local_stream.so
  590. │   │   ├── mod_logfile.la
  591. │   │   ├── mod_logfile.so
  592. │   │   ├── mod_loopback.la
  593. │   │   ├── mod_loopback.so
  594. │   │   ├── mod_lua.la
  595. │   │   ├── mod_lua.so
  596. │   │   ├── mod_native_file.la
  597. │   │   ├── mod_native_file.so
  598. │   │   ├── mod_opus.la
  599. │   │   ├── mod_opus.so
  600. │   │   ├── mod_png.la
  601. │   │   ├── mod_png.so
  602. │   │   ├── mod_rtc.la
  603. │   │   ├── mod_rtc.so
  604. │   │   ├── mod_say_en.la
  605. │   │   ├── mod_say_en.so
  606. │   │   ├── mod_skinny.la
  607. │   │   ├── mod_skinny.so
  608. │   │   ├── mod_sms.la
  609. │   │   ├── mod_sms.so
  610. │   │   ├── mod_sndfile.la
  611. │   │   ├── mod_sndfile.so
  612. │   │   ├── mod_sofia.la
  613. │   │   ├── mod_sofia.so
  614. │   │   ├── mod_spandsp.la
  615. │   │   ├── mod_spandsp.so
  616. │   │   ├── mod_syslog.la
  617. │   │   ├── mod_syslog.so
  618. │   │   ├── mod_tone_stream.la
  619. │   │   ├── mod_tone_stream.so
  620. │   │   ├── mod_valet_parking.la
  621. │   │   ├── mod_valet_parking.so
  622. │   │   ├── mod_verto.la
  623. │   │   ├── mod_verto.so
  624. │   │   ├── mod_voicemail.la
  625. │   │   ├── mod_voicemail.so
  626. │   │   ├── mod_xml_cdr.la
  627. │   │   ├── mod_xml_cdr.so
  628. │   │   ├── mod_xml_rpc.la
  629. │   │   ├── mod_xml_rpc.so
  630. │   │   ├── mod_xml_scgi.la
  631. │   │   └── mod_xml_scgi.so
  632. │   ├── libfreeswitch.a
  633. │   ├── libfreeswitch.la
  634. │   ├── libfreeswitch.so -> libfreeswitch.so.1.0.0
  635. │   ├── libfreeswitch.so.1 -> libfreeswitch.so.1.0.0
  636. │   ├── libfreeswitch.so.1.0.0
  637. │   └── pkgconfig
  638. │   └── freeswitch.pc
  639. ├── share
  640. │   └── freeswitch
  641. │   ├── fonts
  642. │   │   ├── FreeMonoBoldOblique.ttf
  643. │   │   ├── FreeMonoBold.ttf
  644. │   │   ├── FreeMonoOblique.ttf
  645. │   │   ├── FreeMono.ttf
  646. │   │   ├── FreeSansBoldOblique.ttf
  647. │   │   ├── FreeSansBold.ttf
  648. │   │   ├── FreeSansOblique.ttf
  649. │   │   ├── FreeSans.ttf
  650. │   │   ├── FreeSerifBoldItalic.ttf
  651. │   │   ├── FreeSerifBold.ttf
  652. │   │   ├── FreeSerifItalic.ttf
  653. │   │   ├── FreeSerif.ttf
  654. │   │   ├── OFL.txt
  655. │   │   └── README.fonts
  656. │   ├── grammar # 语法 用于 ASR
  657. │   ├── htdocs # HTTP Server 根目录
  658. │   │   ├── license.txt
  659. │   │   ├── portal
  660. │   │   ├── slim.swf
  661. │   │   └── slimtest.htm
  662. │   ├── scripts # 嵌入式语音写脚本,如使用 lua() luarun() jsrun 等默认寻找路径
  663. │   └── sounds # 声音文件
  664. │   ├── en
  665. │   └── music
  666. └── var
  667. ├── lib
  668. │   └── freeswitch
  669. │   ├── db # 系统数据库(sqlite)呼叫信息存放(方便查询无需对核心数据加锁)
  670. │   ├── images
  671. │   ├── recordings # 录音 使用 record() 时 默认的存放路径
  672. │   └── storage # 语音留言 Voiceemail 录音,下载缓存 http_file_cache
  673. ├── log # 日志 CDR
  674. │   └── freeswitch
  675. │   ├── cdr-csv
  676. │   ├── freeswitch.history
  677. │   ├── freeswitch.log
  678. │   ├── freeswitch.log.1
  679. │   ├── freeswitch.log.2
  680. │   ├── freeswitch.xml.fsxml # 是FreeSWITCH内部XML内存镜像,动态生成 调试 reloadxml
  681. │   └── xml_cdr
  682. └── run # 运行目录 存放 FS 运行时的 PID
  683. └── freeswitch
  684. └── freeswitch.pid
  685.  
  686. 57 directories, 285 files
  687.  
  688. [root@highsea-macos-vmware-centos6 ~]# tree ./freeswitch/share/freeswitch/sounds/ -L 4
  689. ./freeswitch/share/freeswitch/sounds/
  690. ├── en # en(英文) 【中文目录也类似】
  691. │   └── us # 美式英文
  692. │   └── callie # 嗓音 (不同人 音调 音色 不同)
  693. │   ├── ascii
  694. │   ├── base256
  695. │   ├── conference
  696. │   ├── currency
  697. │   ├── digits
  698. │   ├── directory
  699. │   ├── ivr
  700. │   ├── misc
  701. │   ├── phonetic-ascii
  702. │   ├── time
  703. │   ├── voicemail
  704. │   └── zrtp
  705. └── music # 保持音乐
  706. ├── 16000
  707. │   └── suite-espanola-op-47-leyenda.wav
  708. ├── 32000
  709. │   └── suite-espanola-op-47-leyenda.wav
  710. ├── 48000
  711. │   └── suite-espanola-op-47-leyenda.wav
  712. └── 8000
  713. └── suite-espanola-op-47-leyenda.wav
  714.  
  715. 20 directories, 4 files
  716.  
  717.  
  718. [root@highsea-macos-vmware-centos6 ~]# tree ./freeswitch/var/lib/freeswitch/storage/
  719. ./freeswitch/var/lib/freeswitch/storage/
  720. ├── http_file_cache # 从其他HTTP服务器下载过来的语音文件缓存
  721. └── voicemail # 分层级存放
  722. └── default # default | domain
  723. ├── 192.168.1.28
  724. │   ├── 1003
  725. │   └── 1004
  726. └── 192.168.199.209
  727. ├── 1000
  728. │   └── msg_746b8d72-1c83-11e8-b7cf-1f706e5b1202.wav
  729. └── 1001
  730. ├── msg_16df1586-1c59-11e8-a529-8b3c11f45198.wav
  731. ├── msg_527ff080-1c57-11e8-a3d5-fb5cd572174a.wav
  732. ├── msg_54fe15e2-1c59-11e8-a564-8b3c11f45198.wav
  733. ├── msg_807f9aa0-1c4b-11e8-a322-9784cd23ef5e.wav
  734. ├── msg_817835c2-1c99-11e8-b8d0-1f706e5b1202.wav
  735. ├── msg_ab140ae4-1c50-11e8-a357-9784cd23ef5e.wav
  736. ├── msg_c0c74cf2-1c50-11e8-a38d-9784cd23ef5e.wav
  737. └── msg_f349a476-1c83-11e8-b808-1f706e5b1202.wav
  738.  
  739. 9 directories, 9 files
  740.  
  741. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement