Owner and user roles of SIP account

SIP account Owner — a Telegram user who creates a SIP account in the @siptg_bot bot. The owner has full control over creating, deleting, and changing SIP account settings, and can also assign accounts to other users.

SIP account User — a person to whom the owner has assigned a SIP account. They can use the account to make and receive calls, but cannot change the settings of the account itself.

The subscription for the softphone must be activated to the Telegram account of the Owner. The user’s subscription has no effect on SIP accounts that belong to other owners!

Principle of interaction with settings buttons

Most settings are displayed directly on the buttons in the form of current values. To change these settings, simply press the corresponding button and enter a new value as requested by the bot.

However, some buttons work differently:

  • Worker: when pressed, a list of available Worker servers appears. Select the desired server from the list to assign it.
  • Buttons with checkboxes: such as “Call Recording”, work as toggles. One press activates or deactivates the option.
  • Chat for recordings: when pressed for the first time, an additional button for selecting a chat will appear. By pressing this button, you will see a list of chats and channels available for selection. Choose a suitable chat for call recordings to be saved there.
  • User: when pressed for the first time, an additional button for selecting a user will appear. By pressing this button, you can select another Telegram user to whom this SIP account will be assigned.
  • Connection protocol (UDP/TCP/TLS): each press switches to the next available protocol.

Step by step setup

1

Getting started with the bot

  • Launch the @siptg_bot bot.
  • Go to the /softphone section.
  • Press the “New” button to create a new SIP account.
2

Entering SIP account parameters

  • Enter the login and password received from your IP telephony provider or SIP PBX.
  • Specify the domain (SIP server address).
  • If necessary, specify a separate Registrar Proxy (registration server).
  • Prepared settings of the IP telephony operator can also be selected from the catalog, which is accessible via the “Settings Templates” button.
3

Additional settings

  • Select the transport protocol: UDP, TCP, or TLS.
  • Select and configure audio codecs supported by your provider.
  • Configure the DTMF signal transmission method (RFC2833, INFO, inband).
  • Set rules for transforming numbers for outgoing calls.
4

Test calls

  • Check in the SIP provider/PBX account that the account is registered.
  • Try an outgoing call (send a number to the @siptg chat).
  • If everything is well, try an incoming call (to the SIP account number).
  • For authorization errors or problems, see Troubleshooting.
5

User assignment

  • If necessary, so that calls go not to you but to another employee, assign a Telegram User to this SIP account.
  • Now all calls will go to the employee, and you will receive notifications if there is a problem with the SIP account.
6

Additional settings

  • Call recording: enable the option and select a chat for storing recordings.
  • Transformation rules: for changing the format of the dialed number (for example, +7 → 8).

Some settings take effect after pressing the “Apply” button, or after 5 minutes. After completing the steps, the account will become active and ready to work.

Available settings

Screenshot with SIP account settings

Transforming outgoing numbers

Sometimes for outgoing calls, it’s necessary to automatically change the dialed number to meet the requirements of the SIP provider or PBX (for example, replace the first “8” with “+7” or remove spaces and brackets). In SIP.TG, this is configured using Transformation Rules in the SIP account settings.

If your provider accepts numbers in any format or you’re using a ready-made Settings Template, dialing rules are most likely not needed. Before making changes, check the requirements for the number format with your SIP provider or within the PBX.

There are 2 types of rules:

  • Rules with ”=” — replacing part of the number.
    If the left part of the rule (regular expression) is found, it’s replaced with the right part.
  • Rules without ”=” — filter (mask).
    If the number doesn’t match the regular expression, the rule interrupts processing, and the call is not made.

All rules are separated by spaces and applied in sequence. As soon as the number stops matching even one filter rule (without ”=”), the use of the SIP account for calling that number is not allowed. Each replacement rule (with the ”=” sign) changes the number before it’s checked by the following filter rules.

Editing rules in the bot

  1. In the @siptg_bot bot, go to the /softphone section.
  2. Select the desired SIP account, press the “Dialing Rules” button.
  3. Enter one or more rules, separating them with spaces.
  4. Confirm the changes.
  5. Check with a test call that the numbers are transformed correctly.

All rules work on the “left to right” principle. Note that adding too many filters or ambiguous replacements can lead to unexpected results. For complex scenarios, test with a couple of real numbers.

Examples

Let’s consider the task: we dial numbers like “8 (926) 123-45-67”, but the provider requires “7XXXXXXXXXX”.

Suppose we need to remove all non-digit symbols and turn the prefix 8 into 7.

Here are two rules (written with a space):

[^+*#\w]= ^8=7

The first removes all characters except digits, letters, plus, and some special characters (*, #, _).
The second replaces the first digit 8 with 7.

Now if the user enters 8 (926) 123-45-67, after the first rule the string will become 89261234567, and after the second — 79261234567.

If you encounter problems or errors, see Troubleshooting.