EricssonResearch / openwebrtc-ios-sdk

SDK for adding OpenWebRTC to your iOS apps using CocoaPods
BSD 2-Clause "Simplified" License
69 stars 37 forks source link

current sdp with rfc 5245 #66

Open xelven opened 8 years ago

xelven commented 8 years ago

as the RFC 5245 say:

2.  It chooses its server reflexive candidate as the default
   candidate, and encodes it into the m and c lines.  The resulting
   offer (message 5) looks like (lines folded for clarity):

       v=0
       o=jdoe 2890844526 2890842807 IN IP4 $L-PRIV-1.IP
       s=
       c=IN IP4 $NAT-PUB-1.IP
       t=0 0
       a=ice-pwd:asd88fgpdd777uzjYhagZg
       a=ice-ufrag:8hhY
       m=audio $NAT-PUB-1.PORT RTP/AVP 0
       b=RS:0
       b=RR:0
       a=rtpmap:0 PCMU/8000
       a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ
       host
       a=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ
        srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT

and current sdp like this:

\no=- 1458619170473746400 1 IN IP4 127.0.0.1
\ns=-
\nt=0 0
\nm=audio 1 RTP/SAVPF 111 8 0
\nc=IN IP4 0.0.0.0
\na=rtcp-mux
\na=sendrecv
\na=rtpmap:111 OPUS/48000/2
\na=rtpmap:8 PCMA/8000
\na=rtpmap:0 PCMU/8000
\na=ice-ufrag:SgFM
\na=ice-pwd:7EsuaujbJzFNx/h1tRW5YM
\na=candidate:1 1 UDP 2013266431 192.168.31.235 42216 typ host
\na=candidate:4 1 UDP 1677722111 220.130.33.227 42216 typ srflx raddr 192.168.31.235 rport 42216
\na=candidate:7 1 UDP 167772671 54.178.56.14 50333 typ relay raddr 192.168.31.235 rport 42216
\na=candidate:7 1 UDP 167772671 54.178.56.14 55461 typ relay raddr 192.168.31.235 rport 42216
\na=candidate:7 1 UDP 167772671 54.178.56.14 65192 typ relay raddr 192.168.31.235 rport 0
\na=candidate:7 1 UDP 167772671 54.178.56.14 60853 typ relay raddr 192.168.31.235 rport 0
\na=fingerprint:sha-256 58:20:9C:0D:3F:2F:39:73:F4:6E:1E:8D:D7:56:B5:C0:61:90:31:53:A5:F0:A2:E6:5A:82:F4:31:72:87:6F:81
\na=setup:actpass
\n";
        type = offer;
    };

These rules imply that setting the IP address in the c line to 0.0.0.0 will cause an ICE restart.