Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

On this page

📋 What’s about

This scenario occurs if you decide to install the push gateway on the same machine (even if we suggest to use an other machine.

METTERE IMMAGINE

📁 Docker Compose File

In this paragraph we’ll analyse the file that you need to download and launch, but before running the file you need to follow the requirements published below - file da correggere perchè aperta solo 5060 per udp e non tcp E MANCA 9998 PER TLS

In the file you will find as directives:

  • push-gateway for notification system

  • redis for cache

  • redisinsight for dashboard

  • drachtio for the stack SIP. In this case you must consider that in SIP protocol the used default ports are 5060 (for UDP/TCP) and 5061 (for TLS), but on XCALLY the Stack SIP is already present with Asterisk. So for the Stack SIP it’s necessary to insert other ports (a 9999 for UDP/TCP and 9998 for TLS)

command: drachtio --contact "sip:*:9999;transport=udp --external-ip 0.0.0.0"        
ports:
  - 9999:9999/udp
  - 9999:9999

As you can see in the file, as system and container ports, you can indicate the desired ones but they must be identical (e.g. 9999:9999) and you need to insert the same number port after sip (e.g. sip:*:9999).
Moreover as external-ip you have to replace 0.0.0.0 with your public IP with which your system exits

  • volumes configuration

  • logging data for logs file

  • restart : always = if the container crashes, it automatically restarts

  • networks section

(blue star) Requirements

  • AGGIUNGERE REQUISITI HARDWARE CON ES. 2 CPU E 4 GB DI RAM PIETRO - Mancano le info relative alle caratteristiche del server che deve ospitare il container col push-gateway, quale hardware, ecc

  • You can use all operating systems, that support the required Docker Engine

  • Before running the docker compose file, ensure that:

    • Docker Engine is installed on the system where you want to run the containers. If for push gateway you use the same server, Docker Engine is installed by default.
      To verify if the Docker is correctly installed, you can lauch the command docker - v and the output will show you the installed Docker version:
      motion@xc-aws-mil-dev-xc01:~$ docker -v

      Docker version 24.0.7, build afdd53b

    • Docker Compose is installed, as the docker-compose.yml file will be used to manage the containers. By using the same machine, Docker Compose is installed by default.
      To verify if the Docker Compose is correctly installed you can launch the command docker compose version and the output will show you the installed Docker compose version:
      motion@xc-aws-mil-dev-xc01:~$ docker compose version

      Docker Compose version v2.21.0

  1. Environment Variables Configuration:

  • Some environment variables are required for the services to function correctly. Make sure to configure them properly before running the docker compose file:

    • DEBUG_LEVEL=info | debug level for the push gateway

    • TOKEN_KEY=xcally.p8 | Token key for authentication

    • TOKEN_KEY_ID=X4R3256H89 | Token key ID

    • TOKEN_TEAM_ID=7WCL6FH953 | Team ID of the token

    • DRACHTIO_HOST=drachtio | Host address of the Drachtio server

    • DRACHTIO_PORT=9022 | Port of the Drachtio server

    • DRACHTIO_SECRET=cymru | Secret for the Drachtio server

Consider that if you decide to define another drachtio name, port, or secret, these data must also be changed in the variables above.

  • Then you can proceed to run che docker compose file

💡 Running the docker-compose.yml File

To run the docker-compose.yml file, follow these steps:

  • Open a terminal or command prompt as root user, pass to motion user, open /home/motion and create the folder named push-gateway

  • Download and open the docker-compose.yml file with a text editor. Modify, if necessary, the environment variables published in requirements and update the content file

  • In the directory where the docker-compose.yml file is located, run the Docker Compose Command to start the containers:

docker compose up -d

With this command, Docker Compose will start the containers in the background.

immagine-20240614-071616.png
  • Verify Container Startup: to verify the status of the containers, you have to run the command:

docker compose ps

You can see the 4 containers correctly present

image-20240614-073114.png
  • Ensure all services listed in the docker-compose.yml file are running correctly

Access RedisInsight:

RedisInsight is the module installed in the docker compose file to view cache content (it works as cache dashboard).

  • Once running, you can access the RedisInsight web interface by opening your browser and navigating to:

http://serverIP:5540

As serverIP you need to indicate the IP of the push gateway machine

By default it is created without database and you need to add it, by inserting

  • host : redis

  • use the default port

  • define the desired alias

  • you can test connection


Add database

Every time a mobile app is connected, you will see all the keys saved in cache memory

The services are now running and ready to be used. You can interact with the push gateway, the Redis server, and the Drachtio server as required.

🔥 Configure the firewall

It’s necessary to configure the firewall to accept requests arriving on different ports:

  • 10000-20000 for RTP stream to allow the voice connection. These ports are open during the call but they are used by Asterisk only after having negotiated ports with external phones

  • 5540 for RedisInsight: optional if you want to reach the service from the web to view cache dashboard

👥 How to configure Mobile Agents

In this scenario, when you create Mobile Agents in Staff Section you will need to specify your Push Gateway Address with the correct port.

In Staff → Agents → Edit Mobile Agent → Mobile App section → Mobile App Push Gateway you need to specify the push gateway address, that in this case your IP/XCALLY server address (the same machine you are using) + the specific port used for push gateway (e.g. myxcallyaddress/9999)

To use TLS protocol, being a secure protocol that requires a certificate, the domain must be that of the certificate, so in this field you can apply only the certified domain and not the IP

image-20240905-103018.png

  • No labels