Gateway settings

The platform allows to use your Telegram account as a gateway in your PBX or call center. You can create a Telegram account for your business, promote it to your clients and receive the calls from Telegram users. They will fall into a general queue of a virtual PBX. Moreover, operators can redial the client and the client will receive the call from your company.

New Session

Send /gateway command to @siptg_bot and push Login

The bot will ask to send your phone number to authorize.

For security reasons we don't ask your password of two factor authentication. Telegram session for SIP.tg can be created only if you set up a reserve email while you switching two factor authentication on: a verify code will be delivered to this email. If not, you have to switch two factor authentication off for a while and after the new session for the gateway will be created you can switch it on back.

After that you will ready to create SIP accounts to use them with your Telegram session. You can setup accounts to connect virtual PBX to SIP.tg and vice versa, switch on/off DTMF keypad for your gateway and allow/disallow calls to arbitrary numbers through your gateway.

Connecting the virtual PBX to SIP.tg

Push 🆕 PBX→SIP.tg 📞 to create a new SIP account of this type. The bot will send you login, password and address of the server which you have to set in the trunk settings of your PBX. The trunk must has turned on an option of registration on the server — usually it corresponds to a trunk type which supports incoming and outgoing calls.

We fight brute force and attack

Please be careful while edit settings.

IP address which is used to connect to sip.tg platform can be banned for a random period of the time if you try to connect with wrong settings: without registration option, with wrong login or password, from untrusted IP, etc.

Display the current authorization data of the account

Generate new password for the account

Change the composition and priority of used audio codecs

Audio Codecs

Change the composition and priority of used DTMF methods

DTMF Methods

The list of IPs the connection will be allowed from only; if empty, this feature is disabled

Rules of the phone number conversion before sending it to the PBX

Number conversion

Display name of the account

Deactivate the account and delete the associated data

Push the button below
to see the description

Audio Codecs

DTMF Methods

About number conversion

Connecting SIP.tg to the virtual PBX

In this type of SIP account one of the servers of sip.tg platform connects to your PBX as a client. Your PBX in this case plays the role as a server.

Push 🆕 SIP.tg→PBX to create a new SIP account of this type. You will enter to the menu where can change the following settings:

Login of the account

Password of the account

Registration server of the account

The value of the domain in the From field in outgoing requests to the virtual PBX server

The number of the PBX which will be called on incoming calls to Telegram

Rules of the phone number conversion before sending it to the PBX

Number conversion

Change the composition and priority of used audio codecs

Audio Codecs

Change the composition and priority of used DTMF methods

DTMF Methods

Display name of the account

Deactivate the account and delete the associated data

Push the button below
to see the description

Push Apply button to apply settings immediately. Otherwise settings will be applied after 5 minutes. If any error will occur during connection, the bot will show their code and description.

Audio Codecs

DTMF Methods

Error codes

About number conversion

The state of gateway accounts

Your gateway accounts are stored in section /gateway. Each account can has one of two states:

The account is disabled.

For an outgoing gateway it means wrong login or password, connection settings are not filled in or if you have disabled the account manually.

For an incomind gateway it means your PBX is not registered on the sip.tg platform.

The gateway account is active and in use.

How to call and to receive calls

Incoming and outgoing calls are not dependent of the gateway type and go the same way. On an incoming call PBX gets the number and the name of a caller Telegram user, but for an outgoing call it's enough to call the number of a Telegram user. The number in this cases is one of three values:

  • a real phone number which the Telegram account is registered to (started from the country code);
  • username of the Telegram account;
  • ID of the Telegram account (started from * as a mark of ID).

For an incoming call if only a part of the data about the caller is known, first of the values is used as a Caller ID: phone number, username or ID. If the phone number is not known, the username is used. If the phone number not known and the username is not set, the ID is used.

It's possible to call by ID only if direct or indirect interaction was been before: messaging, calls, etc.

Redial

After the call DTMF keypad is removed and the bot sends the button Redial. The message with this button can also contain the code of the finishing state the call.

To disable this feature just to disable DTMF keypad.

Error codes

Specifics of the gateway

Call delay

Only for calls from PBX to Telegram

You can get a delay when calling to offline user. This is due to a feature of Telegram.

It's simple for mobile operators to check does the callee online or not. Telegram works more difficult. The user is online only if all conditions are true: the Telegram application is run, is on the foreground and the phone is unlocked. Otherwise the user is offline.

The Push technology helps to call the user online. He gets the notification about incoming call to Telegram and goes online automatically even if doesn't open the application. This approach helps to save the battery.

The time between the call and getting the Push notification is not regulated. If the phone is offline, the user can not get the notification at all. Therefore determining the time of waiting the user goes online depends on tasks of the gateway and has to be set up on the side of your PBX.

The current value of timeout is 15 seconds.

Telegram restrictions: the flood protection

On a high load to Telegram servers the flood protection can occurs. For this purpose an artificial restriction for all or some RPC calls to Telegram API is imposed. If the delay of a restriction is less than 5 seconds, this call to API is repeated automatically. Otherwise the RPC terminates with a error, which is transferred to SIP as a error code 503 Service Unavailable. According to RFC 3261, the header Retry-After with a number seconds after which the RPC can be recalled, will be included as well.