Code Monkey home page Code Monkey logo

tg2sip's People

Contributors

infactum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tg2sip's Issues

Is there any way to add IDs for calls by telegram ID ?

for calls by telegram ID. Only known IDs allowed by telegram API.
What does it mean ?
Does this mean that the user should be in the address book?
I need to make calls by telegram ID
Is there any way to add IDs for calls by telegram ID ?

Video tutorial

Hi there! Can you please make video tutorial step-by-step configuring?

Compilation error: gcc-10.x

Hi, I have a problem compiling tg2sip with gcc10x. Older gcc9x seems to work fine.

The gcc10x errors are as follows:

[ 99%] Building CXX object CMakeFiles/tg2sip.dir/tg2sip/utils.cpp.o                                                                                                                                                                                  
In file included from /build/tg2sip-1.2.0/tg2sip/gateway.h:24,                                                                                                                                                                                       
                 from /build/tg2sip-1.2.0/tg2sip/gateway.cpp:19:                                                                                                                                                                                     
/build/tg2sip-1.2.0/include/boost/sml.hpp:2528:8: warning: undefining "__has_builtin"                                                                                                                                                                
 2528 | #undef __has_builtin                                                                                                                                                                                                                         
      |        ^~~~~~~~~~~~~                                                                                                                                                                                                                         
In file included from /build/tg2sip-1.2.0/tg2sip/gateway.h:24,                                                                                                                                                                                       
                 from /build/tg2sip-1.2.0/tg2sip/main.cpp:27:                                                                                                                                                                                        
/build/tg2sip-1.2.0/include/boost/sml.hpp:2528:8: warning: undefining "__has_builtin"                                                                                                                                                                
 2528 | #undef __has_builtin                                                                                                                                                                                                                         
      |        ^~~~~~~~~~~~~                                                                                                                                                                                                                         
/build/tg2sip-1.2.0/tg2sip/utils.cpp: In function 'bool is_digits(const string&)':                                                                                                                                                                   
/build/tg2sip-1.2.0/tg2sip/utils.cpp:21:61: error: invalid use of incomplete type 'const string' {aka 'const class std::__cxx11::basic_string<char>'}                                                                                                
   21 | bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); };                                                                                                                                           
      |                                                             ^~~                                                                                                                                                                              
In file included from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/iosfwd:39,                                                                                                                                           
                 from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/memory:74,                                                                                                                                           
                 from /build/tg2sip-1.2.0/tg2sip/utils.h:21,                                                                                                                                                                                         
                 from /build/tg2sip-1.2.0/tg2sip/utils.cpp:19:                                                                                                                                                                                       
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/stringfwd.h:74:11: note: declaration of 'std::string' {aka 'class std::__cxx11::basic_string<char>'}                                                                  
   74 |     class basic_string;                                                                                                                                                                                                                      
      |           ^~~~~~~~~~~~                                                                                                                                                                                                                       
/build/tg2sip-1.2.0/tg2sip/utils.cpp:21:74: error: invalid use of incomplete type 'const string' {aka 'const class std::__cxx11::basic_string<char>'}                                                                                                
   21 | bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); };                                                                                                                                           
      |                                                                          ^~~                                                                                                                                                                 
In file included from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/iosfwd:39,                                                                                                                                           
                 from /nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/memory:74,                                                                                                                                           
                 from /build/tg2sip-1.2.0/tg2sip/utils.h:21,                                                                                                                                                                                         
                 from /build/tg2sip-1.2.0/tg2sip/utils.cpp:19:                                                                                                                                                                                       
/nix/store/cfkfpca5ymx2rf66k6f16sa3lb6ndgc2-gcc-10.3.0/include/c++/10.3.0/bits/stringfwd.h:74:11: note: declaration of 'std::string' {aka 'class std::__cxx11::basic_string<char>'}                                                                  
   74 |     class basic_string;                                                                                                                                                                                                                      
      |           ^~~~~~~~~~~~                                                                                                                                                                                                                       
/build/tg2sip-1.2.0/tg2sip/utils.cpp:21:87: error: '::isdigit' has not been declared; did you mean 'is_digits'?                                                                                                                                      
   21 | bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); };                                                                                                                                           
      |                                                                                       ^~~~~~~                                                                                                                                                
      |                                                                                       is_digits 

td 1.7.10

pls add in description what for td 1.7.10 need "git reset --hard a53cb30e99f937cfd64e0266fa558785a184a553" because in tags of "td" not present 1.7.10
it save time for many peoples.

Compiling Instructions

Hello dear,

Is there anyone who has some instructions to compile tg2sip. I am not a programer, but I can handle installing packages from source in my linux PC.

Thank you very much!

tg2sip on FreeBSD

Can tg2cip, without major modifications, be compiled on the FreeBSD platform?

voicemail as voice message

I want to send voice message if recipient hasn't answered. Maybe with speech recognition.
Any plans to implement this?

Error while answering

After setting up opus and callback to a softphone (connected to an asterisk). I was able to get the softphone to call. However when answering the call falls and gives this error:

[19:55:30.454][t:23209][p:23201][pjsip][debug] RX 883 bytes Response msg 200/INVITE/cseq=14581 (rdata0x7f655c002848) from UDP 192.168.0.200:5070:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.21:5060;branch=z9hG4bKPjZLjBibP3Bj3BaiuH2cwTFjRSigclfn89;received=192.168.0.21;rport=5060
From: sip:[email protected];tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs
To: sip:[email protected];tag=as530bb5ad
Call-ID: wgYgBgtxzcFlqG3UFkUohl1DMOeOy9qA
CSeq: 14581 INVITE
Server: IPBX-2.11.0(11.25.3)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:[email protected]:5070
Content-Type: application/sdp
Content-Length: 333

v=0
o=root 1356515537 1356515537 IN IP4 192.168.0.200
s=Asterisk PBX 11.25.3
c=IN IP4 192.168.0.200
t=0 0
m=audio 10732 RTP/AVP 120 96
a=rtpmap:120 opus/48000/2
a=maxptime:60
a=fmtp:120 maxplaybackrate=16000; stereo=0; sprop-stereo=0; useinbandfec=0
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
a=ptime:20
a=sendrecv

--end msg--
[19:55:30.454][t:23209][p:23201][pjsip][debug] Call 0: updating media..
[19:55:30.454][t:23209][p:23201][pjsip][debug] Media stream call00:0 is destroyed
[19:55:30.454][t:23209][p:23201][pjsip][debug] Audio channel update..
[19:55:30.457][t:23209][p:23201][pjsip][debug] Encoder stream started
[19:55:30.457][t:23209][p:23201][pjsip][debug] Decoder stream started
[19:55:30.457][t:23209][p:23201][pjsip][debug] Audio updated, stream #0: opus (sendrecv)
[19:55:30.457][t:23209][p:23201][pjsip][debug] TX 341 bytes Request msg ACK/cseq=14581 (tdta0x7f655c0285b8) to UDP 192.168.0.200:5070:
ACK sip:[email protected]:5070 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.21:5060;rport;branch=z9hG4bKPj1drWwM.U3TQ-6Jfe-za93kd8wc96ruXQ
Max-Forwards: 70
From: sip:[email protected];tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs
To: sip:[email protected];tag=as530bb5ad
Call-ID: wgYgBgtxzcFlqG3UFkUohl1DMOeOy9qA
CSeq: 14581 ACK
Content-Length: 0

--end msg--
[19:55:30.856][t:23201][p:23201][core][debug] [23201-1] creating voip for TG #1
[19:55:30.868][t:23201][p:23201][tgvoip][info] update data saving mode, config 0, enabled 0, reqd by peer 0
[19:55:30.868][t:23201][p:23201][tgvoip][warning] Set remote endpoints, allowP2P=0, connectionMaxLayer=92
[19:55:30.868][t:23201][p:23201][tgvoip][warning] Starting voip controller
[19:55:30.868][t:23201][p:23201][tgvoip][debug] Bound to local UDP port 25380
[19:55:30.869][t:23201][p:23201][core][debug] [23201-1] bridging tgvoip audio with SIP#0
[19:55:30.869][t:23201][p:23201][pjsip][debug] Switch connect: 1 --> 2
[19:55:30.869][t:23201][p:23201][pjsip][debug] Set sound device: capture=-99, playback=-99
[19:55:30.869][t:23201][p:23201][pjsip][debug] Setting null sound device..
[19:55:30.869][t:23201][p:23201][pjsip][debug] Opening null sound device..
[19:55:30.870][t:23201][p:23201][pjsip][error] pjsua_conf_connect(id, sink.id) error: Media ports are not compatible (PJMEDIA_ENOTCOMPATIBLE) (status=220160) [../src/pjsua2/media.cpp:203]
[19:55:30.870][t:23221][p:23201][tgvoip][info] before create audio io
[19:55:30.870][t:23221][p:23201][tgvoip][info] AEC: 0 NS: 0 AGC: 0
[19:55:30.872][t:23219][p:23201][tgvoip][info] Receive thread starting
[19:55:30.874][t:23220][p:23201][tgvoip][warning] Send udp pings
[19:55:30.948][t:23201][p:23201][tgvoip][debug] Entered VoIPController::Stop
[19:55:30.948][t:23201][p:23201][tgvoip][debug] before shutdown socket
[19:55:30.948][t:23201][p:23201][tgvoip][debug] before join sendThread
[19:55:30.949][t:23219][p:23201][tgvoip][info] === recv thread exiting ===
[19:55:30.956][t:23221][p:23201][tgvoip][info] Audio initialization took 0.085953 seconds
[19:55:30.957][t:23221][p:23201][tgvoip][info] === send thread exiting ===
[19:55:30.957][t:23201][p:23201][tgvoip][debug] before join recvThread
[19:55:30.957][t:23201][p:23201][tgvoip][debug] before stop messageThread
[19:55:30.957][t:23201][p:23201][tgvoip][debug] Before stop audio I/O
[19:55:30.957][t:23201][p:23201][tgvoip][debug] Left VoIPController::Stop [need rate = 0]
[19:55:30.957][t:23201][p:23201][core][debug] [23201-1] hangup TG #1
[19:55:30.959][t:23201][p:23201][pjsip][debug] Call 0 hanging up: code=500..
[19:55:30.959][t:23201][p:23201][pjsip][debug] TX 341 bytes Request msg BYE/cseq=14582 (tdta0x25c8718) to UDP 192.168.0.200:5070:
BYE sip:[email protected]:5070 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.21:5060;rport;branch=z9hG4bKPjXKPQ092VLQZRSVN2BKusJyecHBPwm-NF
Max-Forwards: 70
From: sip:[email protected];tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs
To: sip:[email protected];tag=as530bb5ad
Call-ID: wgYgBgtxzcFlqG3UFkUohl1DMOeOy9qA
CSeq: 14582 BYE
Content-Length: 0

--end msg--
[19:55:30.960][t:23201][p:23201][pjsip][debug] Call 0 hanging up: code=0..
[19:55:30.960][t:23201][p:23201][pjsip][debug] TX 341 bytes Request msg BYE/cseq=14583 (tdta0x25cc068) to UDP 192.168.0.200:5070:
BYE sip:[email protected]:5070 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.21:5060;rport;branch=z9hG4bKPjwifKzVYJJ8dLUYtRg1nLqnES-gM6HdIe
Max-Forwards: 70
From: sip:[email protected];tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs
To: sip:[email protected];tag=as530bb5ad
Call-ID: wgYgBgtxzcFlqG3UFkUohl1DMOeOy9qA
CSeq: 14583 BYE
Content-Length: 0

--end msg--
[19:55:30.961][t:23201][p:23201][tgvoip][debug] Entered VoIPController::~VoIPController
[19:55:30.961][t:23201][p:23201][tgvoip][debug] before close socket
[19:55:30.961][t:23201][p:23201][tgvoip][debug] before delete audioIO
[19:55:30.961][t:23201][p:23201][tgvoip][debug] before delete encoder
[19:55:30.961][t:23201][p:23201][tgvoip][debug] before delete echo canceller
[19:55:30.962][t:23201][p:23201][tgvoip][debug] Left VoIPController::~VoIPController
[19:55:30.969][t:23209][p:23201][pjsip][debug] RX 474 bytes Response msg 200/BYE/cseq=14582 (rdata0x7f655c002848) from UDP 192.168.0.200:5070:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.21:5060;branch=z9hG4bKPjXKPQ092VLQZRSVN2BKusJyecHBPwm-NF;received=192.168.0.21;rport=5060
From: sip:[email protected];tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs
To: sip:[email protected];tag=as530bb5ad
Call-ID: wgYgBgtxzcFlqG3UFkUohl1DMOeOy9qA
CSeq: 14582 BYE
Server: IPBX-2.11.0(11.25.3)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

--end msg--
[19:55:30.970][t:23209][p:23201][pjsip][debug] Call 0: deinitializing media..
[19:55:30.971][t:23209][p:23201][pjsip][debug] Media stream call00:0 is destroyed
[19:55:30.971][t:23209][p:23201][pjsip][debug] RX 474 bytes Response msg 200/BYE/cseq=14583 (rdata0x7f655c002848) from UDP 192.168.0.200:5070:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.21:5060;branch=z9hG4bKPjwifKzVYJJ8dLUYtRg1nLqnES-gM6HdIe;received=192.168.0.21;rport=5060
From: sip:[email protected];tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs
To: sip:[email protected];tag=as530bb5ad
Call-ID: wgYgBgtxzcFlqG3UFkUohl1DMOeOy9qA
CSeq: 14583 BYE
Server: IPBX-2.11.0(11.25.3)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

--end msg--
[19:55:32.062][t:23209][p:23201][pjsip][debug] Closing sound device after idle for 1 second(s)
[19:55:32.062][t:23209][p:23201][pjsip][debug] Closing null sound device..

error: ‘class pj::Endpoint’ has no member named ‘codecEnum’; did you mean ‘codecEnum2’?

trying to build on Ubuntu 18.04 LTS with recommended versions and got

/root/tg2sip/tg2sip/sip.cpp: In static member function ‘static void sip::Client::init_pj_endpoint(Settings&, sip::LogWriter*)’: /root/tg2sip/tg2sip/sip.cpp:188:38: error: ‘class pj::Endpoint’ has no member named ‘codecEnum’; did you mean ‘codecEnum2’? CodecInfoVector codecVector = ep.codecEnum(); ^~~~~~~~~ codecEnum2
Screenshot from 2020-04-20 15-43-39

[Question] White list for incoming Telegram calls?

I use tg2sip with Asterisk to forward mobile calls. The Telegram account which I set for tg2sip is also operated by a common Android Telegram client. I want to introduce a white list of peer telegram accounts and make Asterisk handle only calls coming from the listed accounts, but ignore calls from other accounts to let me answer from Android.
Is it possible? How would you approach this task?

spdlog version incompatible

I am trying to compile from source on FreeBSD.
Stuck on spdlog dependancy:

Could not find a configuration file for package spdlog that is compatible
  with requested version 0.17.

  The following configuration files were considered but not accepted:

    /usr/local/lib/cmake/spdlog/spdlogConfig.cmake, version: 1.5.0

full output: https://pastebin.com/Rf9fgPSh

Is there a way to go around this?

How to get CallerId from Telegram

Hello,

This is a wonderful solution. Is it able to forward caller info to Asterisk? I want to be able to pass User Firstname and Surname to the PBX.

Thank you

failed to start TG client

Hello!

Tryed to start app, received api_id & api_hash, writed them to settings file, and got this message:

ps. gen_db freezes after enter phone number.

[13:06:35.934][t:3343][p:3334][core][trace] /home/user/tg2sip/tg2sip/tg.cpp:97 TG client got response with ID 1
error {
code = 400
message = "Can't lock file"
}

[13:06:35.934][t:3343][p:3334][core][error] TG client authorization error
error {
code = 400
message = "Can't lock file"
}

tdlib API level 133 required since 2022.01.01

Уважаемый разработчик,

Популярность Telegram продолжает расти по всему миру, в том числе и благодаря Вашему неофициальному приложению. Если приложение основано на Вашем собственном коде, Вам необходимо внести два изменения, чтобы пользователи могли продолжать им пользоваться. Эти изменения уже поддержаны в открытом коде официальных приложений Telegram, так что если Ваше приложение опирается на актуальную версию одного из них, то дополнительных действий не потребуется.

Поддержка int64 для ID
В связи с быстрым ростом Telegram переходит с 32-битных на 64-битные ID, чтобы пользователи могли и дальше создавать миллиарды новых учетных записей, групп, каналов и ботов. Необходимо как можно скорее поддержать новые ID в Вашем приложении, чтобы оно продолжило работать корректно.

Для этого, пожалуйста, убедитесь, что приложение поддерживает 133 слой API, опубликованный в сентябре: https://core.telegram.org/api/layers#layer-133

Рекламные сообщения
Чтобы покрывать расходы, которые увеличиваются вместе с числом пользователей, Telegram разработал рекламные сообщения (https://promote.telegram.org/) – платный инструмент для продвижения каналов и ботов с учетом заботы о конфиденциальности пользователей. Большинство сторонних разработчиков уже внедрили поддержку рекламных сообщений Telegram в свои приложения.

До 1 января 2022 мы просим Вас убедиться, что Ваше приложение поддерживает и корректно отображает рекламные сообщения. К сожалению, Telegram не сможет взять на себя расходы по поддержке приложений, в которых не отображаются рекламные сообщения, и будет вынужден отключить таким приложениям доступ к API.

Необходимая техническая документация:
https://core.telegram.org/api/sponsored-messages

Использование Telegram API останется бесплатным для всех разработчиков. Мы будем признательны за понимание и надеемся, что Telegram и Ваше приложение смогут и дальше предоставлять людям надежный и безопасный способ связи.

Подробнее о рекламных сообщениях: https://t.me/durov_russia/35

Команда Telegram

Could not find a configuration file for package "Td" that is compatible with requested version "1.7.10".

Trying to install tg2sip and getting error:

/usr/src/tg2sip/build# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig && cmake -DCMAKE_BUILD_TYPE=Release -DTd_DIR=/usr/src/td/tdlib/lib/cmake/Td/ -DCMAKE_INSTALL_PREFIX:PATH=.. ..
CMake Error at CMakeLists.txt:10 (find_package):
  Could not find a configuration file for package "Td" that is compatible
  with requested version "1.7.10".

  The following configuration files were considered but not accepted:

    /usr/src/td/tdlib/lib/cmake/Td/TdConfig.cmake, version: 1.8.1
    /usr/src/td/TdConfig.cmake, version: unknown

Any instruction compile For raspberry Pi

Hi , i did cross compile on my laptop for raspberry pi,
because of raspberry pi has with Pjsip old library binaries (software management apt),
i compiled pjlib source , every thing compiled fine after long struggle,
but i got error in linking tgsip with openssl lib , i have openssl libdev those supplied with Pi distribution but linker saying those function which are related to ssl are not found

Any help in cross compiling tgsip in my pc for rpi ?

Prebuild native binaries crashed links

Install td 1.6.0

Will there be support for TD 1.6.0? Or will 1.2.0 be so?
Поддержка td 1.6.0 предвидится? Не ставится на 1.6.0(

Telegram app coud not connect to tg2ip, when ipv6 off on server with tg2sip

debian 10
ipv6 disable in grub(so there is no address family ipv6 at all)(ipv6.disable=1)

root@sd-sip1:/opt/tg2sip# ./tg2sip
[20:37:44.335][t:6342][p:6342][pjsip][info] pjsua version 2.9 for Linux-4.19.0.12/x86_64/glibc-2.27 initialized
[20:37:44.347][t:6351][p:6342][core][info] TG client authorization ready
[20:37:44.347][t:6342][p:6342][core][info] Loading contacts cache
[20:37:44.349][t:6342][p:6342][core][info] Loaded 0 usernames and 1 phones into contacts cache
[20:37:44.484][t:6351][p:6342][core][info] TG client connected
[20:37:51.741][t:6345][p:6342][core][debug] incoming SIP call #0 from "274 sip:274@IP to sip:+79154199999@IP with call-id 3fc49a363c0b3f903a0cbe1b793a9f5e@IP
[20:37:51.748][t:6342][p:6342][core][debug] [6342-1] associated with SIP#0
[20:37:51.748][t:6342][p:6342][core][debug] [6342-1] setting SIP #0 in ringing mode
[20:37:51.768][t:6342][p:6342][core][debug] [6342-1] dialing tg
[20:37:51.769][t:6342][p:6342][core][debug] [6342-1] found id 114185469 for 79154199999 in phone cache
[20:37:51.769][t:6342][p:6342][core][debug] [6342-1] associated with TG#1
[20:37:57.142][t:6342][p:6342][core][debug] [6342-1] stored user id 114199999
[20:37:57.142][t:6342][p:6342][core][debug] [6342-1] creating voip for TG #1
[20:37:57.142][t:6342][p:6342][tgvoip][info] update data saving mode, config 0, enabled 0, reqd by peer 0
[20:37:57.142][t:6342][p:6342][tgvoip][warning] Set remote endpoints, allowP2P=0, connectionMaxLayer=92
[20:37:57.142][t:6342][p:6342][tgvoip][trace] Adding endpoint: 134.209.178.88:558, UDP
[20:37:57.142][t:6342][p:6342][tgvoip][trace] Adding endpoint: 134.209.176.124:554, UDP
[20:37:57.142][t:6342][p:6342][tgvoip][trace] Adding endpoint: 91.108.8.5:521, UDP
[20:37:57.142][t:6342][p:6342][tgvoip][trace] Adding endpoint: 134.209.178.131:559, UDP
[20:37:57.142][t:6342][p:6342][tgvoip][trace] Adding endpoint: 91.108.8.2:522, UDP
[20:37:57.142][t:6342][p:6342][tgvoip][warning] Starting voip controller
[20:37:57.145][t:6342][p:6342][tgvoip][error] error creating socket: 97 / Address family not supported by protocol
[20:37:57.145][t:6342][p:6342][tgvoip][trace] Call state changed to 4
[20:37:57.145][t:6342][p:6342][core][debug] [6342-1] answering SIP #0
[20:37:57.146][t:6342][p:6342][core][debug] [6342-1] bridging tgvoip audio with SIP#0
[20:37:57.147][t:6355][p:6342][tgvoip][info] before create audio io
[20:37:57.147][t:6355][p:6342][tgvoip][info] AEC: 0 NS: 0 AGC: 0
[20:37:57.148][t:6355][p:6342][tgvoip][info] Audio initialization took 0.001033 seconds
[20:37:57.148][t:6355][p:6342][tgvoip][warning] Not ready to send - enqueueing
[20:37:57.148][t:6355][p:6342][tgvoip][warning] Not ready to send - enqueueing
[20:37:57.148][t:6355][p:6342][tgvoip][warning] Not ready to send - enqueueing
[20:37:57.148][t:6355][p:6342][tgvoip][warning] Not ready to send - enqueueing
[20:37:57.148][t:6355][p:6342][tgvoip][warning] Not ready to send - enqueueing
[20:37:57.148][t:6355][p:6342][tgvoip][info] === send thread exiting ===
[20:38:13.272][t:6342][p:6342][tgvoip][debug] Entered VoIPController::Stop
[20:38:13.272][t:6342][p:6342][tgvoip][debug] before shutdown socket
[20:38:13.272][t:6342][p:6342][tgvoip][debug] before join sendThread
[20:38:13.272][t:6342][p:6342][tgvoip][debug] before join recvThread
[20:38:13.272][t:6342][p:6342][tgvoip][debug] before stop messageThread
[20:38:13.272][t:6342][p:6342][tgvoip][debug] Before stop audio I/O
[20:38:13.272][t:6342][p:6342][tgvoip][debug] Left VoIPController::Stop [need rate = 0]
[20:38:13.272][t:6342][p:6342][core][debug] [6342-1] hangup TG #1
[20:38:13.273][t:6342][p:6342][tgvoip][debug] Entered VoIPController::~VoIPController
[20:38:13.273][t:6342][p:6342][tgvoip][debug] before close socket
[20:38:13.273][t:6342][p:6342][tgvoip][debug] before delete audioIO
[20:38:13.273][t:6342][p:6342][tgvoip][debug] before delete encoder
[20:38:13.273][t:6342][p:6342][tgvoip][debug] before delete echo canceller
[20:38:13.273][t:6342][p:6342][tgvoip][debug] Left VoIPController::~VoIPController
^C[20:38:51.950][t:6342][p:6342][core][info] performing a graceful shutdown...

key:
[20:37:57.145][t:6342][p:6342][tgvoip][error] error creating socket: 97 / Address family not supported by protocol

when I enable ipv6 everything OK.

Telegram for android 8.6.1 get stuck

Telegram app on android get stuck every time on answer with message exchanging encryption keys and crash after hangup, tested on 3 different devices, latest IOS application is working fine. This problem starts only after update to latest version 8.6.1.

error creating socket: 97 / Address family not supported by protocol

Hi @Infactum help me please

I've download ubuntu package, made settings up, and start call from tg to sip, and it stuck on "error creating socket: 97 / Address family not supported by protocol"

In my Ubuntu 18.04 LTS all IPV6 is disabled, because ISP didn't get me it.

[18:23:12.155][t:22455][p:22455][core][debug] [22455-8] creating voip for TG #4
[18:23:12.155][t:22455][p:22455][tgvoip][info] update data saving mode, config 0, enabled 0, reqd by peer 0
[18:23:12.155][t:22455][p:22455][tgvoip][warning] Set remote endpoints, allowP2P=0, connectionMaxLayer=92
[18:23:12.155][t:22455][p:22455][tgvoip][trace] Adding endpoint: 91.108.12.5:538, UDP
[18:23:12.155][t:22455][p:22455][tgvoip][trace] Adding endpoint: 91.108.16.1:530, UDP
[18:23:12.155][t:22455][p:22455][tgvoip][trace] Adding endpoint: 91.108.8.3:522, UDP
[18:23:12.155][t:22455][p:22455][tgvoip][trace] Adding endpoint: 91.108.16.3:527, UDP
[18:23:12.155][t:22455][p:22455][tgvoip][trace] Adding endpoint: 91.108.12.3:524, UDP
[18:23:12.155][t:22455][p:22455][tgvoip][trace] Adding endpoint: 91.108.8.7:522, UDP
[18:23:12.155][t:22455][p:22455][tgvoip][warning] Starting voip controller
[18:23:12.157][t:22455][p:22455][tgvoip][error] error creating socket: 97 / Address family not supported by protocol

Thanks in advance!
socket

upd
I do enable ipv6 in ubuntu back, just enable without any configuring NIC, and it start working.
I guess it tries to resolve IPv6 localhost and it fails.

Problem with utils.cpp.o

I trying compile the project and getting errors:

[ 98%] Building CXX object CMakeFiles/tg2sip.dir/tg2sip/utils.cpp.o /usr/src/tg2sip/tg2sip/utils.cpp:21:64: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >' bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); }; ^ /usr/lib/llvm-10/bin/../include/c++/v1/iosfwd:209:32: note: template is declared here class _LIBCPP_TEMPLATE_VIS basic_string; ^ /usr/src/tg2sip/tg2sip/utils.cpp:21:77: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >' bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); }; ^ /usr/lib/llvm-10/bin/../include/c++/v1/iosfwd:209:32: note: template is declared here class _LIBCPP_TEMPLATE_VIS basic_string; ^ /usr/src/tg2sip/tg2sip/utils.cpp:21:87: error: no member named 'isdigit' in the global namespace; did you mean 'is_digits'? bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); }; ~~^~~~~~~ is_digits /usr/src/tg2sip/tg2sip/utils.cpp:21:6: note: 'is_digits' declared here bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); }; ^ 3 errors generated. make[2]: *** [CMakeFiles/tg2sip.dir/build.make:128: CMakeFiles/tg2sip.dir/tg2sip/utils.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:125: CMakeFiles/tg2sip.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

Compiling on AARCH64

Big thanks to Infactum for this wonderful bridge

This is for those wishing to use tg2sip on AARCH64 platforms like AWS or Oracle Cloud (where you can get a 4 core 24 GB RAM ARM instance in the always free tier). May also be applicable to other ARM platforms.

  1. pjproject will not compile with webrtc and will throw an error that emmintrin.h is not available. This is due to sse2 not being available on ARM. You can use sse2neon.h from https://github.com/DLTcollab/sse2neon and replace #include <emmintrin.h> accordingly in aec_core_sse2.c and aec_rdft_sse2.c
  2. During final build there will be an error that target machine, endianess etc is not defined. This is due to lack of 'aarch64' recognition. You could modify final else construct like so in config.h for pj
#else
#   define PJ_HAS_PENTIUM	0
#   define PJ_IS_LITTLE_ENDIAN	1
#   define PJ_IS_BIG_ENDIAN	0
#   define PJ_M_ARM7		1
#   define PJ_M_NAME		"armv7"
#endif

Build will succeed after these changes.
Have attached working binaries compiled on Ubuntu 20.04 AARCH64

tg2sipAARCH64Ubuntu20.zip

Docker не собирается

Вылетает при сборке с ошибкой

[ 40%] Building CXX object CMakeFiles/tdcore.dir/td/telegram/ContactsManager.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
CMakeFiles/tdcore.dir/build.make:590: recipe for target 'CMakeFiles/tdcore.dir/td/telegram/ContactsManager.cpp.o' failed
make[2]: *** [CMakeFiles/tdcore.dir/td/telegram/ContactsManager.cpp.o] Error 4
CMakeFiles/Makefile2:155: recipe for target 'CMakeFiles/tdcore.dir/all' failed
make[1]: *** [CMakeFiles/tdcore.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Качество звука.

Помогите, пожалуйста, долго пытался собрать программу для Manjaro aarch64 в итоге получилось, но проблемы со звуком. Не могу понять почему. Собирал с pjproject 2.8 (git Infactum) и 2.9, разницы нет. Суть проблемы: при исходяещем из sip в telegram, звук приходит только из sip в telegram. При входящем в sip из telegram, несколько сценариев. Первый сценарий - если звонок на прямую на внутренний номер, то звука нет вообще и через какое-то время звонок сбрасывается. При этом moh музыку в telegram клиенте, до поднятия трубки, слышно. Второй сценарий, через IVR меню. Asterisk берет трубку включает IVR, потом звонит на внутренний номер. IVR в telegram слышно, при этом качество нормальное, при подъеме трубки, звук из sip в telegram, есть и хороший, а вот из telegram в sip есть, но очень искаженный и прерывистый так что едва можно понять речь. Помогите понять причину.
При сборке было несколько замечаний, возможно это они являются причиной.

[6%] Building CXX object libtgvoip/CMakeFiles/libtgvoip.dir/audio/AudioIO.cpp.o
tg2sip/libtgvoip/audio/AudioIO.cpp: В статической функции-члене «static tgvoip::audio::AudioIO* tgvoip::audio::AudioIO::Create(std::string, std::string)»:
tg2sip/libtgvoip/audio/AudioIO.cpp:88:1: предупреждение: в функции, которая должна возвращать значение, отсутствует оператор return [-Wreturn-type]
88 | }
| ^
[ 97%] Building CXX object CMakeFiles/tg2sip.dir/tg2sip/main.cpp.o
In file included from tg2sip/tg2sip/gateway.h:24,
from tg2sip/tg2sip/main.cpp:27:
tg2sip/include/boost/sml.hpp:2528:8: предупреждение: неопределённая «__has_builtin»
2528 | #undef __has_builtin
| ^~~~~~~~~~~~~
[ 99%] Building CXX object CMakeFiles/tg2sip.dir/tg2sip/gateway.cpp.o
In file included from tg2sip/tg2sip/gateway.h:24,
from tg2sip/tg2sip/gateway.cpp:19:
tg2sip/include/boost/sml.hpp:2528:8: предупреждение: неопределённая «__has_builtin»
2528 | #undef __has_builtin
| ^~~~~~~~~~~~~

Заранее, спасибо за помощь.

sync with original libtgvoip

А можете за синхронизировать актуальные изменения с оригинальной libtgvoip ?
Есть подозрения что из за этого как минимум звук sip -> tg хромает
telegramdesktop/libtgvoip@a6e6ed5

Ну и по видео у них там много изменений

Compilation error. pjproject 2.10

Compilation error. pjproject 2.10

[ 97%] Building CXX object CMakeFiles/tg2sip.dir/tg2sip/main.cpp.o [ 98%] Building CXX object CMakeFiles/tg2sip.dir/tg2sip/tg.cpp.o [ 98%] Building CXX object CMakeFiles/tg2sip.dir/tg2sip/sip.cpp.o /usr/src/tg2sip/tg2sip/sip.cpp: In static member function ‘static void sip::Client::init_pj_endpoint(Settings&, sip::LogWriter*)’: /usr/src/tg2sip/tg2sip/sip.cpp:188:38: error: ‘class pj::Endpoint’ has no member named ‘codecEnum’; did you mean ‘codecEnum2’? CodecInfoVector codecVector = ep.codecEnum(); ^~~~~~~~~ codecEnum2 gmake[2]: *** [CMakeFiles/tg2sip.dir/tg2sip/sip.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/tg2sip.dir/all] Error 2 gmake: *** [all] Error 2

code = 429 message = "Too Many Requests: retry after 291"

Hello.
We keep getting error 429.
extra_wait_time = 300 what else can you do?

[12:53:34.227][t:19543][p:19534][core][info] TG client authorization ready
[12:53:34.227][t:19534][p:19534][core][info] Loading contacts cache
[12:53:34.244][t:19534][p:19534][core][info] Loaded 18 usernames and 44 phones into contacts cache
[12:53:34.330][t:19543][p:19534][core][info] TG client connected
[12:59:50.004][t:19537][p:19534][core][debug] incoming SIP call #0 from "telegram" sip:[email protected] to sip:[email protected] with call-id [email protected]
[12:59:50.005][t:19534][p:19534][core][debug] [19534-1] associated with SIP#0
[12:59:50.005][t:19534][p:19534][core][debug] [19534-1] setting SIP #0 in ringing mode
[12:59:50.025][t:19534][p:19534][core][debug] [19534-1] dialing tg
[12:59:59.242][t:19534][p:19534][core][error] [19534-1] contacts import failure
error {
code = 429
message = "Too Many Requests: retry after 292"
}

[13:02:53.178][t:19537][p:19534][core][debug] incoming SIP call #1 from "telegram" sip:[email protected] to sip:[email protected] with call-id [email protected]
[13:02:53.184][t:19534][p:19534][core][debug] [19534-3] associated with SIP#1
[13:02:53.184][t:19534][p:19534][core][debug] [19534-3] setting SIP #1 in ringing mode
[13:02:53.204][t:19534][p:19534][core][debug] [19534-3] dialing tg
[13:02:53.204][t:19534][p:19534][core][debug] [19534-3] dropping call cause of temp TG block for 418 seconds
[13:07:35.212][t:19537][p:19534][core][debug] incoming SIP call #2 from "telegram" sip:[email protected] to sip:[email protected] with call-id [email protected]
[13:07:35.219][t:19534][p:19534][core][debug] [19534-5] associated with SIP#2
[13:07:35.219][t:19534][p:19534][core][debug] [19534-5] setting SIP #2 in ringing mode
[13:07:35.239][t:19534][p:19534][core][debug] [19534-5] dialing tg
[13:07:35.239][t:19534][p:19534][core][debug] [19534-5] dropping call cause of temp TG block for 136 seconds
[13:14:21.888][t:19537][p:19534][core][debug] incoming SIP call #3 from "telegram" sip:[email protected] to sip:[email protected] with call-id [email protected]
[13:14:21.896][t:19534][p:19534][core][debug] [19534-7] associated with SIP#3
[13:14:21.896][t:19534][p:19534][core][debug] [19534-7] setting SIP #3 in ringing mode
[13:14:21.916][t:19534][p:19534][core][debug] [19534-7] dialing tg
[13:14:25.915][t:19537][p:19534][core][debug] incoming SIP call #4 from "telegram" sip:[email protected] to sip:[email protected] with call-id [email protected]
[13:14:31.777][t:19534][p:19534][core][error] [19534-7] contacts import failure
error {
code = 429
message = "Too Many Requests: retry after 291"
}

[13:14:31.777][t:19534][p:19534][core][debug] [19534-8] associated with SIP#4
[13:14:31.777][t:19534][p:19534][core][debug] [19534-8] setting SIP #4 in ringing mode
[13:14:31.808][t:19534][p:19534][core][debug] [19534-8] dialing tg
[13:14:31.808][t:19534][p:19534][core][debug] [19534-8] dropping call cause of temp TG block for 590 seconds

Settings.ini settings

[logging]
core=1
tgvoip=5
pjsip=2
sip_messages=true
console_min_level=0
file_min_level=0
;tdlib=3

[sip]
public_address=0.0.0.0
;stun_server=
port=5162
;port_range=0
id_uri=sip:[email protected]
callback_uri=sip:[email protected]:5160
raw_pcm=false
;thread_count=1

[telegram]
api_id=*****
api_hash=************
system_language_code=ru-RU
;device_model=PC
;system_version=Linux
;application_version=1.0
;database_folder=
;udp_p2p=false
;udp_reflector=true
;enable_aec=false
;enable_ns=false
;enable_agc=false

use_proxy=false
proxy_address=
proxy_port=
proxy_username=
proxy_password=
ddress=
;voip_proxy_port=0
;voip_proxy_username=
;voip_proxy_password=

[other]
extra_wait_time=300
;peer_flood_time=86400
;use_voip_proxy=false
;voip_proxy_a

could you provide an example config?

Couldn't figure out configuration of tg2sip on first try.

asterisk and tg2sip are on the same server
I'm using asterisk with this configs:

  • sip.conf:
[telegram]
host=127.0.0.1
type=peer
context=from-telegram
port=5061
disallow=all
allow=opus
  • codecs.conf
[opus]
type=opus
fec=yes
dtx=yes
cbr=yes
bitrate=48000
samprate=48000
max_playback_rate=48000
  • extensions.conf (MYREPLACEDNUMBER is known by used tg2sip account and different of its own)
exten => 3,1,Dial(SIP/MYREPLACEDNUMBER@telegram,30,r)

tg2sip settings.ini:

[logging]
core=1
tgvoip=1
pjsip=1
sip_messages=true

[sip]
port=5061
id_uri=sip:127.0.0.1:5060

tg2sip.log:

[14:47:10.761][t:25041][p:25041][pjsip][debug] Module "mod-pjsua-log" registered
[14:47:10.762][t:25041][p:25041][pjsip][debug] Module "mod-tsx-layer" registered
[14:47:10.762][t:25041][p:25041][pjsip][debug] Module "mod-stateful-util" registered
[14:47:10.762][t:25041][p:25041][pjsip][debug] Module "mod-ua" registered
[14:47:10.762][t:25041][p:25041][pjsip][debug] Module "mod-100rel" registered
[14:47:10.762][t:25041][p:25041][pjsip][debug] Module "mod-pjsua" registered
[14:47:10.768][t:25041][p:25041][pjsip][debug] Module "mod-invite" registered
[14:47:10.768][t:25041][p:25041][pjsip][debug] select() I/O Queue created (0x2f46d18)
[14:47:10.814][t:25041][p:25041][pjsip][debug] Module "mod-evsub" registered
[14:47:10.814][t:25041][p:25041][pjsip][debug] Module "mod-presence" registered
[14:47:10.814][t:25041][p:25041][pjsip][debug] Module "mod-mwi" registered
[14:47:10.814][t:25041][p:25041][pjsip][debug] Module "mod-refer" registered
[14:47:10.814][t:25041][p:25041][pjsip][debug] Module "mod-pjsua-pres" registered
[14:47:10.815][t:25041][p:25041][pjsip][debug] Module "mod-pjsua-im" registered
[14:47:10.815][t:25041][p:25041][pjsip][debug] Module "mod-pjsua-options" registered
[14:47:10.815][t:25041][p:25041][pjsip][debug] 1 SIP worker threads created
[14:47:10.815][t:25041][p:25041][pjsip][info] pjsua version 2.8-svn for Linux-4.19.42.1/x86_64/glibc-2.12 initialized
[14:47:10.815][t:25041][p:25041][pjsip][debug] PJSUA state changed: CREATED --> INIT
[14:47:10.815][t:25041][p:25041][pjsip][debug] Setting null sound device..
[14:47:10.816][t:25041][p:25041][pjsip][debug] Opening null sound device..
[14:47:10.817][t:25041][p:25041][pjsip][debug] SIP UDP socket reachable at 192.168.1.170:5061
[14:47:10.817][t:25041][p:25041][pjsip][debug] SIP UDP transport started, published address is 192.168.1.170:5061
[14:47:10.817][t:25041][p:25041][pjsip][debug] PJSUA state changed: INIT --> STARTING
[14:47:10.817][t:25041][p:25041][pjsip][debug] Module "mod-unsolicited-mwi" registered
[14:47:10.817][t:25041][p:25041][pjsip][debug] PJSUA state changed: STARTING --> RUNNING
[14:47:10.817][t:25041][p:25041][pjsip][debug] Adding account: id=sip:127.0.0.1:5060
[14:47:10.818][t:25041][p:25041][pjsip][debug] Account sip:127.0.0.1:5060 added with id 0
[14:47:11.250][t:25055][p:25041][core][info] TG client authorization ready
[14:47:11.250][t:25041][p:25041][core][info] Loading contacts cache
[14:47:11.524][t:25041][p:25041][core][info] Loaded 27 usernames and 121 phones into contacts cache
[14:47:11.818][t:25049][p:25041][pjsip][debug] Closing sound device after idle for 1 second(s)
[14:47:11.818][t:25049][p:25041][pjsip][debug] Closing null sound device..
[14:47:32.530][t:25049][p:25041][pjsip][debug] RX 813 bytes Request msg INVITE/cseq=102 (rdata0x2f77768) from UDP 127.0.0.1:5060:
INVITE sip:[email protected]:5061 SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK182b58a0
Max-Forwards: 70
From: <sip:[email protected]>;tag=as54c242fd
To: <sip:[email protected]:5061>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 16.4.0
Date: Sun, 23 Jun 2019 11:47:32 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 237

v=0
o=root 726066901 726066901 IN IP4 127.0.0.1
s=Asterisk PBX 16.4.0
c=IN IP4 127.0.0.1
t=0 0
m=audio 11434 RTP/AVP 107 101
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:60
a=sendrecv

--end msg--
[14:47:32.531][t:25049][p:25041][pjsip][debug] Incoming Request msg INVITE/cseq=102 (rdata0x2f77768)
[14:47:32.533][t:25049][p:25041][pjsip][debug] Call 0: initializing media..
[14:47:32.537][t:25049][p:25041][pjsip][debug] RTP socket reachable at 192.168.1.170:4000
[14:47:32.538][t:25049][p:25041][pjsip][debug] RTCP socket reachable at 192.168.1.170:4001
[14:47:32.539][t:25049][p:25041][pjsip][debug] Media index 0 selected for audio call 0
[14:47:32.539][t:25049][p:25041][core][debug] incoming SIP call #0 from <sip:[email protected]> to <sip:[email protected]> with call-id [email protected]:5060
[14:47:32.540][t:25049][p:25041][pjsip][debug] Call 0: deinitializing media..
[14:47:32.540][t:25049][p:25041][pjsip][debug] Call 0: cleaning up provisional media, prov_med_cnt=1, med_cnt=0
[14:47:32.540][t:25049][p:25041][pjsip][debug] TX 323 bytes Response msg 406/INVITE/cseq=102 (tdta0x7f0f5c00cdf8) to UDP 127.0.0.1:5060:
SIP/2.0 406 Not Acceptable
Via: SIP/2.0/UDP 127.0.0.1:5060;received=127.0.0.1;branch=z9hG4bK182b58a0
Call-ID: [email protected]:5060
From: <sip:[email protected]>;tag=as54c242fd
To: <sip:[email protected]>;tag=zjHMpFiPkHnvDV9xu3igAXkdIhWnfbEt
CSeq: 102 INVITE
Content-Length:  0


--end msg--
[14:47:32.543][t:25041][p:25041][core][debug] [25041-1] associated with SIP#0
[14:47:32.544][t:25041][p:25041][core][debug] [25041-1] setting SIP #0 in ringing mode
[14:47:32.544][t:25041][p:25041][pjsip][debug] Answering call 0: code=180
[14:47:32.546][t:25041][p:25041][pjsip][info] Invalid call_id 0 in pjsua_call_answer()
[14:47:32.546][t:25041][p:25041][pjsip][error] pjsua_call_answer2(id, param.p_opt, prm.statusCode, param.p_reason, param.p_msg_data) error: INVITE session already terminated (PJSIP_ESESSIONTERMINATED) (status=171140) [../src/pjsua2/call.cpp:582]
[14:47:32.550][t:25049][p:25041][pjsip][debug] RX 417 bytes Request msg ACK/cseq=102 (rdata0x7f0f5c0100b8) from UDP 127.0.0.1:5060:
ACK sip:[email protected]:5061 SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK182b58a0
Max-Forwards: 70
From: <sip:[email protected]>;tag=as54c242fd
To: <sip:[email protected]:5061>;tag=zjHMpFiPkHnvDV9xu3igAXkdIhWnfbEt
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 16.4.0
Content-Length: 0


--end msg--
[14:47:32.584][t:25041][p:25041][pjsip][debug] Call 0 hanging up: code=500..
[14:47:32.585][t:25041][p:25041][pjsip][info] Invalid call_id 0 in pjsua_call_hangup()
[14:47:32.585][t:25041][p:25041][pjsip][error] pjsua_call_hangup(id, prm.statusCode, param.p_reason, param.p_msg_data) error: INVITE session already terminated (PJSIP_ESESSIONTERMINATED) (status=171140) [../src/pjsua2/call.cpp:591]
[14:47:32.585][t:25041][p:25041][core][error] INVITE session already terminated (PJSIP_ESESSIONTERMINATED)

asterisk sip set debug on:

Audio is at 11434
Adding codec opus to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 127.0.0.1:5061:
INVITE sip:[email protected]:5061 SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK182b58a0
Max-Forwards: 70
From: <sip:[email protected]>;tag=as54c242fd
To: <sip:[email protected]:5061>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 16.4.0
Date: Sun, 23 Jun 2019 11:47:32 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 237

v=0
o=root 726066901 726066901 IN IP4 127.0.0.1
s=Asterisk PBX 16.4.0
c=IN IP4 127.0.0.1
t=0 0
m=audio 11434 RTP/AVP 107 101
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:60
a=sendrecv

---

<--- SIP read from UDP:127.0.0.1:5061 --->
SIP/2.0 406 Not Acceptable
Via: SIP/2.0/UDP 127.0.0.1:5060;received=127.0.0.1;branch=z9hG4bK182b58a0
Call-ID: [email protected]:5060
From: <sip:[email protected]>;tag=as54c242fd
To: <sip:[email protected]>;tag=zjHMpFiPkHnvDV9xu3igAXkdIhWnfbEt
CSeq: 102 INVITE
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---
Transmitting (no NAT) to 127.0.0.1:5061:
ACK sip:[email protected]:5061 SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK182b58a0
Max-Forwards: 70
From: <sip:[email protected]>;tag=as54c242fd
To: <sip:[email protected]:5061>;tag=zjHMpFiPkHnvDV9xu3igAXkdIhWnfbEt
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 16.4.0
Content-Length: 0


---
Really destroying SIP dialog '[email protected]:5060' Method: INVITE


i will probably figure it out if invest some time in learning how it actually works.
It would be really helpful if you could help me to fix it now.
Thanks.

Unable to make SIP->TG calls after about a week of the running app. Restart has helped.

[08:52:28.999][t:8][p:1][pjsip][debug] RX 907 bytes Request msg INVITE/cseq=102 (rdata0x7f7944011018) from UDP 10.10.1.1:5060:
INVITE sip:tg%[email protected] SIP/2.0
Via: SIP/2.0/UDP 10.10.1.1:5060;branch=z9hG4bK07e289ec
Max-Forwards: 70
From: "XXXXXXX XXXXXXXX" sip:[email protected];tag=as1132a0f1
To: sip:tg%[email protected]
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.23.1
Date: Thu, 29 Nov 2018 08:52:28 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 338

v=0
o=root 2105108083 2105108083 IN IP4 10.10.1.1
s=Asterisk PBX 13.23.1
c=IN IP4 10.10.1.1
t=0 0
m=audio 10040 RTP/AVP 0 8 3 107 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:107 opus/48000/2
a=fmtp:107 useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:20
a=sendrecv

--end msg--
[08:52:28.999][t:8][p:1][pjsip][debug] Incoming Request msg INVITE/cseq=102 (rdata0x7f7944011018)
[08:52:29.000][t:8][p:1][pjsip][debug] Call 46: initializing media..
[08:52:29.000][t:8][p:1][pjsip][debug] RTP socket reachable at 10.10.1.2:4348
[08:52:29.000][t:8][p:1][pjsip][debug] RTCP socket reachable at 10.10.1.2:4349
[08:52:29.000][t:8][p:1][pjsip][debug] Media index 0 selected for audio call 46
[08:52:29.000][t:8][p:1][core][debug] incoming SIP call #46 from "XXXXXXX XXXXXXXX" sip:[email protected] to sip:tg%[email protected] with call-id [email protected]:5060
[08:52:29.000][t:8][p:1][pjsip][debug] Call 46 hanging up: code=0..
[08:52:29.000][t:8][p:1][pjsip][debug] Pending call 46 hangup upon completion of media transport
[08:52:29.000][t:8][p:1][pjsip][debug] Call 46 hanging up: code=500..
[08:52:29.000][t:8][p:1][pjsip][debug] Pending call 46 hangup upon completion of media transport
[08:52:29.000][t:8][p:1][pjsip][debug] TX 289 bytes Response msg 100/INVITE/cseq=102 (tdta0x7f7944021e78) to UDP 10.10.1.1:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.10.1.1:5060;received=10.10.1.1;branch=z9hG4bK07e289ec
Call-ID: [email protected]:5060
From: "XXXXXXX XXXXXXXX" sip:[email protected];tag=as1132a0f1
To: sip:tg%[email protected]
CSeq: 102 INVITE
Content-Length: 0

--end msg--
[08:52:29.000][t:8][p:1][pjsip][debug] Call 46 hanging up: code=500..
[08:52:29.000][t:8][p:1][pjsip][debug] TX 320 bytes Response msg 500/INVITE/cseq=102 (tdta0x7f7944029698) to UDP 10.10.1.1:5060:
SIP/2.0 500
Via: SIP/2.0/UDP 10.10.1.1:5060;received=10.10.1.1;branch=z9hG4bK07e289ec
Call-ID: [email protected]:5060
From: "XXXXXXX XXXXXXXX" sip:[email protected];tag=as1132a0f1
To: sip:tg%[email protected];tag=oVrJ5eT6cJ84e4QUZ4sXiOKZqiwYDzih
CSeq: 102 INVITE
Content-Length: 0

--end msg--
[08:52:29.000][t:8][p:1][pjsip][debug] Call 46: deinitializing media..
[08:52:29.000][t:8][p:1][pjsip][debug] Call 46: cleaning up provisional media, prov_med_cnt=1, med_cnt=0
[08:52:29.001][t:8][p:1][pjsip][debug] RX 410 bytes Request msg ACK/cseq=102 (rdata0x7f7944011018) from UDP 10.10.1.1:5060:
ACK sip:tg%[email protected] SIP/2.0
Via: SIP/2.0/UDP 10.10.1.1:5060;branch=z9hG4bK07e289ec
Max-Forwards: 70
From: "XXXXXXX XXXXXXXX" sip:[email protected];tag=as1132a0f1
To: sip:tg%[email protected];tag=oVrJ5eT6cJ84e4QUZ4sXiOKZqiwYDzih
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.23.1
Content-Length: 0

--end msg--
[08:52:29.008][t:1][p:1][core][debug] [1-390] associated with SIP#46
[08:52:29.008][t:1][p:1][core][debug] [1-390] setting SIP #46 in ringing mode
[08:52:29.008][t:1][p:1][pjsip][debug] Answering call 46: code=180
[08:52:29.008][t:1][p:1][pjsip][info] Invalid call_id 46 in pjsua_call_answer()
[08:52:29.008][t:1][p:1][pjsip][error] pjsua_call_answer2(id, param.p_opt, prm.statusCode, param.p_reason, param.p_msg_data) error: INVITE session already terminated (PJSIP_ESESSIONTERMINATED) (status=171140) [../src/pjsua2/call.cpp:582]
[08:52:29.018][t:1][p:1][pjsip][debug] Call 46 hanging up: code=500..
[08:52:29.018][t:1][p:1][pjsip][info] Invalid call_id 46 in pjsua_call_hangup()
[08:52:29.018][t:1][p:1][pjsip][error] pjsua_call_hangup(id, prm.statusCode, param.p_reason, param.p_msg_data) error: INVITE session already terminated (PJSIP_ESESSIONTERMINATED) (status=171140) [../src/pjsua2/call.cpp:591]
[08:52:29.018][t:1][p:1][core][error] INVITE session already terminated (PJSIP_ESESSIONTERMINATED)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.