> ## Documentation Index
> Fetch the complete documentation index at: https://www.sip.tg/llms.txt
> Use this file to discover all available pages before exploring further.

# Worker and Storage Modules

export const bot = {
  ACTIVATE_TARIFF_PLAN: "Activate subscription",
  ADDRESS: "Address",
  ADDRESS_PORT: "Address:port",
  ADMIN_ASSIGN: "Assign administrator",
  APPLY: "Apply",
  ARBITRARY_CHECK: "Messages processing",
  AUTORENEW: "Auto renewal",
  AUTOREPLY: "Autoreply",
  BACK: "Back",
  BACK_TO_PAYMENT: "Back to payment",
  BALANCE_TRANSFER: "Transfer",
  BILLING: "Billing",
  BTN_CHARGE_REDIRECT: "Confirm charge",
  BTN_EMPTY_BOT: "Inline bot",
  BTN_TARIFF_NEW: "Activate",
  CALLBACK_CHECK: "Callback",
  CALLBACK_SWITCH_OFF: "Switch off Callback mode",
  CALLBACK_SWITCH_ON: "Switch on Callback mode",
  CALLER_NAME: "Caller name",
  CALLER_PHONE: "Caller phone",
  CANCEL: "Cancel",
  COMMENT: "Comment",
  CONFIGURE_ACCOUNT_ALLOW_EVERYBODY: "Allow calls from all users",
  CONFIGURE_ACCOUNT_ALLOW_P2P: "Allow P2P calls from everybody",
  CONFIGURE_ACCOUNT_DISALLOW_GROUPS: "Disallow adding to groups",
  CONFIGURE_ACCOUNT_OFF_OTHER_SESSIONS_CALLS: "Disable calls on other devices",
  COUNTRY: "Country",
  DELETE: "Delete",
  DESCRIPTION: "Description",
  DIAL_RULES: "Dial Rules",
  DOC_BTN_PROVIDE: "Provide documentation",
  DOMAIN: "Domain",
  DTMF_METHODS: "DTMF Methods",
  FIELD_VALUE: "Field:Value",
  FORMATS: "Audio Codecs",
  FW_ADD: "Add phone number",
  FW_ADD_OTHER: "Other number",
  FW_ADD_SELF: "Telegram number",
  FW_ANTISPAM: "Anti-spam",
  FW_BACK: "Back",
  FW_BONUS_PROGRAM: "Referral program",
  FW_CANCEL: "Cancel",
  FW_DELETE: "Delete",
  FW_NAME: "Name",
  FW_NO: "No",
  FW_PHONE_FORWARDING: "Remind number",
  FW_RECORDER_CHAT: "Chat for recordings",
  FW_RECORDER_CHECKBOX: "Call recording",
  FW_SELECT_COUNTRY: "Choose country (region)",
  FW_SHARE_PHONE: "Send phone number",
  FW_TELL_FRIENDS: "Tell friends",
  FW_YES: "Yes",
  GATEWAY_IN_RESET: "Reset Password",
  GATEWAY_IN_SHOW: "Show Account",
  GATEWAY_OUT_NUMBER: "Number on PBX",
  GENERATE_NEW: "Generate new",
  GIVE_ACCESS: "Give the access",
  GIVE_PHONE_NUMBER: "Give phone number",
  HELP: "Help",
  INLINE_QUERY: "Inline query",
  INVOICE_BANK_IGNORE_CURRENT_RATE: "Ignore currency rate",
  KEYPAD_IN: "DTMF In",
  KEYPAD_OUT: "DTMF Out",
  KEYS_GET: "Get Keys",
  KEYS_RESET: "Reset Keys",
  LEARN_ABOUT: "Learn about SIP.TG",
  LINES: "Lines",
  LINES_CHECK: "Lines",
  LOGIN: "Login",
  MANUAL: "Manual",
  MODE_GATEWAY: "Gateway mode",
  MODE_SOFTPHONE: "Softphone mode",
  NAME: "Name",
  NEW: "New",
  NEW_IN: "🆕 PBX→SIP․TG",
  NEW_IP: "🆕 IP⇿IP",
  NEW_OUT: "🆕 SIP․TG→PBX",
  NO: "No",
  PARALLEL_DECLINE: "Decline",
  PARALLEL_END: "End",
  PARALLEL_SWITCH: "Switch",
  PARALLEL_TRANSFER: "Transfer",
  PASSWORD: "Password",
  PAYER: "Payer",
  PAYSYSTEM_BTN_VERIFY: "Specify country of residence",
  PAYSYSTEM_DOCS_PROVIDE: "Provide documents",
  PAYSYSTEM_METHOD: "Payment method",
  PAY_TARIFF: "Pay",
  PROLONG: "Renew",
  PROMO_BUTTON_EMPTY: "Discount code",
  RECONNECT: "🔄 Reconnect",
  RECORDER_ACTIVATE: "🔴 Start recording",
  RECORDER_ACTIVATE_FAILED: "⚠️ Start recording",
  RECORDER_CHAT: "Chat for recordings",
  RECORDER_CHECKBOX: "Call recording",
  RECORDER_DEACTIVATE: "🟥 Stop recording",
  RECORDER_DEACTIVATE_RECONNECTING: "⌛ Stop recording",
  RECORDER_LOCKED: "🔒 Recording locked",
  REDIAL: "Redial",
  REDIAL_CHECK: "Redial",
  REGISTRAR: "Proxy",
  REPEAT: "Repeat",
  SELECT_BOT: "Select bot",
  SELECT_CHANNEL: "Select channel",
  SELECT_CHAT: "Select chat",
  SELECT_USER: "Select user",
  SERVER_FROM_TEMPLATE: "Settings templates",
  SESSION_BILLER_CHECK: "Use a shared subscription",
  SESSION_CONFIGURE_ACCOUNT: "Configure Telegram account",
  SESSION_LOGIN: "Connect",
  SESSION_LOGOUT: "Disconnect",
  SETTINGS: "Settings",
  START_CALLING: "Go to calls",
  SUPPORT: "Support",
  SWITCH_OFF: "Switch off",
  SWITCH_ON: "Switch on",
  TAKE: "Take",
  TARIFF_ACTIVATE_CHANGE_USER: "Change customer",
  TARIFF_ACTIVATE_USER: "Activate for customer",
  TARIFF_ACTIVATE_YOURSELF: "Activate yourself",
  TAX_ADDRESS: "Address",
  TAX_BUSINESS: "Business",
  TAX_NAME: "Buyer",
  TAX_NUMBER: "Tax number",
  TERMINATE_SESSION: "Terminate the session",
  TERMS_AGREE: "Agree with Terms and Conditions",
  TG_STORAGE_OFFICIAL: "✅ SIP․TG Sessions Storage",
  TRANSFER: "Transfer",
  TRANSFER_BACK: "Transfer back",
  TRUSTED_IPS: "Trusted IPs",
  UNLINK: "Unlink",
  USER: "User",
  VERIFY_ROUTE_BAD: "👎 No, it's spam",
  VERIFY_ROUTE_GOOD: "👍 Yes, all good",
  VERIFY_ROUTE_RECOVER: "Recover incoming calls",
  WORKER_AUTO: "Auto",
  YES: "Yes"
};

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.

<a id="worker" />

## Worker Servers

<Info>
  Worker processes and converts audio streams from SIP to Telegram format and vice versa in real time.
</Info>

<a id="worker-what-for" />

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

<a id="worker-requirements" />

### 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).

<a id="worker-setup" />

### Setting Up Your Own Worker

<Steps>
  <Step title="Obtaining Certificates">
    1. In the [@siptg\_bot](https://t.me/siptg_bot?start=utm_docs) bot, execute the `/workers` command and click **{bot.NEW}**.
    2. You will be sent 2 files: a private key and a certificate for secure connection with the SIP.TG platform.
    3. Save them and do not share with third parties.
  </Step>

  <Step title="Server Preparation">
    1. Install OS updates (if necessary).
    2. Install Docker and Docker Compose.
    3. Clone or download the Worker configuration template (see [GitHub](https://github.com/siptg/worker)).
    4. Copy the certificates obtained from the bot to the server and specify paths to them in Docker/Worker settings.
    5. If necessary, edit parameters in `docker-compose.yml` or in the corresponding configurations (SIP port, RTP range, etc.).
  </Step>

  <Step title="Starting the Worker">
    1. Start the Docker service:

       ```bash theme={null}
       docker-compose up -d
       ```
    2. Make sure the Worker container has successfully started and is listening on the specified ports.
    3. Check the container logs (command `docker-compose logs`) if errors occur.
  </Step>

  <Step title="Connecting to the Worker">
    1. In the [@siptg\_bot](https://t.me/siptg_bot?start=utm_docs) bot, return to `/workers`, select the created Worker and click **{bot.ADDRESS}**.
    2. Enter the external address and port through which your server is accessible.
    3. Click **{bot.SWITCH_ON}** for SIP.TG to check the connection. If everything is normal, the Worker will switch to "Online" status.
  </Step>
</Steps>

<a id="worker-mode" />

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

<a id="worker-limitations" />

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

<a id="storage" />

## Telegram Session Storage

<Info>
  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.
</Info>

<a id="storage-what-for" />

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

<a id="storage-requirements" />

### 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).

<a id="storage-setup" />

### Setting Up Your Own Storage

<Steps>
  <Step title="Obtaining Certificates">
    1. In the [@siptg\_bot](https://t.me/siptg_bot?start=utm_docs) bot, execute the `/storage` command and click **{bot.NEW}**.
    2. The bot will send a private key and certificate. Save them to your server.
  </Step>

  <Step title="Server Preparation">
    1. Install and configure Docker / Docker Compose.
    2. Clone the storage configuration template (see [GitHub](https://github.com/siptg/storage)).
    3. Place the certificates in the appropriate directories (as specified in `docker-compose.yml`).
    4. If necessary, edit the configuration files (TCP port, database, etc.).
  </Step>

  <Step title="Starting the Storage">
    1. Execute in the folder with the configuration:

       ```bash theme={null}
       docker-compose up -d
       ```
    2. Check the container logs (`docker-compose logs`) for errors.
    3. Make sure the specified TCP port is accessible externally.
  </Step>

  <Step title="Connecting to the Storage">
    1. Return to `/storage` in the [@siptg\_bot](https://t.me/siptg_bot?start=utm_docs) bot, select your storage and click **{bot.ADDRESS}**.
    2. Specify the external address and port through which the SIP.TG platform can connect.
    3. Click **{bot.SWITCH_ON}** to check availability. If everything is OK, the storage will be Online.
  </Step>
</Steps>

<a id="storage-usage" />

### Using the Storage

* When creating a new Telegram session (in the bot section `/gateway`), 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.

<a id="faq" />

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What if my Worker (or Storage) suddenly becomes unavailable?">
    The SIP.TG platform periodically checks the connection. If the server doesn't respond for more than 30 minutes, the Worker/Storage will switch to "Disabled" status. All SIP accounts working through this Worker will become inactive. The storage will stop servicing requests. You can resume operation by restoring server availability and re-enabling the module in the bot.
  </Accordion>

  <Accordion title="Can I use only a Worker without my own Storage (or vice versa)?">
    Yes. These modules are independent. You can store Telegram sessions in the SIP.TG cloud but process SIP streams on your Worker. Or vice versa: use public Worker servers but store sessions on your side.
  </Accordion>

  <Accordion title="How labor-intensive is it to maintain these modules?">
    The main task is to keep Docker containers operational, update software (Worker/Storage image) as new versions are released, and monitor network availability. If you don't have your own DevOps specialist, it's easier to use SIP.TG public resources.
  </Accordion>

  <Accordion title="What about security and licensing?">
    * All connections between the SIP.TG platform and your modules are encrypted using certificates.
    * By default, Docker images based on Ubuntu are used. All additional dependencies are pre-installed.
    * See license and terms of use in GitHub repositories.
  </Accordion>

  <Accordion title="How do I provide other users access to my Worker?">
    Change the Worker mode to "Public". Then any SIP.TG user can assign your Worker to themselves. You can also keep the Worker "Personal", but use it only with some of your SIP accounts in the [@siptg\_bot](https://t.me/siptg_bot?start=utm_docs).
  </Accordion>
</AccordionGroup>

<Warning>
  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.
</Warning>
