Infactum / tg2sip

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

Error while answering #13

Closed danielgt82 closed 4 years ago

danielgt82 commented 5 years ago

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:1000@192.168.0.21;tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs To: sip:1000@192.168.0.200;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:1000@192.168.0.200: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:1000@192.168.0.200: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:1000@192.168.0.21;tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs To: sip:1000@192.168.0.200;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:1000@192.168.0.200:5070 SIP/2.0 Via: SIP/2.0/UDP 192.168.0.21:5060;rport;branch=z9hG4bKPjXKPQ092VLQZRSVN2BKusJyecHBPwm-NF Max-Forwards: 70 From: sip:1000@192.168.0.21;tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs To: sip:1000@192.168.0.200;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:1000@192.168.0.200:5070 SIP/2.0 Via: SIP/2.0/UDP 192.168.0.21:5060;rport;branch=z9hG4bKPjwifKzVYJJ8dLUYtRg1nLqnES-gM6HdIe Max-Forwards: 70 From: sip:1000@192.168.0.21;tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs To: sip:1000@192.168.0.200;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:1000@192.168.0.21;tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs To: sip:1000@192.168.0.200;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:1000@192.168.0.21;tag=Tm535bOi8HAF.Rn9STvvswSmw0HMayxs To: sip:1000@192.168.0.200;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..

Infactum commented 5 years ago
[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]

Ensure that OPUS is set to 48k on asterisk side.

See max_playback_rate here.

danielgt82 commented 5 years ago

[opus] type=opus fec=yes ;fec=no dtx=yes cbr=yes bitrate=48000 samprate=48000 max_playback_rate=48000