Infactum / tg2sip

Telegram <-> SIP voice gateway
GNU General Public License v2.0
273 stars 104 forks source link

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

Open oleg9301 opened 3 years ago

oleg9301 commented 3 years ago

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.

Infactum commented 3 years ago

As log says - this is tgvoip related problem. This library is in legacy state now and not really supported by telegram. Also it's code written poorly enough. So I'm not really interested in investigation this issue.