You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Alexander Zhirov 7b17ebdcba gitignore 12 months ago
.github/workflows migrate to github actions 4 years ago
buildenv TDLib update to 1.7.10 (#52) 2 years ago
include update 12 months ago
libtgvoip update 12 months ago
tg2sip update 12 months ago
.gitignore gitignore 12 months ago
CMakeLists.txt update 12 months ago
COPYING public release 5 years ago migrate to github actions 4 years ago
settings.ini settings update 5 years ago

Build status


TG2SIP is a Telegram<->SIP voice gateway. It can be used to forward incoming telegram calls to your SIP PBX or make SIP->Telegram calls.


Your SIP PBX should be comaptible with L16@48000 or OPUS@48000 voice codec.


  1. Obtain binaries in one of convenient ways for you.

    • Build them from source.
      Requires C++17 supported comiler, which may be a trouble for old linux distros.
    • Download prebuild native binaries for one of supported distros.
      Prebuild binaries requires OPUS libraries (libopus0 for Ubuntu, opus for CentOS, etc).
    • Download universal AppImage package.
      More information of what is AppImage can be found here
  2. Obtain api_id and api_hash tokens from this page and put them in settings.ini file.

  3. Login into telegram with gen_db app

  4. Set SIP server settings in settings.ini

  5. Run tg2sip

SIP->Telegram calls can be done using 3 extension types:

  1. tg#[\s\d]+ for calls by username
  2. \+[\d]+ for calls by phone number
  3. [\d]+ for calls by telegram ID. Only known IDs allowed by telegram API.

All Telegram->SIP calls will be redirected to callback_uri SIP-URI that can be set in from settings.ini file.
Extra information about caller Telegram account will be added into X-TG-* SIP tags.