Install your own Push Gateway

What’s about

This section provides detailed instructions on how to correctly run the docker-compose.yml file to set up an environment containing the XCALLY Push Gateway, a Redis server, a RedisInsight instance and a Drachtio server.

To use XCALLY Mobile App, it is necessary to configure your own push gateway (with push gateway and stack SIP on the same server through docker) by following these guidelines and when you create Mobile Agents, as Mobile App Push Gateway you need to insert YOUR_IP_SERVER:5060

 

Requirements

To successfully run the docker-compose.yml file, ensure the following requirements are met:

  1. Install a fresh Linux server (recommended Debian distribution)

  2. Docker Engine: Must be installed on the system where you want to run the containers.

  3. Docker Compose: Ensure Docker Compose is installed, as the docker-compose.yml file will be used to manage the containers.

  4. Environment Variables Configuration (only for advanced users):

  • The environment variables are already set in the docker-compose.yml, usually you won’t need to change them.
    The necessary environment variables are:

    • DEBUG_LEVEL: Debug level for the push gateway.

    • TOKEN_KEY: Token key for authentication.

    • TOKEN_KEY_ID: Token key ID.

    • TOKEN_TEAM_ID: Team ID of the token.

    • DRACHTIO_HOST: Host address of the Drachtio server.

    • DRACHTIO_PORT: Port of the Drachtio server.

    • DRACHTIO_SECRET: Secret for the Drachtio server

  • Ensure these values are set and ready before running the docker-compose.yml.

Running the docker-compose.yml File

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

  1. Configure Environment Variables:

  • Download and open the docker-compose.yml file with a text editor:

  • Modify the listed environment variables in the "Requirements" section with appropriate values.

  • Insert the public IP of your push-gateway server by replacing <push-gw externip> in the following line:

    command: drachtio --contact "sip:*:5060;transport=udp" --external-ip <push-gw externip>
  1. Run the Docker Compose Command:

  • Open a terminal or command prompt.

  • Navigate to the directory where the docker-compose.yml file is located.

  • Run the following command to start the containers:

docker compose up -d

 

immagine-20240614-071616.png

 

  1. Verify Container Startup:

  • After running the command, Docker Compose will start the containers in the background.

  • You can verify the status of the containers by running the command:

docker compose ps

 

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

 

  1. Access RedisInsight (optional container):

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

 

  • Use the default credentials (if any) to log in to RedisInsight and monitor the Redis instance

 

  1. Using the Services:

  • 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.

 

  1. Configure the firewall to accept requests arriving on ports:

    • 5540 TCP for Redisinsight: optional if you want to reach the service from the web

    • 5060 UDP for Drachtio (mandatory to make it work)

    • 5061 TCP for Drachtio TLS (mandatory to make it work)

How to stop the Containers

To stop and remove the containers (preserving the data), run the following command in the same directory as the docker-compose.yml file:

 

This command will stop and remove all containers associated with the docker-compose.yml file.

These instructions should guide you through the process of running the provided docker-compose.yml file.

If you encounter any issues during the execution or have additional questions, please don't hesitate to ask for assistance.

Otherwise, to remove the whole stack (including data):

 

Instead, to remove the single container:

 


How to restart the container

 

<service name> is the name assigned within the docker-compose.yml e.g. service drachtio

Service Name

Description

Service Name

Description

push-gateway

service to generate push notification

redis

cache server

redisinsight

web GUI for redis

drachtio

proxy sip

 

To recreate the single container:

 

How to view logs or status

To view container logs:

 

To view container status:

 

To access a container:

To exit the container, type exit.

Related pages