Worker and Storage Modules
The SIP.TG platform provides the ability to run your own server modules:
- Worker — responsible for processing/converting voice data (SIP ↔ Telegram).
- Session Storage (Storage) — stores keys and access data for Telegram accounts.
These modules can be hosted on your own server in a Docker container, with a dedicated IP address and guaranteed availability. Below is a description of how this works and what steps are needed for setup.
Worker Servers
Worker processes and converts audio streams from SIP to Telegram format and vice versa in real time.
Why it is needed
- Performance guarantee: you choose the equipment yourself, scale it to the needed load.
- Minimal delay: you can place the Worker as close as possible to your PBX to reduce RTT.
- Confidentiality: voice streams are not transmitted to SIP.TG public servers — you process audio data yourself.
- Access to private networks: if desired, the Worker can operate in a local (restricted) network and receive SIP traffic directly from the PBX.
System Requirements
- Docker CE and Docker Compose on a Linux server (e.g., Ubuntu 22.04).
- Dedicated IP address (or TCP port forwarding) for connection from SIP.TG.
- Approximate performance: 1 call ≈ 2.5% CPU on one AMD Ryzen 5 1400 core, ~1 MB RAM when using G.711 (A-law).
Setting Up Your Own Worker
Obtaining Certificates
- In the @siptg_bot bot, execute the
/workers
command and click “New”. - You will be sent 2 files: a private key and a certificate for secure connection with the SIP.TG platform.
- Save them and do not share with third parties.
Server Preparation
- Install OS updates (if necessary).
- Install Docker and Docker Compose.
- Clone or download the Worker configuration template (see GitHub).
- Copy the certificates obtained from the bot to the server and specify paths to them in Docker/Worker settings.
- If necessary, edit parameters in
docker-compose.yml
or in the corresponding configurations (SIP port, RTP range, etc.).
Starting the Worker
-
Start the Docker service:
-
Make sure the Worker container has successfully started and is listening on the specified ports.
-
Check the container logs (command
docker-compose logs
) if errors occur.
Connecting to the Worker
- In the @siptg_bot bot, return to
/workers
, select the created Worker and click “Address”. - Enter the external address and port through which your server is accessible.
- Click “Enable” for SIP.TG to check the connection. If everything is normal, the Worker will switch to “Online” status.
Public or Personal Mode
After enabling the Worker, you can specify:
- Personal (icon ”🔑”) — only the owner and administered Gateway sessions can use the Worker.
- Public (icon ”🌐”) — the Worker will be available to all SIP.TG users.
Limitations for User Workers
- Connections of type PBX→SIP.TG on a user Worker are prohibited by default.
- In case of failure/unavailability of the Worker for more than 30 minutes, the platform may disconnect the associated SIP accounts.
Telegram Session Storage
Storage — a server on which keys and login data for Telegram accounts are stored. Without it, Telegram sessions live in the SIP.TG “cloud”, but if desired, you can store everything on your side.
What Sessions Storage provides
- Full control: confidentiality of access to Telegram accounts, all keys are stored on your server.
- Unlimited number of accounts (subject to your subscription) in one storage.
- Flexible configuration: restriction on commands and events.
System Requirements
- Docker CE / Docker Compose (Linux).
- Dedicated IP address (or TCP port forwarding) for connection from SIP.TG.
- The module uses the TDLib library, so 1-2 GB of RAM is sufficient (but depends on the number of Telegram accounts).
Setting Up Your Own Storage
Obtaining Certificates
- In the @siptg_bot bot, execute the
/storage
command and click “New”. - The bot will send a private key and certificate. Save them to your server.
Server Preparation
- Install and configure Docker / Docker Compose.
- Clone the storage configuration template (see GitHub).
- Place the certificates in the appropriate directories (as specified in
docker-compose.yml
). - If necessary, edit the configuration files (TCP port, database, etc.).
Starting the Storage
-
Execute in the folder with the configuration:
-
Check the container logs (
docker-compose logs
) for errors. -
Make sure the specified TCP port is accessible externally.
Connecting to the Storage
- Return to
/storage
in the @siptg_bot bot, select your storage and click “Address”. - Specify the external address and port through which the SIP.TG platform can connect.
- Click “Enable” to check availability. If everything is OK, the storage will be Online.
Using the Storage
- When creating a new Telegram session (in
/gateway
mode), choose your Storage. - It is impossible to transfer an already created session to another storage, however, you can recreate the session without deleting SIP connections.
Frequently Asked Questions
For full operation of Worker and Storage, a stable connection with the SIP.TG platform (Manager) is required. Make sure your server can access the internet without blockages and that ports are not filtered by the firewall.