dart-sip-ua icon indicating copy to clipboard operation
dart-sip-ua copied to clipboard

Video call terminated after answer

Open morfair opened this issue 2 years ago • 5 comments

I do video call from https://tryit.jssip.net/ to Flutter:

INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/WSS pvngo3rdjrg0.invalid;branch=z9hG4bK1238648
Max-Forwards: 69
To: <sip:[email protected]>
From: "morfair-work-pc" <sip:[email protected]>;tag=gba3bp7ub6
Call-ID: hqsmog5cf3hi7fhiad1b
CSeq: 9239 INVITE
Contact: <sip:[email protected];transport=ws;ob>
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
Supported: timer,ice,replaces,outbound
User-Agent: JsSIP 3.8.2
Content-Length: 7287

v=0
o=- 3916041425617185783 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=extmap-allow-mixed
a=msid-semantic: WMS TaUfv8YlphfrxofRLtlUsNbzdm02ObsHDcZm
m=audio 49474 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 1.1.1.1
a=rtcp:63644 IN IP4 1.1.1.1
a=candidate:4087335268 1 udp 2122260223 10.10.6.5 54981 typ host generation 0 network-id 1
a=candidate:4087335268 2 udp 2122260222 10.10.6.5 54982 typ host generation 0 network-id 1
a=candidate:2970761196 2 udp 1686052606 1.1.1.1 63644 typ srflx raddr 10.10.6.5 rport 54982 generation 0 network-id 1
a=candidate:2970761196 1 udp 1686052607 1.1.1.1 49474 typ srflx raddr 10.10.6.5 rport 54981 generation 0 network-id 1
a=candidate:3172742548 1 tcp 1518280447 10.10.6.5 9 typ host tcptype active generation 0 network-id 1
a=candidate:3172742548 2 tcp 1518280446 10.10.6.5 9 typ host tcptype active generation 0 network-id 1
a=ice-ufrag:3Qwu
a=ice-pwd:oEwEfLlKoLaN0NNofZrO3Xl7
a=ice-options:trickle
a=fingerprint:sha-256 D0:DD:2B:F4:CB:39:95:43:AA:DB:51:AD:67:D8:6D:31:94:91:4D:71:03:F1:16:6F:F7:A9:3B:70:CE:1C:83:3F
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:TaUfv8YlphfrxofRLtlUsNbzdm02ObsHDcZm 110093ea-09f9-4a6a-8191-93256b94a1d6
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:1662500094 cname:brFpXZ/mqc967pVG
a=ssrc:1662500094 msid:TaUfv8YlphfrxofRLtlUsNbzdm02ObsHDcZm 110093ea-09f9-4a6a-8191-93256b94a1d6
a=ssrc:1662500094 mslabel:TaUfv8YlphfrxofRLtlUsNbzdm02ObsHDcZm
a=ssrc:1662500094 label:110093ea-09f9-4a6a-8191-93256b94a1d6
m=video 16655 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 121 127 120 125 107 108 109 35 36 124 119 123 118 114 115 116
c=IN IP4 1.1.1.1
a=rtcp:37889 IN IP4 1.1.1.1
a=candidate:4087335268 1 udp 2122260223 10.10.6.5 54983 typ host generation 0 network-id 1
a=candidate:4087335268 2 udp 2122260222 10.10.6.5 54984 typ host generation 0 network-id 1
a=candidate:2970761196 2 udp 1686052606 1.1.1.1 37889 typ srflx raddr 10.10.6.5 rport 54984 generation 0 network-id 1
a=candidate:2970761196 1 udp 1686052607 1.1.1.1 16655 typ srflx raddr 10.10.6.5 rport 54983 generation 0 network-id 1
a=candidate:3172742548 1 tcp 1518280447 10.10.6.5 9 typ host tcptype active generation 0 network-id 1
a=candidate:3172742548 2 tcp 1518280446 10.10.6.5 9 typ host tcptype active generation 0 network-id 1
a=ice-ufrag:3Qwu
a=ice-pwd:oEwEfLlKoLaN0NNofZrO3Xl7
a=ice-options:trickle
a=fingerprint:sha-256 D0:DD:2B:F4:CB:39:95:43:AA:DB:51:AD:67:D8:6D:31:94:91:4D:71:03:F1:16:6F:F7:A9:3B:70:CE:1C:83:3F
a=setup:actpass
a=mid:1
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:TaUfv8YlphfrxofRLtlUsNbzdm02ObsHDcZm dbf0c622-ff08-437d-b291-5d2c39ae84d9
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=fmtp:98 profile-id=0
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 VP9/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 profile-id=2
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:102 H264/90000
a=rtcp-fb:102 goog-remb
a=rtcp-fb:102 transport-cc
a=rtcp-fb:102 ccm fir
a=rtcp-fb:102 nack
a=rtcp-fb:102 nack pli
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:121 rtx/90000
a=fmtp:121 apt=102
a=rtpmap:127 H264/90000
a=rtcp-fb:127 goog-remb
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli
a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
a=rtpmap:120 rtx/90000
a=fmtp:120 apt=127
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=125
a=rtpmap:108 H264/90000
a=rtcp-fb:108 goog-remb
a=rtcp-fb:108 transport-cc
a=rtcp-fb:108 ccm fir
a=rtcp-fb:108 nack
a=rtcp-fb:108 nack pli
a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:35 AV1X/90000
a=rtcp-fb:35 goog-remb
a=rtcp-fb:35 transport-cc
a=rtcp-fb:35 ccm fir
a=rtcp-fb:35 nack
a=rtcp-fb:35 nack pli
a=rtpmap:36 rtx/90000
a=fmtp:36 apt=35
a=rtpmap:124 H264/90000
a=rtcp-fb:124 goog-remb
a=rtcp-fb:124 transport-cc
a=rtcp-fb:124 ccm fir
a=rtcp-fb:124 nack
a=rtcp-fb:124 nack pli
a=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f
a=rtpmap:119 rtx/90000
a=fmtp:119 apt=124
a=rtpmap:123 H264/90000
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 transport-cc
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f
a=rtpmap:118 rtx/90000
a=fmtp:118 apt=123
a=rtpmap:114 red/90000
a=rtpmap:115 rtx/90000
a=fmtp:115 apt=114
a=rtpmap:116 ulpfec/90000
a=ssrc-group:FID 1817057936 1383878196
a=ssrc:1817057936 cname:brFpXZ/mqc967pVG
a=ssrc:1817057936 msid:TaUfv8YlphfrxofRLtlUsNbzdm02ObsHDcZm dbf0c622-ff08-437d-b291-5d2c39ae84d9
a=ssrc:1817057936 mslabel:TaUfv8YlphfrxofRLtlUsNbzdm02ObsHDcZm
a=ssrc:1817057936 label:dbf0c622-ff08-437d-b291-5d2c39ae84d9
a=ssrc:1383878196 cname:brFpXZ/mqc967pVG
a=ssrc:1383878196 msid:TaUfv8YlphfrxofRLtlUsNbzdm02ObsHDcZm dbf0c622-ff08-437d-b291-5d2c39ae84d9
a=ssrc:1383878196 mslabel:TaUfv8YlphfrxofRLtlUsNbzdm02ObsHDcZm
a=ssrc:1383878196 label:dbf0c622-ff08-437d-b291-5d2c39ae84d9

After answer on mobile app call terminated with answer from mobile app:

SIP/2.0 488 Not Acceptable Here
Via: SIP/2.0/WSS pvngo3rdjrg0.invalid;rport=56438;received=127.0.0.1;branch=z9hG4bK7851071
Call-ID: hqsmol3kkjind0o2qiqe
From: "morfair-work-pc" <sip:[email protected]>;tag=imv2vthavd
To: <sip:[email protected]>;tag=785029d9-6f99-4ebb-9971-d4856dbd9494
CSeq: 5873 INVITE
Server: Asterisk PBX 18.5.0
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Reason: Q.850;cause=58
Content-Length:  0

Browser show error: Incompatible SDP

In debug console I see errors:

I/flutter (28279): [2021-11-18 12:18:05.217] Level.debug rtc_session.dart:650 ::: emit "sdp"
W/VideoCapabilities(28279): Unrecognized profile 2130706433 for video/avc
W/VideoCapabilities(28279): Unrecognized profile 2130706434 for video/avc
W/VideoCapabilities(28279): Unrecognized profile 2130706433 for video/avc
W/VideoCapabilities(28279): Unrecognized profile 2130706434 for video/avc
...
I/flutter (28279): [2021-11-18 12:18:05.265] Level.debug rtc_session.dart:2941 ::: session failed
I/flutter (28279): [2021-11-18 12:18:05.268] Level.debug rtc_session.dart:2944 ::: emit "_failed"
I/flutter (28279): [2021-11-18 12:18:05.272] Level.debug rtc_session.dart:1474 ::: close()
I/flutter (28279): [2021-11-18 12:18:05.276] Level.debug rtc_session.dart:2955 ::: emit "failed"
I/flutter (28279): [2021-11-18 12:18:05.279] Level.debug sip_ua_helper.dart:214 ::: call failed with cause: Code: [488], Cause: WebRTC Error, Reason: SetRemoteDescription(offer) failed
I/flutter (28279): MySipHelperListener callStateChanged() state: CallStateEnum.FAILED
I/flutter (28279): [2021-11-18 12:18:05.284] Level.error rtc_session.dart:660 ::: emit "peerconnection:setremotedescriptionfailed" [error:Unable to RTCPeerConnection::setRemoteDescription: peerConnectionSetRemoteDescription(): WEBRTC_SET_REMOTE_DESCRIPTION_ERROR: Failed to set remote offer sdp: Failed to set remote video description send parameters for m-section with mid='video-1'.]
E/flutter (28279): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Assertion failed: "peerconnection.setRemoteDescription() failed"
E/flutter (28279): #0      RTCSession.answer (package:sip_ua/src/rtc_session.dart:663:7)
E/flutter (28279): <asynchronous suspension>
E/flutter (28279): 
I/AudioManager(28279): setMode mode:0
I/AudioManager(28279): abandonAudioFocus
I/flutter (28279): [2021-11-18 12:18:05.311] Level.debug rtc_session.dart:1492 ::: close() | closing local MediaStream

morfair avatar Nov 18 '21 12:11 morfair

I have two mobile devices: Redmi 9A and Huawei Nova LTE (CAN-L11). And two brosers: Firefox 94.0.2 and Chrome 96.0.4664.45. Site: https://tryit.jssip.net/.

And only call from Firefox to Huawei CAN-L11 work!

Chrome -> Redmi 9A - Incompatible SDP Firefox -> Redmi 9A - Incompatible SDP Chrome -> Huawei CAN-L11 - Incompatible SDP Firefox -> Huawei CAN-L11 - WORK!!!!

P.S.: Call from mobile to browser always works.

morfair avatar Nov 26 '21 13:11 morfair

Oh... Maybe Asterisk rewrite INVITE body with new SDP.юю

A debug incoming call SDP, maybe it will be useful:

v=0
o=- 1291471226 1291471226 IN IP4 45.139.24.57
s=Asterisk
c=IN IP4 45.139.24.57
t=0 0
a=msid-semantic:WMS *
a=group:BUNDLE audio-0 video-1
m=audio 13462 UDP/TLS/RTP/SAVPF 8 101
a=connection:new
a=setup:actpass
a=fingerprint:SHA-256 60:C8:FC:AA:01:2A:CE:0B:BE:C3:94:D9:0C:49:92:75:06:56:2D:F8:ED:93:B0:D4:27:C2:E4:88:6C:2F:13:58
a=ice-ufrag:7d6973e77e596a7c5ca975fd1ee04a4f
a=ice-pwd:78d20512467e79ab088da2a9631ae4db
a=candidate:H2d8b1839 1 UDP 2130706431 45.139.24.57 13462 typ host
a=candidate:H89e136a7 1 UDP 2130706431 2a0f:1140:100::1c 13462 typ host
a=candidate:He0ecc6ac 1 UDP 2130706431 fe80::f816:3eff:fe49:f4a8 13462 typ host
a=candidate:H63d27d08 1 UDP 2130706431 fe80::42:4fff:feb8:99ab 13462 typ host
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
a=rtcp-mux
a=ssrc:302749605 cname:df664cb4-f1ec-4cfa-92e0-8fd62d07df8a
a=msid:64715997-bdfb-4395-ac9e-974583f77ede 6f0d0502-9a0b-432c-a302-7de6ad4ce5f1
a=rtcp-fb:* transport-cc
a=mid:audio-0
m=video 13462 UDP/TLS/RTP/SAVPF 99
a=connection:new
a=setup:actpass
a=fingerprint:SHA-256 60:C8:FC:AA:01:2A:CE:0B:BE:C3:94:D9:0C:49:92:75:06:56:2D:F8:ED:93:B0:D4:27:C2:E4:88:6C:2F:13:58
a=ice-ufrag:7d6973e77e596a7c5ca975fd1ee04a4f
a=ice-pwd:78d20512467e79ab088da2a9631ae4db
a=rtpmap:99 H264/90000
a=fmtp:99 packetization-mode=1;level-asymmetry-allowed=1;profile-level-id=42001F
a=sendrecv
a=rtcp-mux
a=ssrc:608170838 cname:de6c7075-8495-4f92-a5b5-a82c999b284e
a=msid:3ab0f427-0931-48f5-9504-2cbd21395e0d 205bee32-2106-458b-b238-4eb32f73e1ea
a=rtcp-fb:* transport-cc
a=rtcp-fb:* ccm fir
a=rtcp-fb:* goog-remb
a=rtcp-fb:* nack
a=extmap:1 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=mid:video-1

morfair avatar Nov 26 '21 14:11 morfair

Help, please!!! Give any hint!

morfair avatar Nov 29 '21 09:11 morfair

Did you find any useful solution? Same issue for me as well. Works in debug mode but not in release mode.

sahooamit1405 avatar Apr 18 '22 04:04 sahooamit1405

@sahooamit1405 no... author just ignores us :(

morfair avatar Jul 01 '22 08:07 morfair