配置路径
/usr/local/freeswitch/conf/ 或者是/etc/freeswitch
配置文件概述
文件 | 说明
—————————————————————————-
freeswitch.xml | 核心配置文件,整合所有配置文件
vars.xml | 全局变量
dialplan/default.xml | 缺省的拨号计划
directory/default/*.xml | SIP用户,每用户一个文件
sip_profiles/internal.xml | 一个SIP profile,或称作一个SIP-UA,监听在本地IP及端口5060,一般供内网用户使用
sip_profiles/externa.xml | 另一个SIP-UA,用作外部连接,端口5080
autoload_configs/modules.conf.xml | 配置当FreeSWITCH启动时自动装载哪些模块
conf配置文件的目录结构如下:
|
|———autoload_configs/ 一般都是模块级的配置文件,每个模块对应一个。文件名一般以 module_name.conf.xml 方式命名。
|
|———dialplan/ 定义xml拨号计划
|
|———directory/ 它里面的配置文件决定了freeswitch作为注册服务器时哪些用户可以注册上来。freeswitch支持多个域,每个域都可以写到一个xml文件里。默认的配置包括一个default.xml,它里面定义了1000~1019共20个用户。
|
|———extensions.conf
|
|———freeswitch.xml 最重要的xml文件,就是它将所有配置文件“粘”到一起,生成一个大的xml文件log/freeswitch.xml.fsxml
|
|———fur_elise.xml
|
|———jingle_profiles/
|
|———lang/
|
|———mime.types/
|
|———notify-voicemail.tpl
|
|———sip_profiles/ 定义了sip配置文件,有sofia模块在autoload_configs/sofia.conf.xml中加载,由于它本身比较复杂又是核心功能,因此单列一个目录。
|
|———tetris.ttml
|
|———vars.xml 重要通过X-PRE-PROCESS指令定义了一些全局变量。全局变量以$${var}表示,临时变量以${var}表示。
|
|———voicemail.tpl
|
|———web-vm.tpl
启动配置
使用 freeswitch -help 或 freeswitch --help 会显示以下信息:-nf -- no forking-u [user] -- 启动后以非 root 用户 user 身份运行-g [group] -- 启动后以非 root 组 group 身份运行-help -- 显示本帮助信息-version -- 显示版本信息-waste -- 允许浪费内存,FreeSWITCH 仅需 240K 的栈空间你可以使用 ulimit -s 240 限制栈空间使用,或使用该选择忽略警告信息-core -- 出错时进行内核转储-hp -- 以高优先级运行-vg -- 在 valgrind 下运行,调试内存泄露时使用-nosql -- 不使用 SQL,show channels 类的命令将不能显示结果-heavy-timer -- 更精确的时钟。可能会更精确,但对系统要求更高-nonat -- 如果路由器支持 uPnP 或 NAT-PMP,则 FreeSWITCH可以自动解决 NAT 穿越问题。如果路由器不支持,则该选项可以使启动更快-nocal -- 关闭时钟核准。FreeSWTICH 理想的运行环境是 1000 Hz 的内核时钟如果你的内核时钟小于 1000 Hz 或在虚拟机上,可以尝试关闭该选项-nort -- 关闭实时时钟-stop -- 关闭 FreeSWTICH,它会在 run 目录中查找 PID文件-nc -- 启动到后台模式,没有控制台-c -- 启动到控制台,默认-conf [confdir] -- 指定其它的配置文件所在目录,须与 -log、 -db 合用-log [logdir] -- 指定其它的日志目录-run [rundir] -- 指定其它存放 PID 文件的运行目录-db [dbdir] -- 指定其它数据库目录-mod [moddir] -- 指定其它模块目录-htdocs [htdocsdir] -- 指定其它 HTTP 根目录-scripts [scriptsdir] -- 指定其它脚本目录
修改配置 生效
# fs_cli -x "reloadxml"+OK [Success]
# cat freeswitch.xml<?xml version="1.0"?><!--NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICEThis is the FreeSWITCH default config. Everything you see before you now traversesdown into all the directories including files which include more files. The defaultconfig comes out of the box already working in most situations as a PBX. This willallow you to get started testing and playing with various things in FreeSWITCH.Before you start to modify this default please visit this wiki page:http://wiki.freeswitch.org/wiki/Getting_Started_Guide#Some_stuff_to_try_out.21If all else fails you can read our FAQ located at:http://wiki.freeswitch.org/wiki/FreeSwitch_FAQNOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE--><document type="freeswitch/xml"><!--#commentAll comments starting with #command will be preprocessed and never sent to the xml parserValid instructions:#include ==> Include another file to this exact point(partial xml should be encased in <include></include> tags)#set ==> Set a global variable (can be expanded during preprocessing with $$ variables)(note the double $$ which denotes preprocessor variables)#comment ==> A general comment such as thisThe preprocessor will compile the full xml document to ${prefix}/log/freeswitch.xml.fsxmlDon't modify it while freeswitch is running cos it is mem mapped in most cases =DThe same can be achieved with the <X-PRE-PROCESS> tag where the attrs 'cmd' and 'data' areparsed in the same way.--><!--#commentvars.xml contains all the #set directives for the preprocessor.--><X-PRE-PROCESS cmd="include" data="vars.xml"/><section name="configuration" description="Various Configuration"><X-PRE-PROCESS cmd="include" data="autoload_configs/*.xml"/></section><section name="dialplan" description="Regex/XML Dialplan"><X-PRE-PROCESS cmd="include" data="dialplan/*.xml"/></section><section name="chatplan" description="Regex/XML Chatplan"><X-PRE-PROCESS cmd="include" data="chatplan/*.xml"/></section><!-- mod_dingaling is reliant on the vcard data in the "directory" section. --><!-- mod_sofia is reliant on the user data for authorization --><section name="directory" description="User Directory"><X-PRE-PROCESS cmd="include" data="directory/*.xml"/></section><!-- languages section (under development still) --><section name="languages" description="Language Management"><X-PRE-PROCESS cmd="include" data="lang/de/*.xml"/><X-PRE-PROCESS cmd="include" data="lang/en/*.xml"/><X-PRE-PROCESS cmd="include" data="lang/fr/*.xml"/><X-PRE-PROCESS cmd="include" data="lang/ru/*.xml"/><X-PRE-PROCESS cmd="include" data="lang/he/*.xml"/><X-PRE-PROCESS cmd="include" data="lang/es/es_ES.xml"/><X-NO-PRE-PROCESS cmd="include" data="lang/es/es_MX.xml"/><X-PRE-PROCESS cmd="include" data="lang/pt/pt_BR.xml"/><X-NO-PRE-PROCESS cmd="include" data="lang/pt/pt_PT.xml"/><X-NO-PRE-PROCESS cmd="include" data="lang/sv/*.xml"/></section></document>
预加载配置
<X-PRE-PROCESS cmd="include" data="vars.xml"/>
如果需要引用这些变量,则全局变量以$${var}表示,临时变量以${var}表示

全局变量var.xml
查看全局变量命令 global_getvar
> global_getvarhostname=VM-0-2-debianlocal_ip_v4=172.17.0.2local_mask_v4=255.255.240.0local_ip_v6=::1base_dir=/usrrecordings_dir=/var/lib/freeswitch/recordingssounds_dir=/usr/share/freeswitch/soundsconf_dir=/etc/freeswitchlog_dir=/var/log/freeswitchrun_dir=/var/run/freeswitchdb_dir=/var/lib/freeswitch/dbmod_dir=/usr/lib/freeswitch/modhtdocs_dir=/usr/share/freeswitch/htdocsscript_dir=/usr/share/freeswitch/scriptstemp_dir=/tmpgrammar_dir=/usr/share/freeswitch/grammarfonts_dir=/usr/share/freeswitch/fontsimages_dir=/var/lib/freeswitch/imagescerts_dir=/etc/freeswitch/tlsstorage_dir=/var/lib/freeswitch/storagecache_dir=/var/cache/freeswitchdata_dir=/usr/share/freeswitchlocalstate_dir=/var/lib/freeswitchswitch_serial=ac110002d6ccdefault_password=1234sound_prefix=/usr/share/freeswitch/sounds/en/us/calliedomain=172.17.0.2domain_name=172.17.0.2hold_music=local_stream://mohuse_profile=externalrtp_sdes_suites=AEAD_AES_256_GCM_8|AEAD_AES_128_GCM_8|AES_CM_256_HMAC_SHA1_80|AES_CM_192_HMAC_SHA1_80|AES_CM_128_HMAC_SHA1_80|AES_CM_256_HMAC_SHA1_32|AES_CM_192_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_32|AES_CM_128_NULL_AUTHzrtp_secure_media=trueglobal_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8outbound_codec_prefs=OPUS,G722,PCMU,PCMA,H264,VP8xmpp_client_profile=xmppcxmpp_server_profile=xmppsbind_server_ip=autounroll_loops=trueoutbound_caller_name=FreeSWITCHoutbound_caller_id=0000000000call_debug=falseconsole_loglevel=infodefault_areacode=918default_country=USpresence_privacy=falseau-ring=%(400,200,383,417);%(400,2000,383,417)be-ring=%(1000,3000,425)ca-ring=%(2000,4000,440,480)cn-ring=%(1000,4000,450)cy-ring=%(1500,3000,425)cz-ring=%(1000,4000,425)de-ring=%(1000,4000,425)dk-ring=%(1000,4000,425)dz-ring=%(1500,3500,425)eg-ring=%(2000,1000,475,375)es-ring=%(1500,3000,425)fi-ring=%(1000,4000,425)fr-ring=%(1500,3500,440)hk-ring=%(400,200,440,480);%(400,3000,440,480)hu-ring=%(1250,3750,425)il-ring=%(1000,3000,400)in-ring=%(400,200,425,375);%(400,2000,425,375)jp-ring=%(1000,2000,420,380)ko-ring=%(1000,2000,440,480)pk-ring=%(1000,2000,400)pl-ring=%(1000,4000,425)ro-ring=%(1850,4150,475,425)rs-ring=%(1000,4000,425)ru-ring=%(800,3200,425)sa-ring=%(1200,4600,425)tr-ring=%(2000,4000,450)uk-ring=%(400,200,400,450);%(400,2000,400,450)us-ring=%(2000,4000,440,480)bong-ring=v=-7;%(100,0,941.0,1477.0);v=-7;>=2;+=.1;%(1400,0,350,440)beep=%(1000,0,640)sit=%(274,0,913.8);%(274,0,1370.6);%(380,0,1776.7)df_us_ssn=(?!219099999|078051120)(?!666|000|9\d{2})\d{3}(?!00)\d{2}(?!0{4})\d{4}df_luhn=?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|6(?:011|5[0-9]{2})[0-9]{12}|(?:2131|1800|35\d{3})\d{11}default_provider=example.comdefault_provider_username=joeuserdefault_provider_password=passworddefault_provider_from_domain=example.comdefault_provider_register=falsedefault_provider_contact=5000sip_tls_version=tlsv1,tlsv1.1,tlsv1.2sip_tls_ciphers=ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTHinternal_auth_calls=trueinternal_sip_port=5060internal_tls_port=5061internal_ssl_enable=falseexternal_auth_calls=falseexternal_sip_port=5080external_tls_port=5081external_ssl_enable=falsertp_video_max_bandwidth_in=3mbrtp_video_max_bandwidth_out=3mbsuppress_cng=truertp_liberal_dtmf=truevideo_mute_png=/var/lib/freeswitch/images/default-mute.pngvideo_no_avatar_png=/var/lib/freeswitch/images/default-avatar.pngAT_EPENT1=0 0 0 -1 -1 0 -1 0 -1 -1 0 -1AT_EPENT2=1 1 1 -1 -1 1 -1 1 -1 -1 1 -1AT_CPENT1=0 -1 -1 0 -1 0 0 0 -1 -1 0 -1AT_CPENT2=1 -1 -1 1 -1 1 1 1 -1 -1 1 -1AT_CMAJ1=0 -1 0 0 -1 0 -1 0 0 -1 0 -1AT_CMAJ2=1 -1 1 1 -1 1 -1 1 1 -1 1 -1AT_BBLUES=1 -1 1 -1 -1 1 -1 1 1 1 -1 -1ATGPENT2=-1 1 -1 1 -1 1 -1 -1 1 -1 1 -1zrtp_enabled=falsecore_uuid=f6b8445a-7057-499e-a2f3-3b7f4fedc41a
- global_getvar [
]:获取全局变量 - global_setvar
= :设定全局变量
- global_getvar [
- 查看:eval ${val-name}
global_getvar domain
eval ${domain}
查看全局变量的值
freeswitch@VM-0-2-debian> global_getvar local_ip_v4172.17.0.2
在vars.xml加载之前,FreeSWITCH就已经算出并设置了一些全局变量,但有的时候FreeSWITCH自动算出的变量可能不是
#你想要的,如local_ip_v4的值,在服务器有多个网卡的情况下,可能希望它能得到另外一个网卡的IP地址,这时候就可以通过手动方式设置该变量IP来实现
<X-PRE-PROCESS cmd="set" data="local_ip_v4=192.168.1.251"/>
autoload_configs目录
autoloadconfigs目录下的各种配置文件会在系统启动时装入。一般来说都是模块级的配置文件,每个模块对应一个(注意,并不是所有的模块都有配置文件)。文件名一般以“模块名.conf.xml”的方式命名(模块名中不包含“mod”,如sofia.conf.xml)。
# ls -ltotal 508-rw-r--r-- 1 root root 274 Jan 24 2019 abstraction.conf.xml-rw-r--r-- 1 root root 1026 Jan 24 2019 acl.conf.xml-rw-r--r-- 1 root root 422 Jan 24 2019 alsa.conf.xml-rw-r--r-- 1 root root 3216 Jan 24 2019 amqp.conf.xml-rw-r--r-- 1 root root 718 Jan 24 2019 amr.conf.xml-rw-r--r-- 1 root root 205 Jan 24 2019 amrwb.conf.xml-rw-r--r-- 1 root root 5523 Jan 24 2019 av.conf.xml-rw-r--r-- 1 root root 3354 Jan 24 2019 avmd.conf.xml-rw-r--r-- 1 root root 345 Jan 24 2019 blacklist.conf.xml-rw-r--r-- 1 root root 2000 Jan 24 2019 callcenter.conf.xml-rw-r--r-- 1 root root 2521 Jan 24 2019 cdr_csv.conf.xml-rw-r--r-- 1 root root 470 Jan 24 2019 cdr_mongodb.conf.xml-rw-r--r-- 1 root root 1517 Jan 24 2019 cdr_pg_csv.conf.xml-rw-r--r-- 1 root root 999 Jan 24 2019 cdr_sqlite.conf.xml-rw-r--r-- 1 root root 306 Jan 24 2019 cepstral.conf.xml-rw-r--r-- 1 root root 1335 Jan 24 2019 cidlookup.conf.xml-rw-rw-r-- 1 root root 992 Apr 2 2019 conference.conf.xml-rw-r--r-- 1 root root 15057 Jan 24 2019 conference_layouts.conf.xml-rw-r--r-- 1 root root 2502 Jan 24 2019 console.conf.xml-rw-r--r-- 1 root root 147 Jan 24 2019 curl.conf.xml-rw-r--r-- 1 root root 170 Jan 24 2019 db.conf.xml-rw-r--r-- 1 root root 380 Jan 24 2019 dialplan_directory.conf.xml-rw-r--r-- 1 root root 270 Jan 24 2019 dingaling.conf.xml-rw-r--r-- 1 root root 810 Jan 24 2019 directory.conf.xml-rw-r--r-- 1 root root 442 Jan 24 2019 distributor.conf.xml-rw-r--r-- 1 root root 1431 Jan 24 2019 easyroute.conf.xml-rw-r--r-- 1 root root 1074 Jan 24 2019 enum.conf.xml-rw-r--r-- 1 root root 1220 Jan 24 2019 erlang_event.conf.xml-rw-r--r-- 1 root root 593 Jan 24 2019 event_multicast.conf.xml-rw-r--r-- 1 root root 432 Apr 2 2019 event_socket.conf.xml-rw-r--r-- 1 root root 441 Jan 24 2019 fax.conf.xml-rw-r--r-- 1 root root 371 Jan 24 2019 fifo.conf.xml-rw-r--r-- 1 root root 4622 Jan 24 2019 format_cdr.conf.xml-rw-r--r-- 1 root root 1024 Jan 24 2019 graylog2.conf.xml-rw-r--r-- 1 root root 260 Jan 24 2019 hash.conf.xml-rw-r--r-- 1 root root 703 Jan 24 2019 hiredis.conf.xml-rw-r--r-- 1 root root 5347 Jan 24 2019 httapi.conf.xml-rw-r--r-- 1 root root 1029 Jan 24 2019 http_cache.conf.xml-rw-r--r-- 1 root root 155 Jan 24 2019 ivr.conf.xml-rw-r--r-- 1 root root 445 Jan 24 2019 java.conf.xml-rw-rw-r-- 1 root root 2730 Apr 2 2019 json_cdr.conf.xml-rw-r--r-- 1 root root 8703 Jan 24 2019 kazoo.conf.xml-rw-r--r-- 1 root root 3657 Jan 24 2019 lcr.conf.xml-rw-r--r-- 1 root root 1910 Jan 24 2019 local_stream.conf.xml-rw-r--r-- 1 root root 1145 Apr 2 2019 logfile.conf.xml-rw-r--r-- 1 root root 1313 Jan 24 2019 lua.conf.xml-rw-r--r-- 1 root root 254 Jan 24 2019 memcache.conf.xml-rw-r--r-- 1 root root 4765 Nov 13 07:24 modules.conf.xml-rw-r--r-- 1 root root 541 Jan 24 2019 mongo.conf.xml-rw-r--r-- 1 root root 494 Jan 24 2019 msrp.conf.xml-rw-r--r-- 1 root root 2017 Jan 24 2019 nibblebill.conf.xml-rw-r--r-- 1 root root 1196 Jan 24 2019 opal.conf.xml-rw-r--r-- 1 root root 1794 Jan 24 2019 opus.conf.xml-rw-r--r-- 1 root root 537 Jan 24 2019 oreka.conf.xml-rw-r--r-- 1 root root 2108 Jan 24 2019 osp.conf.xml-rw-r--r-- 1 root root 593 Jan 24 2019 perl.conf.xml-rw-r--r-- 1 root root 534 Jan 24 2019 pocketsphinx.conf.xml-rw-r--r-- 1 root root 9019 Jan 24 2019 portaudio.conf.xml-rw-r--r-- 1 root root 110 Jan 24 2019 post_load_modules.conf.xml-rw-r--r-- 1 root root 196 Jan 24 2019 presence_map.conf.xml-rw-r--r-- 1 root root 575 Jan 24 2019 python.conf.xml-rw-r--r-- 1 root root 239 Jan 24 2019 redis.conf.xml-rw-r--r-- 1 root root 296 Jan 24 2019 rss.conf.xml-rw-r--r-- 1 root root 662 Jan 24 2019 rtmp.conf.xml-rw-r--r-- 1 root root 1457 Jan 24 2019 sangoma_codec.conf.xml-rw-r--r-- 1 root root 305 Jan 24 2019 shout.conf.xml-rw-r--r-- 1 root root 178 Jan 24 2019 skinny.conf.xml-rw-r--r-- 1 root root 488 Jan 24 2019 smpp.conf.xml-rw-r--r-- 1 root root 432 Jan 24 2019 sms_flowroute.conf.xml-rw-r--r-- 1 root root 820 Jan 24 2019 sofia.conf.xml-rw-r--r-- 1 root root 4580 Jan 24 2019 spandsp.conf.xml-rw-r--r-- 1 root root 7838 Apr 2 2019 switch.conf.xml-rw-r--r-- 1 root root 689 Jan 24 2019 syslog.conf.xml-rw-r--r-- 1 root root 101426 Jan 24 2019 timezones.conf.xml-rw-r--r-- 1 root root 858 Jan 24 2019 translate.conf.xml-rw-r--r-- 1 root root 555 Jan 24 2019 tts_commandline.conf.xml-rw-r--r-- 1 root root 914 Jan 24 2019 unicall.conf.xml-rw-r--r-- 1 root root 899 Jan 24 2019 unimrcp.conf.xml-rw-r--r-- 1 root root 727 Jan 24 2019 v8.conf.xml-rw-r--r-- 1 root root 2989 Jan 24 2019 verto.conf.xml-rw-r--r-- 1 root root 3698 Jan 24 2019 voicemail.conf.xml-rw-r--r-- 1 root root 8039 Jan 24 2019 voicemail_ivr.conf.xml-rw-r--r-- 1 root root 5498 Jan 24 2019 vpx.conf.xml-rw-r--r-- 1 root root 3993 Jan 24 2019 xml_cdr.conf.xml-rw-r--r-- 1 root root 2868 Jan 24 2019 xml_curl.conf.xml-rw-r--r-- 1 root root 694 Apr 2 2019 xml_rpc.conf.xml-rw-r--r-- 1 root root 563 Jan 24 2019 xml_scgi.conf.xml-rw-r--r-- 1 root root 203 Jan 24 2019 zeroconf.conf.xml
autoload_configs目录中有一个特殊的modules.conf.xml,其决定了FreeSWITCH启动时自动加载哪些模块。如下面的配置片断,如果需要在FreeSWITCH启动时自动加载某个模块,就在这里添加一行,如果不需要,就注释掉或直接删除。
cat modules.conf.xml<configuration name="modules.conf" description="Modules"><modules><!-- Loggers (I'd load these first) --><load module="mod_console"/><!-- <load module="mod_graylog2"/> --><load module="mod_logfile"/><!-- <load module="mod_syslog"/> --><!--<load module="mod_yaml"/>--><!-- Multi-Faceted --><!-- mod_enum is a dialplan interface, an application interface and an api command interface --><load module="mod_enum"/><!-- XML Interfaces --><load module="mod_xml_rpc"/><!-- <load module="mod_xml_curl"/> --><!--<load module="mod_xml_cdr"/>--><!-- <load module="mod_xml_radius"/> --><!-- <load module="mod_xml_scgi"/> --><!-- Event Handlers --><!-- <load module="mod_amqp"/> --><load module="mod_cdr_csv"/><!-- <load module="mod_cdr_sqlite"/> --><!-- <load module="mod_event_multicast"/> --><load module="mod_event_socket"/><!-- <load module="mod_event_zmq"/> --><!-- <load module="mod_zeroconf"/> --><!-- <load module="mod_erlang_event"/> --><!-- <load module="mod_smpp"/> --><!-- <load module="mod_snmp"/> --><!-- Directory Interfaces --><!-- <load module="mod_ldap"/> --><!-- Endpoints --><!-- <load module="mod_dingaling"/> --><!-- <load module="mod_portaudio"/> --><!-- <load module="mod_alsa"/> --><load module="mod_sofia"/><load module="mod_loopback"/><!-- <load module="mod_woomera"/> --><!-- <load module="mod_freetdm"/> --><!-- <load module="mod_unicall"/> --><!-- <load module="mod_skinny"/> --><!-- <load module="mod_khomp"/> --><load module="mod_rtc"/><!-- <load module="mod_rtmp"/> --><!--<load module="mod_verto"/>--><!-- Applications --><load module="mod_signalwire"/><load module="mod_commands"/><load module="mod_conference"/><!-- <load module="mod_curl"/> --><load module="mod_db"/><load module="mod_dptools"/><load module="mod_expr"/><load module="mod_fifo"/><load module="mod_hash"/><!--<load module="mod_mongo"/> --><!--<load module="mod_voicemail"/>--><!--<load module="mod_directory"/>--><!--<load module="mod_distributor"/>--><!--<load module="mod_lcr"/>--><!--<load module="mod_easyroute"/>--><load module="mod_esf"/><load module="mod_fsv"/><!--<load module="mod_cluechoo"/>--><load module="mod_valet_parking"/><!--<load module="mod_fsk"/>--><!--<load module="mod_spy"/>--><!--<load module="mod_sms"/>--><!--<load module="mod_sms_flowroute"/>--><!--<load module="mod_smpp"/>--><!--<load module="mod_random"/>--><load module="mod_httapi"/><!--<load module="mod_translate"/>--><!-- SNOM Module --><!--<load module="mod_snom"/>--><!-- This one only works on Linux for now --><!--<load module="mod_ladspa"/>--><!-- Dialplan Interfaces --><!-- <load module="mod_dialplan_directory"/> --><load module="mod_dialplan_xml"/><!--<load module="mod_dialplan_asterisk"/>--><!-- Codec Interfaces --><load module="mod_spandsp"/><load module="mod_g723_1"/><load module="mod_g729"/><load module="mod_amr"/><!--<load module="mod_ilbc"/>--><!--<load module="mod_h26x"/>--><load module="mod_b64"/><!--<load module="mod_siren"/>--><!--<load module="mod_isac"/>--><load module="mod_opus"/><!-- File Format Interfaces --><load module="mod_av"/><load module="mod_sndfile"/><load module="mod_native_file"/><load module="mod_png"/><!-- <load module="mod_shell_stream"/> --><!--For icecast/mp3 streams/files--><!--<load module="mod_shout"/>--><!--For local streams (play all the files in a directory)--><load module="mod_local_stream"/><load module="mod_tone_stream"/><!-- Timers --><!-- <load module="mod_timerfd"/> --><!-- <load module="mod_posix_timer"/> --><!-- Languages --><!-- <load module="mod_v8"/> --><!-- <load module="mod_perl"/> --><!-- <load module="mod_python"/> --><!-- <load module="mod_java"/> --><load module="mod_lua"/><!-- ASR /TTS --><!-- <load module="mod_flite"/> --><!-- <load module="mod_pocketsphinx"/> --><!-- <load module="mod_cepstral"/> --><!-- <load module="mod_tts_commandline"/> --><!-- <load module="mod_rss"/> --><!-- Say --><load module="mod_say_en"/><!-- <load module="mod_say_ru"/> --><!-- <load module="mod_say_zh"/> --><!-- <load module="mod_say_sv"/> --><!-- Third party modules --><!--<load module="mod_nibblebill"/>--><!--<load module="mod_callcenter"/>--><load module="mod_json_cdr"/></modules></configuration>
快捷设置
在autoload_configs/switch.conf.xml,定义了一些控制台快捷操作命令。可以通过键盘的F1-F12来使用它们
<cli-keybindings><key name="1" value="help"/><key name="2" value="status"/><key name="3" value="show channels"/><key name="4" value="show calls"/><key name="5" value="sofia status"/><key name="6" value="reloadxml"/><key name="7" value="console loglevel 0"/><key name="8" value="console loglevel 7"/><key name="9" value="sofia status profile internal"/><key name="10" value="sofia profile internal siptrace on"/><key name="11" value="sofia profile internal siptrace off"/><key name="12" value="version"/></cli-keybindings>
日志目录
/var/log/freeswitch
日志级别
查看日志级别
# fs_cli -x "console loglevel help"USAGE:--------------------------------------------------------------------------------console loglevel [[0-7] | <loglevel_string>]Set the logging verbosity of the console from 0 (least verbose) to7 (debugging), or specify the loglevel as a string:0 console1 alert2 crit3 err4 warning5 notice6 info7 debug--------------------------------------------------------------------------------
- debug,info,notice,warning,err,crit,alert:7个级别
- 1~7: 对应上面7个级别(7为debug,1为alert)
- 0:关闭所有输出(console loglevel 0);
/etc/freeswitch/vars.xml
# cat vars.xml |grep console_loglevel<X-PRE-PROCESS cmd="set" data="console_loglevel=info"/>
修改日志存放路径
conf\autoload_configs\switch.conf.xml文件中控制着所有的日志输出级别<param name="loglevel" value="debug"/>
`
常见问题
5060端口没有启动
执行
fs_cli -x 'load mod_sofia'

# netstat -anp|grep 5060tcp 0 0 172.17.0.2:5060 0.0.0.0:* LISTEN 18356/freeswitchtcp6 0 0 ::1:5060 :::* LISTEN 18356/freeswitchudp 0 0 172.17.0.2:5060 0.0.0.0:* 18356/freeswitchudp6 0 0 ::1:5060 :::*
默认密码
FreeSWITCH的默认密码为1234,客户端使用该密码拨号时,会有10秒的延时。通过修改此默认密码,可以避免这个延时。如把新密码设为2345,此时可以把conf目录下的vars.xml中的:
<X-PRE-PROCESS cmd="set" data="default_password=1234"/>
默认密码是1234 会休眠1000
<condition field="${default_password}" expression="^1234$" break="never"><action application="log" data="CRIT WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING "/><action application="log" data="CRIT Open $${conf_dir}/vars.xml and change the default_password."/><action application="log" data="CRIT Once changed type 'reloadxml' at the console."/><action application="log" data="CRIT WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING "/><action application="sleep" data="10000"/></condition>
修改为
<X-PRE-PROCESS cmd="set" data="default_password=2345"/>
参考
https://blog.csdn.net/weixin_45843878/article/details/105655400
https://www.jianshu.com/p/61ce097c9026#52
