- Introduction
- Prerequisites
- Setup and configurations
- Deploy the services
- Access services
- Other documentations
- FAQ
This repository is a forked version of the original repository:
https://github.com/capitalfuse/docker-flexisip, which is updated with required
configurations so you can test on ubuntu 23.10
.
Support features:
- Flexisip proxy server.
- Flexisip proxy server authentication.
- Flexisip proxy server TLS.
- Flexisip account manager.
- Flexisip account manager TLS (Check here).
- phpMyAdmin web interface.
- Flexisip conference server.
- Flexisip presence server.
This project is tested on the following specifications:
- OS:
Ubuntu 23.10
. - Docker:
26.0.0
. - flexisip (GitHub):
8501f5b
(build Docker image).
We will build the flexisip
docker image from the source code using the file
flexisip/docker/flex-from-src
.
- Clone the flexisip source code from the git repository.
Important
You have to clone the repository "recursive" to get the submodules.
-
From Github:
git clone https://github.com/BelledonneCommunications/flexisip.git --recursive
-
From Gitlab:
git clone https://gitlab.linphone.org/BC/public/flexisip.git --recursive
Note
The clone process may take sometimes depending on your internet speed.
- Update the Dockerfile:
-
Add the following lines to the file
flexisip/docker/flex-from-src
:# flexisip/docker/flex-from-src ... # Get source code COPY --chown=bc:bc . flexisip/ + + RUN cd flexisip && ./docker/cmake_install.sh 3.22.6 + # Configure & build RUN cd flexisip \ && rm -rf work && mkdir work \ && cmake -S . -B work -G Ninja -DCMAKE_BUILD_TYPE=${build_type} -DENABLE_SANITIZERS=${sanitizer} -DCMAKE_INSTALL_PREFIX=/opt/belledonne-communications -DSYSCONF_INSTALL_DIR=/etc \ && cmake --build work \ && sudo cmake --build work --target install ...
This will update the cmake version to
3.22.6
to pass thecmake
version requirements defined in theflexisip/CMakeLists.txt
file.
- Build the
flexisip
docker image:
docker build -t flexisip --build-arg='njobs=<njobs>' -f docker/flex-from-src .
- Clone the
flexisip-account-manager
repository from the git repository.
-
From Github:
git clone https://github.com/BelledonneCommunications/flexisip-account-manager.git
-
From Gitlab:
git clone https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
- Move to the
ubuntu23-10
directory:
mv flexisip-account-manager ./ubuntu23-10/
- Change file permissions:
Important
Prevent 500 error from: https://stackoverflow.com/questions/45206228/500-internal-server-error-with-laravel-docker
cd ubuntu23-10/flexisip-account-manager/flexiapi
sudo chmod -R 777 storage && sudo chmod -R 777 bootstrap/cache
The following configuration files are required to run the docker-compose
file:
ubuntu23-10/redis/redis.conf
.ubuntu23-10/flexisip_conf/flexisip.conf
.ubuntu23-10/.env.flexiapi
(flexisip-account-manager,Laravel).ubuntu23-10/nginx/nginx.conf
.
By default, all the configuration files are configured with the IP address
192.168.1.17
, with subdomains. You have to update the IP address to your own
IP address manually in the following files:
Or you can use the perl
command to update the IP address with your own IP
address (recommended):
cd ubuntu23-10
REPLACE_IP="192.168.1.127"
LOCAL_IP="192.168.1.17"
perl -i -pe 's/'"$LOCAL_IP"'/'"$REPLACE_IP"'/g' ./.env.flexiapi ./flexisip_conf/flexisip.conf
Or you can use the perl
command to update the IP address with your own IP
address and remove the subdomains:
cd ubuntu23-10
REPLACE_IP="192.168.1.127"
LOCAL_IP="192.168.1.17"
perl -i -pe 's/(?<=[=\"])(\w*\.)?'"$LOCAL_IP"'\.nip\.io/'"$REPLACE_IP"'/g' ./.env.flexiapi ./flexisip_conf/flexisip.conf
ubuntu20-04/docker_files/redis/redis.conf
.docker/flexisip.conf.sample
.ubuntu20-04/.env
(for docker compose file).flexisip-account-manager/flexiapi/.env
(flexisip-account-manager,Laravel)`.ubuntu20-04/docker_files/nginx/nginx_default.conf
.
To get the default flexisip.conf
config
file,
you can run the following command:
docker exec ubuntu-flexisip flexisip --dump-all-default > flexisip.conf
Note
If you are using different flexisip
image, you have to update the image name
for ubuntu-flexisip
service in the docker-compose.yml
file.
- Move to the
ubuntu23-10
directory:
cd ubuntu23-10
- Run the
docker-compose
file:
docker-compose up
- Enter the
flexisip-account-manager
container:
docker exec -it php-fpm-laravel /bin/bash
- Run the following commands to setup the
flexisip-account-manager
server:
cd flexiapi
composer install
php artisan key:generate
php artisan migrate
- (Optional): Serve the
flexisip-account-manager
server directly:
Note
Please make sure to finish step 2 before running the following commands.
docker exec -it php-fpm-laravel /bin/bash
php artisan serve --host=0.0.0.0
Then you can access the flexisip-account-manager
server routes using the URL:
http://localhost:8000
# or
http://localhost:8000/documentation
# or
http://localhost:8000/api
After running the docker-compose
file, you can check the service ports using
the following command:
docker ps
You will get the following output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c36887f00b26 flexisip "/flexisip-entrypoin…" 2 minutes ago Up 2 minutes 0.0.0.0:5060-5061->5060-5061/tcp, :::5060-5061->5060-5061/tcp ubuntu-flexisip
dfb4f558e7d3 nginx:alpine "/docker-entrypoint.…" 9 hours ago Up 2 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp nginx
b533a69ea894 phpmyadmin/phpmyadmin:fpm-alpine "/docker-entrypoint.…" 34 hours ago Up 2 minutes 9000/tcp phpmyadmin-fpm
9d285f04e50c ubuntu23-10-php-fpm-laravel "docker-php-entrypoi…" 34 hours ago Up 2 minutes 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 9000/tcp php-fpm-laravel
2421c502e2ea redis:alpine "docker-entrypoint.s…" 34 hours ago Up 2 minutes 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp redis
8cd52def74d5 mariadb "docker-entrypoint.s…" 34 hours ago Up 2 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp flexisip-mariadb
Since the network_mode
is not compatible with other
OS,
it's changed to expose the ports to the host machine.
Note
Remove the network_mode: "host"
means you can't access the flexisip
server
from the host machine, so you no longer can use wireshark
to capture the SIP
packets.
Debug when using network_mode: "host"
For the ubuntu-flexisip
container, it configured with network_mode: "host"
,
it's running in the host network, so you can't see the ports in the docker ps
command.
As the flexisip
server should be listen on the port 5060
, you can check the
port using the following command:
sudo netstat -ntlp | grep LISTEN | grep flexisip
You will get the following output:
tcp 0 0 127.0.0.1:5060 0.0.0.0:* LISTEN 61046/flexisip
tcp 0 0 172.17.0.1:5060 0.0.0.0:* LISTEN 61046/flexisip
tcp 0 0 172.18.0.1:5060 0.0.0.0:* LISTEN 61046/flexisip
tcp 0 0 192.168.1.17:5060 0.0.0.0:* LISTEN 61046/flexisip
tcp6 0 0 2402:800:631d:23a9:5060 :::* LISTEN 61046/flexisip
tcp6 0 0 ::1:5060 :::* LISTEN 61046/flexisip
tcp6 0 0 2402:800:631d:23a9:5060 :::* LISTEN 61046/flexisip
Important
The flexisip
server is listening on the port 5060
, but it won't receive
any REGISTER
requests from these domains, only if you configure the
reg-domains
in file
ubuntu23-10/flexisip_conf/flexisip.conf
.
However, we still can register with localhost
, which is the default value of reg-domains
.
You can access the phpMyAdmin
using the following URL:
http://localhost/phpmyadmin
With the credentials defined for MariaDB
in the docker-compose.yml
file:
-
Root user:
- Username:
root
. - Password:
mysql
.
- Username:
-
Normal user:
- Username:
mysql
. - Password:
mysql
.
- Username:
You can access the Flexisip Account Manager
using the following URL:
-
API documentation:
http://account.<YOUR-LOCAL-IP>.nip.io/api
-
Swagger documentation:
http://account.<YOUR-LOCAL-IP>.nip.io/documentation
-
Login page:
http://account.<YOUR-LOCAL-IP>.nip.io/login
-
Register page:
http://account.<YOUR-LOCAL-IP>.nip.io/register
You can access the MariaDB
database using Dbeaver, with
phpMyAdmin
as mentioned above, or any other database
client tool with these credentials:
-
Host:
localhost
. -
Port:
3306
. -
Root user:
- Username:
root
. - Password:
mysql
.
- Username:
-
Normal user:
- Username:
mysql
. - Password:
mysql
.
- Username:
-
I can't register my account with softphone clients
-
Wrong password.
-
Check the email domain registered from the
flexisip-account-manager
server whether it is included in BOTHreg-domains
andauth-domains
in fileubuntu23-10/flexisip_conf/flexisip.conf
. -
Softphone client doesn't support hash algorithm configured in the
flexisip.conf
file. If you want theflexisip
server to be compatible with most of the softphone clients, you can switch theavailable-algorithms
toMD5
inenv.flexiapi
. Also, you have to update the algorithm in theflexisip.conf
server.
-
Caution
Changing the hash algorithm will make the user no longer access to their account.
-
I can't access the account manager web page
-
Make sure you update the IP address in the
.env.flexiapi
andflexisip.conf
files as mentioned in the Update base ip address section. -
Make sure you have setup the flexisip-account-manager server as mentioned in the Setup the Flexisip Account Manager server section.
-
-
I can't build the
flexisip
docker image-
Make sure you cloned the
flexisip
source code with the submodules (recursive). -
Make sure you have followed the steps in the Build
flexisip
docker image from source code section. -
Check the
cmake
version in theflexisip/CMakeLists.txt
file. If it is higher than the version defined in theflexisip/docker/flex-from-src
file, you have to update thecmake
version in theflexisip/docker/flex-from-src
file. -
Try to clone the
flexisip
source code that matches theflexisip
version mentioned in the Prerequisites section.
-
-
On MacOS, I can't register my account with the softphone client
- You have to use
TCP
as the transport protocol, because theUDP
is not working properly. But on Linux, you can useUDP
without any issues.
- You have to use