Skip to content

Instantly share code, notes, and snippets.

@cyrenity
Last active September 13, 2025 01:39
Show Gist options
  • Select an option

  • Save cyrenity/96cc1ad7979b719b1c684f90aa0f526d to your computer and use it in GitHub Desktop.

Select an option

Save cyrenity/96cc1ad7979b719b1c684f90aa0f526d to your computer and use it in GitHub Desktop.

Revisions

  1. cyrenity renamed this gist Jun 1, 2024. 1 changed file with 0 additions and 0 deletions.
  2. cyrenity revised this gist May 24, 2024. No changes.
  3. cyrenity revised this gist May 24, 2024. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions compile-and-install-freeswitch-1.10.x-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,7 @@ $ sudo make && sudo make install
    ```
    To verify if `libks` is installed correctly in your system, run following command
    ```
    $ ldconfig && ldconfig -p | grep libks
    $ sudo sh -c 'ldconfig && ldconfig -p' | grep libks
    ```
    In Order to install `libsignalwire` Run following command to download latest code from github

    @@ -62,7 +62,7 @@ $ sudo make && sudo make install
    ```
    To verify if `libsignalwire-client` is installed correctly in your system, run following command
    ```
    $ ldconfig && ldconfig -p | grep signalwire
    $ sudo sh -c 'ldconfig && ldconfig -p' | grep signalwire
    ```


    @@ -89,7 +89,7 @@ $ sudo make && sudo make install
    ```
    To verify if Sofia-Sip library is installed correctly in your system, run following command
    ```
    $ ldconfig && ldconfig -p | grep sofia
    $ sudo sh -c 'ldconfig && ldconfig -p' | grep sofia
    ```
    If `libsofia-sip` is not installed, there will be no output. If it is installed, you will get a line for each version available.

    @@ -107,7 +107,7 @@ $ sudo make && sudo make install
    ```
    To verify if SpanDSP library is installed correctly in your system, run following command
    ```bash
    $ ldconfig && ldconfig -p | grep spandsp
    $ sudo sh -c 'ldconfig && ldconfig -p' | grep spandsp
    ```
    If `libspandsp` is not installed, there will be no output. If it is installed, you will get a line for each version available.

  4. cyrenity revised this gist May 23, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions compile-and-install-freeswitch-1.10.x-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -22,9 +22,9 @@ $ sudo apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-
    libavformat-dev libswscale-dev libavresample-dev liblua5.2-dev liblua5.2-0 cmake libpq-dev \
    unixodbc-dev autoconf automake ntpdate libxml2-dev libpq-dev libpq5 sngrep
    ```
    ###### Ubuntu 20.04 LTS
    ###### Ubuntu 22.04 LTS
    ```bash
    apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-dev libsqlite3-dev libcurl4-openssl-dev \
    sudo apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-dev libsqlite3-dev libcurl4-openssl-dev \
    libpcre3-dev libspeexdsp-dev libldns-dev libedit-dev libtiff5-dev yasm libopus-dev libsndfile1-dev unzip \
    libavformat-dev libswscale-dev liblua5.2-dev liblua5.2-0 cmake libpq-dev \
    unixodbc-dev autoconf automake ntpdate libxml2-dev libpq-dev libpq5 sngrep
  5. cyrenity revised this gist May 23, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion compile-and-install-freeswitch-1.10.x-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -107,7 +107,7 @@ $ sudo make && sudo make install
    ```
    To verify if SpanDSP library is installed correctly in your system, run following command
    ```bash
    $ ldconfig -p | grep spandsp
    $ ldconfig && ldconfig -p | grep spandsp
    ```
    If `libspandsp` is not installed, there will be no output. If it is installed, you will get a line for each version available.

  6. cyrenity revised this gist May 23, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion compile-and-install-freeswitch-1.10.x-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Installing FreeSWITCH 1.10.X on Ubuntu 18.04 | Ubuntu 20.04 LTS
    ## Installing FreeSWITCH 1.10.X on Ubuntu 18.04 | 20.04 | 22.04 LTS

    ### Introduction
    FreeSWITCH is a software defined telecom stack that runs on any commodity hardware. FreeSWITCH can handle voice, video and text communication and support all popullar VoIP protocols. FreeSWITCH is flexible and modular, and can be used in any way you can imagine
  7. cyrenity revised this gist May 23, 2024. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion compile-and-install-freeswitch-1.10.x-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,13 @@ $ sudo apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-
    libavformat-dev libswscale-dev libavresample-dev liblua5.2-dev liblua5.2-0 cmake libpq-dev \
    unixodbc-dev autoconf automake ntpdate libxml2-dev libpq-dev libpq5 sngrep
    ```

    ###### Ubuntu 20.04 LTS
    ```bash
    apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-dev libsqlite3-dev libcurl4-openssl-dev \
    libpcre3-dev libspeexdsp-dev libldns-dev libedit-dev libtiff5-dev yasm libopus-dev libsndfile1-dev unzip \
    libavformat-dev libswscale-dev liblua5.2-dev liblua5.2-0 cmake libpq-dev \
    unixodbc-dev autoconf automake ntpdate libxml2-dev libpq-dev libpq5 sngrep
    ```
    #### Install pre-requisites and libraries
    In order to install `libks` First, download latest code from github using following command

  8. cyrenity renamed this gist Jul 18, 2023. 1 changed file with 0 additions and 0 deletions.
  9. cyrenity revised this gist Jul 1, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion compile-and-install-freeswitch-1.10.5-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -108,7 +108,7 @@ If `libspandsp` is not installed, there will be no output. If it is installed, y
    You are now ready to install FreeSWITCH

    #### Installing FreeSWITCH
    Download the FreeSWITCH 1.10.5 release file into `/usr/local/src` directory
    Download the FreeSWITCH 1.10.7 release file into `/usr/local/src` directory
    ```bash
    $ sudo wget -c https://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.7.-release.tar.gz -P /usr/local/src
    ```
  10. cyrenity revised this gist Feb 24, 2023. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions compile-and-install-freeswitch-1.10.5-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,7 @@ $ sudo make && sudo make install
    ```
    To verify if `libks` is installed correctly in your system, run following command
    ```
    $ ldconfig -p | grep libks
    $ ldconfig && ldconfig -p | grep libks
    ```
    In Order to install `libsignalwire` Run following command to download latest code from github

    @@ -56,7 +56,7 @@ $ sudo make && sudo make install
    ```
    To verify if `libsignalwire-client` is installed correctly in your system, run following command
    ```
    $ ldconfig -p | grep signalwire
    $ ldconfig && ldconfig -p | grep signalwire
    ```


    @@ -83,7 +83,7 @@ $ sudo make && sudo make install
    ```
    To verify if Sofia-Sip library is installed correctly in your system, run following command
    ```
    $ ldconfig -p | grep sofia
    $ ldconfig && ldconfig -p | grep sofia
    ```
    If `libsofia-sip` is not installed, there will be no output. If it is installed, you will get a line for each version available.

  11. cyrenity revised this gist Feb 24, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion compile-and-install-freeswitch-1.10.5-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -54,7 +54,7 @@ $ cd /usr/local/src/signalwire-c
    $ sudo cmake .
    $ sudo make && sudo make install
    ```
    To verify if `libks` is installed correctly in your system, run following command
    To verify if `libsignalwire-client` is installed correctly in your system, run following command
    ```
    $ ldconfig -p | grep signalwire
    ```
  12. cyrenity revised this gist Feb 24, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion compile-and-install-freeswitch-1.10.5-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -44,7 +44,7 @@ $ ldconfig -p | grep libks
    In Order to install `libsignalwire` Run following command to download latest code from github

    ```bash
    $ sudo git clone https://github.com/signalwire/signalwire-c.git /usr/local/src/signwalwire-c
    $ sudo git clone https://github.com/signalwire/signalwire-c.git /usr/local/src/signalwire-c
    ```

    Now run following commands in sequence to install the library
  13. Ghulam Mustafa revised this gist Jun 4, 2022. 1 changed file with 46 additions and 5 deletions.
    51 changes: 46 additions & 5 deletions compile-and-install-freeswitch-1.10.5-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,47 @@ $ sudo apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-
    libavformat-dev libswscale-dev libavresample-dev liblua5.2-dev liblua5.2-0 cmake libpq-dev \
    unixodbc-dev autoconf automake ntpdate libxml2-dev libpq-dev libpq5 sngrep
    ```
    Starting from FreeSWITCH version 1.10.4 You have to Download, Compile and install `sofia-sip` and `spandsp` libraries separately

    #### Install pre-requisites and libraries
    In order to install `libks` First, download latest code from github using following command

    ```bash
    $ sudo git clone https://github.com/signalwire/libks.git /usr/local/src/libks
    ```

    Now run following commands in sequence to install the library

    ```bash
    $ cd /usr/local/src/libks
    $ sudo cmake .
    $ sudo make && sudo make install
    ```
    To verify if `libks` is installed correctly in your system, run following command
    ```
    $ ldconfig -p | grep libks
    ```
    In Order to install `libsignalwire` Run following command to download latest code from github

    ```bash
    $ sudo git clone https://github.com/signalwire/signalwire-c.git /usr/local/src/signwalwire-c
    ```

    Now run following commands in sequence to install the library

    ```bash
    $ cd /usr/local/src/signalwire-c
    $ sudo cmake .
    $ sudo make && sudo make install
    ```
    To verify if `libks` is installed correctly in your system, run following command
    ```
    $ ldconfig -p | grep signalwire
    ```


    >Starting from FreeSWITCH version 1.10.4 You have to Download, Compile and install `sofia-sip` and `spandsp` libraries separately


    In order to install Sofia-Sip library, you need to download the latest code from FreeSWITCH’s official Packages repository

    @@ -70,13 +110,13 @@ You are now ready to install FreeSWITCH
    #### Installing FreeSWITCH
    Download the FreeSWITCH 1.10.5 release file into `/usr/local/src` directory
    ```bash
    $ sudo wget -c https://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.5.-release.tar.gz -P /usr/local/src
    $ sudo wget -c https://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.7.-release.tar.gz -P /usr/local/src
    ```
    Extract the release file
    ```bash
    $ cd /usr/local/src
    $ sudo tar -zxvf freeswitch-1.10.5.-release.tar.gz
    $ cd freeswitch-1.10.5.-release
    $ sudo tar -zxvf freeswitch-1.10.7.-release.tar.gz
    $ cd freeswitch-1.10.7.-release
    ````
    Run the configure script
    ```
    @@ -113,7 +153,8 @@ Create a unprivileged system user for running FreeSWITCH daemon
    $ sudo groupadd freeswitch
    $ sudo adduser --quiet --system --home /usr/local/freeswitch --gecos 'FreeSWITCH open source softswitch' --ingroup freeswitch freeswitch --disabled-password
    $ sudo chown -R freeswitch:freeswitch /usr/local/freeswitch/
    $ sudo chmod -R ug=rwX,o= /usr/local/freeswitch/ chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*
    $ sudo chmod -R ug=rwX,o= /usr/local/freeswitch/
    $ sudo chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*
    ```
    ###### Running as systemd service
    In order to run FreeSWITCH in background using systemctl, open `/etc/systemd/system/freeswitch.service` in your favorite editor and copy following content into it
  14. cyrenity revised this gist Sep 13, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion compile-and-install-freeswitch-1.10.5-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Installing FreeSWITCH 1.10.5 on Ubuntu 18.04 | Ubuntu 20.04 LTS
    ## Installing FreeSWITCH 1.10.X on Ubuntu 18.04 | Ubuntu 20.04 LTS

    ### Introduction
    FreeSWITCH is a software defined telecom stack that runs on any commodity hardware. FreeSWITCH can handle voice, video and text communication and support all popullar VoIP protocols. FreeSWITCH is flexible and modular, and can be used in any way you can imagine
  15. cyrenity revised this gist Sep 13, 2021. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions compile-and-install-freeswitch-1.10.5-on-ubuntu-20.04.md
    Original file line number Diff line number Diff line change
    @@ -36,10 +36,10 @@ $ sudo git clone https://github.com/freeswitch/sofia-sip /usr/local/src/sofia-si
    Now run following commands in sequence to install the library

    ```bash
    $ cd /usr/local/src/sofia-ip
    $ cd /usr/local/src/sofia-sip
    $ sudo ./bootstrap.sh
    $ sudo ./configure
    $ sudo make && make install
    $ sudo make && sudo make install
    ```
    To verify if Sofia-Sip library is installed correctly in your system, run following command
    ```
    @@ -57,7 +57,7 @@ Now run following commands in sequence to install the library
    $ cd /usr/local/src/spandsp
    $ sudo ./bootstrap.sh
    $ sudo ./configure
    $ sudo make && make install
    $ sudo make && sudo make install
    ```
    To verify if SpanDSP library is installed correctly in your system, run following command
    ```bash
  16. cyrenity renamed this gist Feb 10, 2021. 1 changed file with 0 additions and 0 deletions.
  17. cyrenity created this gist Feb 10, 2021.
    160 changes: 160 additions & 0 deletions compile-and-install-freeswitch-1.10.5-on-ubuntu-20.04
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,160 @@
    ## Installing FreeSWITCH 1.10.5 on Ubuntu 18.04 | Ubuntu 20.04 LTS

    ### Introduction
    FreeSWITCH is a software defined telecom stack that runs on any commodity hardware. FreeSWITCH can handle voice, video and text communication and support all popullar VoIP protocols. FreeSWITCH is flexible and modular, and can be used in any way you can imagine

    This guide demonstrates how to get it install FreeSWITCH and get it up and running on a Ubuntu 20.04 LTS machine

    ### Prerequisites
    To follow along with this guide, you need one Ubuntu 20.04 LTS server which has prerequisite packages installed and configured. In order to install required packages issue following command

    ###### Ubuntu 18.04 LTS
    ```bash
    $ sudo apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-dev libsqlite3-dev libcurl4-openssl-dev \
    libpcre3-dev libspeexdsp-dev libldns-dev libedit-dev libtiff5-dev yasm libopus-dev libsndfile1-dev unzip \
    libavformat-dev libswscale-dev libavresample-dev liblua5.2-dev liblua5.2 cmake libpq-dev \
    unixodbc-dev autoconf automake ntpdate libxml2-dev libpq-dev libpq5 sngrep
    ```
    ###### Ubuntu 20.04 LTS
    ```bash
    $ sudo apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-dev libsqlite3-dev libcurl4-openssl-dev \
    libpcre3-dev libspeexdsp-dev libldns-dev libedit-dev libtiff5-dev yasm libopus-dev libsndfile1-dev unzip \
    libavformat-dev libswscale-dev libavresample-dev liblua5.2-dev liblua5.2-0 cmake libpq-dev \
    unixodbc-dev autoconf automake ntpdate libxml2-dev libpq-dev libpq5 sngrep
    ```
    Starting from FreeSWITCH version 1.10.4 You have to Download, Compile and install `sofia-sip` and `spandsp` libraries separately

    In order to install Sofia-Sip library, you need to download the latest code from FreeSWITCH’s official Packages repository

    ##### Installing Sofia-Sip library
    Clone the official Sofia-Sip repository into `/usr/local/src` directory

    ```bash
    $ sudo git clone https://github.com/freeswitch/sofia-sip /usr/local/src/sofia-sip
    ```

    Now run following commands in sequence to install the library

    ```bash
    $ cd /usr/local/src/sofia-ip
    $ sudo ./bootstrap.sh
    $ sudo ./configure
    $ sudo make && make install
    ```
    To verify if Sofia-Sip library is installed correctly in your system, run following command
    ```
    $ ldconfig -p | grep sofia
    ```
    If `libsofia-sip` is not installed, there will be no output. If it is installed, you will get a line for each version available.

    ##### Installing SpanDSP library
    Clone the SpanDSP repository from FreeSWITCH packages repository into `/usr/local/src` directory
    ```bash
    $ sudo git clone https://github.com/freeswitch/spandsp /usr/local/src/spandsp
    ```
    Now run following commands in sequence to install the library
    ```bash
    $ cd /usr/local/src/spandsp
    $ sudo ./bootstrap.sh
    $ sudo ./configure
    $ sudo make && make install
    ```
    To verify if SpanDSP library is installed correctly in your system, run following command
    ```bash
    $ ldconfig -p | grep spandsp
    ```
    If `libspandsp` is not installed, there will be no output. If it is installed, you will get a line for each version available.

    You are now ready to install FreeSWITCH

    #### Installing FreeSWITCH
    Download the FreeSWITCH 1.10.5 release file into `/usr/local/src` directory
    ```bash
    $ sudo wget -c https://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.5.-release.tar.gz -P /usr/local/src
    ```
    Extract the release file
    ```bash
    $ cd /usr/local/src
    $ sudo tar -zxvf freeswitch-1.10.5.-release.tar.gz
    $ cd freeswitch-1.10.5.-release
    ````
    Run the configure script
    ```
    $ sudo ./configure
    ```
    > **_Note:_** FreeSWITCH uses SQLite by default for it’s core database although support for other database options Like PostgreSQL, ODBC exists. If you want to enable Postgres or ODBC support than you need to run the `./configure` script with following arguments

    ```bash
    $ sudo ./configure --enable-core-odbc-support --enable-core-pgsql-support
    ```
    Now you are ready to compile and install the FreeSWITCH, run following commands in sequence
    ```bash
    $ sudo make
    $ sudo make install
    ```
    To install sound and music on hold run following command
    ```bash
    $ sudo make cd-sounds-install
    $ sudo make cd-moh-install
    ```
    FreeSWITCH is now installed and you can confirm it by running `sudo freeswitch -nonat` from your terminal

    #### Post install setup
    ###### Create Symlinks (Optional)
    By default, FreeSWITCH will install it’s binaries and configurations in `/usr/local/bin` and `/usr/local/freeswitch`, to make them available system wide you can create following symlinks
    ```bash
    $ sudo ln -s /usr/local/freeswitch/conf /etc/freeswitch
    $ sudo ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/fs_cli
    $ sudo ln -s /usr/local/freeswitch/bin/freeswitch /usr/sbin/freeswitch
    ```
    ###### Create an unprivileged user
    Create a unprivileged system user for running FreeSWITCH daemon
    ```bash
    $ sudo groupadd freeswitch
    $ sudo adduser --quiet --system --home /usr/local/freeswitch --gecos 'FreeSWITCH open source softswitch' --ingroup freeswitch freeswitch --disabled-password
    $ sudo chown -R freeswitch:freeswitch /usr/local/freeswitch/
    $ sudo chmod -R ug=rwX,o= /usr/local/freeswitch/ chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*
    ```
    ###### Running as systemd service
    In order to run FreeSWITCH in background using systemctl, open `/etc/systemd/system/freeswitch.service` in your favorite editor and copy following content into it

    ```bash
    [Unit]
    Description=FreeSWITCH open source softswitch
    Wants=network-online.target Requires=network.target local-fs.target
    After=network.target network-online.target local-fs.target

    [Service]
    ; service
    Type=forking
    PIDFile=/usr/local/freeswitch/run/freeswitch.pid
    Environment="DAEMON_OPTS=-nonat"
    Environment="USER=freeswitch"
    Environment="GROUP=freeswitch"
    EnvironmentFile=-/etc/default/freeswitch
    ExecStartPre=/bin/chown -R ${USER}:${GROUP} /usr/local/freeswitch
    ExecStart=/usr/local/freeswitch/bin/freeswitch -u ${USER} -g ${GROUP} -ncwait ${DAEMON_OPTS}
    TimeoutSec=45s
    Restart=always

    [Install]
    WantedBy=multi-user.target
    ```
    Reload the systemctl daemon

    ```bash
    $ sudo systemctl daemon-reload
    ```
    Start the FreeSWITCH Service

    ```bash
    $ sudo systemctl start freeswitch
    ```
    Check if daemon has start successfully

    ```bash
    $ sudo systemctl status freeswitch
    ```
    ###### Command Line interface
    The `fs_cli` program is a Command-Line Interface that allows a user to connect to a running FreeSWITCH™ instance. The `fs_cli` program can connect to the FreeSWITCH™ process on the local machine or on a remote system. (Network connectivity to the remote system is, of course, required.)