Table of Contents | ||
---|---|---|
|
1. Connecting to services
First, verify the containers using the following command: docker ps -a
. This will show a list similar to this:
...
To connect to each container, use the following command: docker exec -it CONTAINER_NAME bash
. This runs bash
and shows a console inside the container where you can execute the standard commands (asterisk -rvvv
, fs_cli
, kamctl
, etc.). However, you must be careful when changing files as you might modify their permissions (please, check this with the ls -ln
command, and restore the original permissions if required).
...
Info |
---|
A special scenario: When you reuse an IP address from a Node or WebRTC Gateway, the SSH connection will fail because their fingerprint will have changed. As a result, you will be warned of a possible security failure (a connection against a known host is expected, but instead the found host is another). You can see an error in the trace logs of Presence OpenGate web services. To fix this problem, connect to this module and clear the entry which causes this conflict in the |
2. Traces
By default, containers write their traces to the standard I/O Streams that every process opens on Linux. Then, a logging driver stores every message sent to those streams. By default, the json-file logging driver has been used so traces can be queried with the docker logs
command.
If you wish to export all tracing from the previous day: docker compose logs -t --since 48h --until 24h | gzip -c > yesterdaylogs.gz
(adjust 48h / 24h to the time range you need).
If you want to see real-time traces for all services: docker compose logs -t --since 0m --follow
.
If you want to see traces only for a service: docker logs -t --since 0m --follow asterisk_og
(where asterisk_og
is the desired container).
3. Environment variables of containers
Variables allow you to customize the configuration of containers. We define the The minimum required to configure an environment is defined in the docker-compose.yml
and .env
files, but there are more variables that allow for further configuration and must be manually defined.
Common variables in all environments, as defined in the .env
file:
TZ=Europe/Madrid
Used to set the time zone.SSH_USERNAME=opengate
Used to set the username in the SSH server. All Nodes and WebRTC Gateways of an environment must also have the same.SSH_PORT=2222
Used to set the SSH server port. All Nodes and WebRTC Gateways of an environment must also have the same.
Info |
---|
If you want to set a variable that does which is not appear contained in the |
...
PostgreSQL: Check the official documentation at https://github.com/docker-library/docs/blob/master/postgres/README.md#environment-variables .
SSH Server: Check the official documentation at https://github.com/linuxserver/docker-openssh-server?tab=readme-ov-file#parameters .
Web services:
DB_HOST=localhost
Used to set the IP or hostname of the database.DB_NAME=opengate
Used to set the database name.DB_USER=opengate
Used to set the database user.DB_PASSWORD_FILE=/run/secrets/db_password
Used to set the “secret” path, which contains the database connection password.SIP_REGISTRAR_IP=127.0.0.1
Used to set the IP address used to configure the SIP Registrar.MASTER_ASTERISK_IP=127.0.0.1
Used to set the IP address of the interface connected to the data network of the Master node. This must match the DATA_BINDADDR value of the master Asterisk.RECORDING_MOUNT_POINT
Used to set the mount point of Presence Recording . This information is required to generate the configuration that Asterisk uses to record to store both the recordings path of this module and the recordings path of user extensions.LOG_TO_DEFAULT=True
Used to set the traces to be logged in the standard location. If set to “False”, traces will be logged in a file.SSH_USERNAME=opengate
Used to set the username of the SSH connections.SSH_PORT=2222
Used to set the port for SSH connections.SSH_KEY_FILE=/run/secrets/ssh_key
Used to set the “secret” path, which contains the SSH private key.SSH_KEY_PUB_FILE=/run/secrets/ssh_key.pub
Used to set the “secret” path, which contains the SSH public key.RESTORE_MODE=False
Allows you to enable the restore mode to load a previous backup copy when the value is set to “True”.UNIMRCP_SERVER_IP=127.0.0.1
Used to set the UniMRCP Server IP address of the UniMRCP server.SIP_ALIASES=sample1.domain.com,sample2.doman.com
Used to set the list of domains (comma separated) if extensions use a domain to connect to the SIP Registrar.
Asterisk:
DATA_BINDADDR="0.0.0.0"
Used to set the IP address of the data network.SIP_BINDADDR="0.0.0.0"
Used to set the IP address of the SIP server.LOG_TO_DEFAULT=True
Used to set that traces to be logged in the standard location. If set to “False”, traces will be logged in a file.RUN_CONVERTER=False
Used to set whether or not the audio format converter is to run. This is only set to “True” in the Master node.SIP_TLS_PEM_FILE=/run/secrets/tls_pem
Used to set the “secret” path, which contains the TLS certificate for SIP.ASTERISK_ARGS="-fpvvvg"
Used to set the parameters that are used to launch the Asterisk exec file.CHECK_FILE="/etc/asterisk/presence-scripts/create_conf_files.sh"
Used to set the file that is to be checked before you start Asterisk. This check is to make sure that the Unified Administration has successfully loaded the configuration prior to the Asterisk startup.
FreeSWITCH:
FS_EXTIP=127.0.0.1
Used to set the external IP address of FreeSWITCH (public IP).FS_PRIVIP=127.0.0.1
Used to set the IP address of the network interface connected to the private network. This network is used to connect to the nodes and to the rest of the OpenGate system.FS_DMZIP=$FS_PRIVIP
Used to set the IP address of the network interface connected to the DMZ network. If there is no separation between the private / DMZ networks, then the network is the same and there is no need to be specified.FS_UA_ACL=$FS_PRIVIP/24
Used to set an ACL (Access Control List) of IPs from which Presence OpenGate web services can connect to FreeSWITCH (to make change in the configuration). By default, let’s assume this is the private network in a subnetwork /24. If the Master node falls outside this range, you have to update this variable to match the network address of OpenGate web services.FS_WSSPORT=7443
Used to set the WSS Port (WebSocket Secure) used to establish the WebRTC connections.FS_RTPSTARTPORT=22000
andFS_RTPENDPORT=24600
Used to set the range of ports used for RTP.FS_CODEC=PCMA
Used to set the codecto establish the WebRTC connection. The values are the following: PCMA, PCMU, OPUS.FS_TLS_PEM_FILE=/run/secrets/tls_pem
Used to set the “secret” path, which contains the TLS certificate for WSS and SRTP.FS_REVERSEPROXY_ACL=255.255.255.255/32
Used to specify an ACL where a reverse proxy is running (example: 10.100.1.99/32 to match a reverse proxy in with IP 10.100.1.99).
4. Clearing all environment configuration
In case you need for any reason to start over from the beginning, execute this command: docker compose down -v
. Note: This is a destructive action and cannot be reversed! As a result, all database contents, all music files, all configuration and custom files, etc. will be removed.
However, you will keep your docker-compose.yml
and .env
files, with the changes you have made on them, as well as the secrets, and backup files stored by default in a “backups” folder.