Monday, 6 June 2016

FreeSWITCH - Check what configuration directories are in use

There is a little trick to see what directories FreeSWITCH is using as paths for the configuration files:

/opt/freeswitch/bin/fs_cli -x 'global_getvar'| grep _dir

For example, the output can be:

base_dir=/usr/local/freeswitch
recordings_dir=/usr/local/freeswitch/recordings
sounds_dir=/usr/local/freeswitch/sounds
conf_dir=/opt/freeswitch/etc/freeswitch/
log_dir=/usr/local/freeswitch/log
run_dir=/usr/local/freeswitch/log
db_dir=/usr/local/freeswitch/db
mod_dir=/usr/local/freeswitch/mod
htdocs_dir=/usr/local/freeswitch/htdocs
script_dir=/usr/local/freeswitch/scripts
temp_dir=/tmp
grammar_dir=/usr/local/freeswitch/grammar
fonts_dir=/usr/local/freeswitch/fonts
images_dir=/usr/local/freeswitch/images
certs_dir=/usr/local/freeswitch/certs
storage_dir=/usr/local/freeswitch/storage
cache_dir=/usr/local/freeswitch/cache
data_dir=/usr/local/freeswitch
localstate_dir=/usr/local/freeswitch
internal_ssl_dir=/usr/local/freeswitch/conf/ssl
external_ssl_dir=/usr/local/freeswitch/conf/ssl 

This is handy in particular when you're testing an installation from source but the configuration is not in the default location.

It's possible to set non-default values by passing them as arguments for the daemon, e.g.:

/usr/local/freeswitch/bin/freeswitch -conf /opt/freeswitch/etc/freeswitch/ -log /usr/local/freeswitch/log -db /usr/local/freeswitch/db -ncwait -core

In general, when in doubt about the configuration path, use that fs_cli command to verify.

More info is as usual available from FreeSWITCH official documentation: Command Line Switches.