nttcom / SkyWay-iOS-SDK

[Deprecated] SkyWay iOS SDK
17 stars 2 forks source link

Sending of the SDP Offer and Candidates with wrong order when used with external TURN server #5

Open carpteas opened 8 years ago

carpteas commented 8 years ago

Hi,

Kindly refer to this topic(https://groups.google.com/forum/#!topic/skywayjs/Dthlm0Vz5j4) where I have put everything inside. In short, I suspect that when using this SDK with external TURN server(e.g. numb.viagenie.ca located on U.S.), although RTCPeerConnection.onicecandidate() gets triggered after RTCPeerConnection.createOffer() and RTCPeerConnection.setLocalDescription() locally, somehow the SDP OFFER gets sent after--should be before, isn't it?--candidates have been sent through. Maybe some threading or queueing flaws?

calling to wFBBQHmwQXo0UgVR
2016-11-08 17:44:00.930021 DemoSun[7631:1684676] [ICEServers]
(
    "RTCICEServer: [stun:numb.viagenie.ca:3478::]",
    "RTCICEServer: [turn:numb.viagenie.ca:3478:carpteas:xxxxxxxx]"
)
2016-11-08 17:44:00.930911 DemoSun[7631:1684676] 
[Constraints]
(
    "OfferToReceiveVideo: true",
    "OfferToReceiveAudio: true"
)
[Optional]
(
    "internalSctpDataChannels: true",
    "DtlsSrtpKeyAgreement: true"
)
2016-11-08 17:44:00.948154 DemoSun[7631:1684676] 
[Constraints]
(
    "OfferToReceiveVideo: true",
    "OfferToReceiveAudio: true"
)
[Optional]
(
    "internalSctpDataChannels: true",
    "DtlsSrtpKeyAgreement: true"
)
2016-11-08 17:44:01.022090 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:221570572 1 udp 2122260223 10.38.75.211 53939 typ host generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.041081 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:221570572 2 udp 2122260222 10.38.75.211 55449 typ host generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.059595 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:221570572 1 udp 2122260223 10.38.75.211 56477 typ host generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 1;
            sdpMid = video;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.078666 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:221570572 2 udp 2122260222 10.38.75.211 63632 typ host generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 1;
            sdpMid = video;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.124348 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:1136073468 1 tcp 1518280447 10.38.75.211 60725 typ host tcptype passive generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.143868 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:1136073468 2 tcp 1518280446 10.38.75.211 60726 typ host tcptype passive generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.163878 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:1136073468 1 tcp 1518280447 10.38.75.211 60727 typ host tcptype passive generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 1;
            sdpMid = video;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.180782 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:1136073468 2 tcp 1518280446 10.38.75.211 60728 typ host tcptype passive generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 1;
            sdpMid = video;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.237898 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:4213481432 1 udp 1686052607 114.136.131.187 5213 typ srflx raddr 10.38.75.211 rport 53939 generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.254647 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:4213481432 2 udp 1686052606 114.136.131.187 6844 typ srflx raddr 10.38.75.211 rport 63632 generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 1;
            sdpMid = video;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.274127 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:4213481432 2 udp 1686052606 114.136.131.187 6723 typ srflx raddr 10.38.75.211 rport 55449 generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.290298 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:4213481432 1 udp 1686052607 114.136.131.187 7751 typ srflx raddr 10.38.75.211 rport 56477 generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 1;
            sdpMid = video;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.527651 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:3433799847 1 udp 41885439 66.228.45.110 57345 typ relay raddr 114.136.131.187 rport 5213 generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.545519 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:3433799847 2 udp 41885438 66.228.45.110 57343 typ relay raddr 114.136.131.187 rport 6723 generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.564651 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:3433799847 2 udp 41885438 66.228.45.110 57344 typ relay raddr 114.136.131.187 rport 6844 generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 1;
            sdpMid = video;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.583014 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        candidate =         {
            candidate = "candidate:3433799847 1 udp 41885439 66.228.45.110 57346 typ relay raddr 114.136.131.187 rport 7751 generation 0 ufrag AARMn2XiRl3qLszV network-id 3 network-cost 999";
            sdpMLineIndex = 1;
            sdpMid = video;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    type = CANDIDATE;
}
2016-11-08 17:44:01.602536 DemoSun[7631:1684832] [SKW/Snd]{
    dst = wFBBQHmwQXo0UgVR;
    payload =     {
        browser = Supported;
        connectionId = "mc_KTktpm2UnEHceD0s";
        label = "mc_KTktpm2UnEHceD0s";
        metadata = "";
        reliable = false;
        sdp =         {
            sdp = "v=0
\no=- 5704071456554484345 2 IN IP4 127.0.0.1
\ns=-
\nt=0 0
\na=group:BUNDLE audio video
\na=msid-semantic: WMS ARDAMS
\nm=audio 9 UDP/TLS/RTP/SAVPF 103 111 104 9 102 0 8 106 105 13 127 126
\nc=IN IP4 0.0.0.0
\na=rtcp:9 IN IP4 0.0.0.0
\na=ice-ufrag:AARMn2XiRl3qLszV
\na=ice-pwd:NDef2pCuRqVKiS5KmnHHHJhG
\na=fingerprint:sha-256 EA:0A:76:81:EA:D7:A0:C3:A0:40:1D:EF:F6:5D:EB:82:42:DE:45:54:B3:49:71:F8:EF:70:11:70:33:68:E6:DC
\na=setup:actpass
\na=mid:audio
\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
\na=sendrecv
\na=rtcp-mux
\na=rtpmap:111 opus/48000/2
\na=rtcp-fb:111 transport-cc
\na=fmtp:111 minptime=10;useinbandfec=1
\na=rtpmap:103 ISAC/16000
\na=rtpmap:104 ISAC/32000
\na=r
2016-11-08 17:44:01.992702 DemoSun[7631:1684676] [SKW/Rcv]{
    dst = WEjC8T1TGkiFUmbu;
    payload =     {
        browser = Chrome;
        connectionId = "mc_KTktpm2UnEHceD0s";
        sdp =         {
            sdp = "v=0
\no=- 3474084029046932167 2 IN IP4 127.0.0.1
\ns=-
\nt=0 0
\na=group:BUNDLE audio video
\na=msid-semantic: WMS 2obmJ9H1lB2aDJCDuZTSUJHemQJRZGW23Pd9
\nm=audio 9 UDP/TLS/RTP/SAVPF 103 111 104 9 0 8 106 105 13 126
\nc=IN IP4 0.0.0.0
\na=rtcp:9 IN IP4 0.0.0.0
\na=ice-ufrag:iRsS
\na=ice-pwd:PWhyHpthOim0S/NxOynMgb8L
\na=fingerprint:sha-256 28:37:FE:B3:77:BC:63:79:65:D5:74:B3:DE:A7:BE:3C:2E:63:C2:51:CB:03:96:24:A4:F2:8B:25:47:87:46:E1
\na=setup:active
\na=mid:audio
\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
\na=sendrecv
\na=rtcp-mux
\na=rtpmap:103 ISAC/16000
\na=rtpmap:111 opus/48000/2
\na=rtcp-fb:111 transport-cc
\na=fmtp:111 minptime=10;useinbandfec=1
\na=rtpmap:104 ISAC/32000
\na=rtpmap:9 G722/8000
\na=rtpmap:0 PCMU/8000
\na=rtpmap:8 PCMA/8000
\na=rtpmap:106 CN/
SKW_MEDIACONNECTION_EVENT_STREAM
2016-11-08 17:44:02.959563 DemoSun[7631:1684676] [SKW/Rcv]{
    dst = WEjC8T1TGkiFUmbu;
    payload =     {
        candidate =         {
            candidate = "candidate:2011871526 1 udp 2122260223 192.168.44.169 64431 typ host generation 0 ufrag iRsS network-id 1";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    src = wFBBQHmwQXo0UgVR;
    type = CANDIDATE;
}
2016-11-08 17:44:03.012133 DemoSun[7631:1684676] [SKW/Rcv]{
    dst = WEjC8T1TGkiFUmbu;
    payload =     {
        candidate =         {
            candidate = "candidate:963200470 1 tcp 1518280447 192.168.44.169 9 typ host tcptype active generation 0 ufrag iRsS network-id 1";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    src = wFBBQHmwQXo0UgVR;
    type = CANDIDATE;
}
2016-11-08 17:44:03.066232 DemoSun[7631:1684676] [SKW/Rcv]{
    dst = WEjC8T1TGkiFUmbu;
    payload =     {
        candidate =         {
            candidate = "candidate:3144124085 1 udp 1686052607 114.136.64.213 6547 typ srflx raddr 192.168.44.169 rport 64431 generation 0 ufrag iRsS network-id 1";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    src = wFBBQHmwQXo0UgVR;
    type = CANDIDATE;
}
2016-11-08 17:44:03.122030 DemoSun[7631:1684676] [SKW/Rcv]{
    dst = WEjC8T1TGkiFUmbu;
    payload =     {
        candidate =         {
            candidate = "candidate:3433799847 1 udp 41885439 66.228.45.110 57347 typ relay raddr 114.136.64.213 rport 6547 generation 0 ufrag iRsS network-id 1";
            sdpMLineIndex = 0;
            sdpMid = audio;
        };
        connectionId = "mc_KTktpm2UnEHceD0s";
        type = media;
    };
    src = wFBBQHmwQXo0UgVR;
    type = CANDIDATE;
}
MEDIACONNECTION_EVENT_ERROR
error Optional(Network message=ICE connection failed. syserr=)

Besides, above logs also show that both SDPs of OFFER and ANSWER truncated without the proper ending. Is it only for logging effects?

Thanks a bunch in advance.

Cheers, Richard