Difference between revisions of "Free Switch"

From Fire And Ice Grid
Jump to navigation Jump to search
Line 53: Line 53:
 
* uuid - required to compile Libks
 
* uuid - required to compile Libks
 
* uuid-dev - required to compile Libks
 
* uuid-dev - required to compile Libks
 +
 +
sudo apt install build-essential autoconf cmake Libtool pkg-config libcurl4-opensssl-dev python-pycurl python3-pycurl python3-pycurl-dbug libtiff-dev libaudiofile-dev fftw-dev sqlite3 libsqlite3-dev libpcre3-dev speex libspeex-dev libspeexdsp-dev libldns-dev nasm libavformat-dev libswscale-dev liblua5.3-dev libpq-dev libx11-dev libfreetype-dev install libssl-dev uuid uuid-dev
 +
  
 
=== [https://github.com/fltk/fltk Fltk] ===
 
=== [https://github.com/fltk/fltk Fltk] ===

Revision as of 12:46, 10 June 2021


Introduction

FreeSWITCH is a voice service that can be used with Opensimulator. Until recently it has been a little-used option; however, with the announcement that Vivox support for opensimulator is coming to an end, it is one of the alternative options. This page is not complete, the compilation works, and the plugin states it's active in the console. Additionally in the viewer in the voice preferences voice can be tested successfully. However, neither local nor IM voice chat buttons are enabled.


This page is aimed at adding to the information available for both getting a working version of FreeSwitch and configuring it for opensimulator. At the time of writing the latest release is 10.6.

Information Sources

Compile And Install

Compile And Install on Ubuntu 20.04 Server

Ubuntu Packages Required

  • build-essential
  • autoconf
  • cmake
  • Libtool
  • pkg-config
  • libcurl4-opensssl-dev
  • python-pycurl
  • python3-pycurl
  • python3-pycurl-dbug
  • libtiff-dev
  • libaudiofile-dev
  • fftw-dev
  • sqlite3
  • libsqlite3-dev
  • libcurl4-openssl-dev
  • libpcre3-dev
  • speex
  • libspeex-dev
  • libspeexdsp-dev
  • libldns-dev
  • nasm
  • libavformat-dev
  • libswscale-dev
  • liblua5.3-dev
  • libpq-dev - required to compile Spandsp
  • libx11-dev - required to compile Fltk
  • libfreetype-dev - required to compile Fltk
  • install libssl-dev - required to compile Sofia
  • uuid - required to compile Libks
  • uuid-dev - required to compile Libks

sudo apt install build-essential autoconf cmake Libtool pkg-config libcurl4-opensssl-dev python-pycurl python3-pycurl python3-pycurl-dbug libtiff-dev libaudiofile-dev fftw-dev sqlite3 libsqlite3-dev libpcre3-dev speex libspeex-dev libspeexdsp-dev libldns-dev nasm libavformat-dev libswscale-dev liblua5.3-dev libpq-dev libx11-dev libfreetype-dev install libssl-dev uuid uuid-dev


Fltk

Required by Spandsp

1 git clone https://github.com/fltk/fltk.git
2 cd fltk
3 ./configure
4 make
5 sudo make install

Spandsp

1 git clone https://github.com/freeswitch/spandsp
2 cd spandsp
3 ./bootstrap.sh
4 ./configure
5 make -j
6 make install

sofia-sip

1 git clone https://github.com/freeswitch/sofia-sip
2 cd sofia-sip
3 sh autogen.sh (if building from darcs)
4 ./configure
5 make
6 make install

Signalwire

1 git clone https://github.com/signalwire/signalwire-c.git
2 cd signalwire-c
3 cmake .
4 make
5 sudo make install

Free Switch

First download, extract and enter the folder.

1 sudo wget https://files.freeswitch.org/freeswitch-releases/freeswitch-1.10.6.-release.zip
2 unzip freeswitch-1.10.6.-release.zip
3 cd freeswitch-1.10.6.-release

Copy lua5 files to where they should be, but are missing from the release files.

1 mkdir src/mod/languages/mod_lua
2 cp /usr/include/lua5.3/*.h src/mod/languages/mod_lua/

add a symbolic link so its found

1 sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.3.so /usr/lib/x86_64-linux-gnu/liblua.so

compile

1 ./configure
2 make
3 sudo make install

Compile the sounds

1 sudo make all cd-sounds-install cd-moh-install

Create Symbolic links for ease of use

1 sudo ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/
2 sudo ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin

Create a user with limited rights to run freeswitch

1 cd /usr/local
2 sudo groupadd freeswitch
3 sudo adduser --disabled-password  --quiet --system --home /usr/local/freeswitch --gecos "FreeSWITCH Voice Platform" --ingroup freeswitch freeswitch
4 sudo chown -R freeswitch:freeswitch /usr/local/freeswitch/
5 sudo chmod -R ug=rwX,o= /usr/local/freeswitch/
6 sudo chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/

Create a systemd service file to start automatically

 1 [Unit]
 2 Description=freeswitch
 3 Wants=network-online.target
 4 Requires=syslog.socket network.target local-fs.target
 5 After=syslog.socket network.target network-online.target local-fs.target
 6 
 7 [Service]
 8 Type=forking
 9 Environment="DAEMON_OPTS=-nonat"
10 EnvironmentFile=-/etc/default/freeswitch
11 ExecStartPre=/bin/chown -R freeswitch:freeswitch /usr/local/freeswitch
12 ExecStart=/usr/bin/freeswitch -u freeswitch -g freeswitch -ncwait $DAEMON_OPTS
13 TimeoutSec=45s
14 Restart=always
15 RestartSec=90
16 StartLimitInterval=0
17 StartLimitBurst=6
18 
19 User=root
20 Group=daemon
21 LimitCORE=infinity
22 LimitNOFILE=100000
23 LimitNPROC=60000
24 LimitSTACK=250000
25 LimitRTPRIO=infinity
26 LimitRTTIME=infinity
27 IOSchedulingClass=realtime
28 IOSchedulingPriority=2
29 CPUSchedulingPolicy=rr
30 CPUSchedulingPriority=89
31 UMask=0007
32 NoNewPrivileges=false
33 
34 [Install]
35 WantedBy=multi-user.target

Configure FreeSWITCH

Once you've compiled and installed Freeswitch, you will need to activate mod_siren and mod_xml_curl in /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml, since it's disabled by default on a fresh install.

uncomment the lines...

  <load module="mod_xml_curl"/>

and

  <load module="mod_siren"/>

Configure Opensimulator

Grid Mode In grid mode, [FreeSwitchVoice] in OpenSim.ini and [FreeswitchService] in Robust.ini or Robust.HG.ini need to be configured. Configurations details are shown in both OpenSim.ini.example, Robust.ini.example and Robust.HG.ini.example. Here is an example configuration for OpenSim.ini.

[FreeSwitchVoice]

  Enabled = true
  LocalServiceModule = OpenSim.Services.Connectors.dll:RemoteFreeswitchConnector
  FreeswitchServiceURL = "${Const|BaseUrl}:${Const|FreeSwitchPort}/fsapi"

Add for Robust.ini/Robust.HG.ini

[FreeswitchService]

  LocalServiceModule = OpenSim.Services.FreeswitchService.dll:FreeswitchService
  ServerAddress = "${Const|BaseUrl}"