Josh’s FreeSWITCH Notes

Because I set it up over a decade ago and I’m slowly forgetting how it works.

Configuration directories

How do I get the configuration directories from FreeSWITCH again? Nick vs Networking shows a command for getting all _dir paths:

$ fs_cli -x "global_getvar" | grep _dir
base_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x
recordings_dir=/var/lib/freeswitch/recordings
sounds_dir=/etc/freeswitch/sounds
conf_dir=/etc/freeswitch
log_dir=/var/log/freeswitch
run_dir=/run/freeswitch
db_dir=/var/cache/freeswitch
mod_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x/lib/freeswitch/mod
htdocs_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x/share/freeswitch/htdocs
script_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x/share/freeswitch/scripts
temp_dir=/tmp
grammar_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x/share/freeswitch/grammar
fonts_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x/share/freeswitch/fonts
images_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x/var/lib/freeswitch/images
certs_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x/etc/freeswitch/tls
storage_dir=/var/lib/freeswitch/storage
cache_dir=/var/cache/freeswitch
data_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x/share/freeswitch
localstate_dir=/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-freeswitch-1.xx.x/var/lib/freeswitch
    

And now I’m trying to remember how I actually set the script_dir to be something else.

Ah, it’s by providing a “-scripts” argument when launching FreeSWITCH. So I need to modify my systemd service that adds that.

Enabling TTS in NixOS

Looks like I need to override the modules part of pkgs.freeswitch to get stuff like mod_flite or mod_tts_commandline working.

Looks like there was a bug with modules in Nixpkgs being incorrectly named “ast_tts” instead of “asr_tts”.

Speech recognition

I was trying to figure out “detect_speech” but it looks like “unimrcp” was removed from FreeSWITCH and mod_pocketsphinx probably won’t work since pocketsphinx has been removed from nixpkgs.

Vosk integration with FreeSWITCH seems interesting.

WebRTC

One idea for connecting to FreeSWITCH via WebRTC is to use the Janus WebRTC gateway. See an example at https://janus.conf.meetecho.com/siptest.html.