Licode 信令 流程


Step 1:

获取erizoController 地址

 send:https://192.168.12.66:3004/createToken

response:“eyJ0b2tlbklkIjoiNWFiZGYyYmMzNjNhNzhhZmYwNzhiYTZiIiwiaG9zdCI6IjE5Mi4xNjguMTIuNjY6ODA4MCIsInNlY3VyZSI6dHJ1ZSwic2lnbmF0dXJlIjoiTkdVMk9UUmpaRGN5WkRRelpHVmpaV1ZrTjJNMk5EazVZVGxrWldObFpHRm1NV1kyTkdJMk1RPT0ifQ”

response decode base64:

{

"tokenId": "5abdf2bc363a78aff078ba6b",
"host": "192.168.12.66:8080",
"secure": true,
"signature": "NGU2OTRjZDcyZDQzZGVjZWVkN2M2NDk5YTlkZWNlZGFmMWY2NGI2MQ=="

}



Step 2:

socket io websocket 连接 erizoController

send:wss://192.168.12.66:8080/socket.io/?EIO=3&transport=websocket

response:

 {
"sid": "4Os7dPGrLBnAQyt2AAAD",
"upgrades": [],
"pingInterval": 25000,
"pingTimeout": 60000

}

Step 3:

token 信令

send:

["token", {

"token": {
"tokenId": "5abdf2bc363a78aff078ba6b",
"host": "192.168.12.66:8080",
"secure": true,
"signature": "NGU2OTRjZDcyZDQzZGVjZWVkN2M2NDk5YTlkZWNlZGFmMWY2NGI2MQ=="
}

}]

response:

["success", {

"streams": [{
"id": 753611867562769000,
"audio": true,
"video": true,
"data": true
}],
"id": "5ab079507835672cf4ed06da",
"clientId": "f2483098-8d8f-46e2-a672-70c6d5843454",
"defaultVideoBW": 300,
"maxVideoBW": 300,
"iceServers": [{
"url": "stun:stun.l.google.com:19302"
}]

}]

Step 4:

publish video

send:

["publish", {

"state": "erizo",
"data": true,
"audio": true,
"video": true,
"muteStream": {
"audio": false,
"video": false
},
"minVideoBW": 0

}, null]

reponse:

[677634450258777100, "9f564e51-1518-64bb-9485-d4db31dcfe51"]


Step5:

offer sdp

send:

["signaling_message", {
"streamId": 677634450258777100,
"msg": {
"type": "offer",
"sdp": "v=0\r\no=- 1734783120549652248 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=msid-semantic: WMS dOfVFdeW3cw2b22WFwi0QJbokesTvN6yr2gZ\r\na=group:BUNDLE audio video\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtpmap:111 opus/48000/2\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:112 telephone-event/32000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=rtcp-fb:111 transport-cc\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=setup:actpass\r\na=mid:audio\r\na=sendonly\r\na=ice-ufrag:gQiL\r\na=ice-pwd:7SDb/bg7PASqt1DsTv9AowhI\r\na=fingerprint:sha-256 CC:7C:CE:C8:21:F1:A4:80:E0:7B:EE:5C:34:10:7F:75:67:AA:EC:A3:14:20:61:84:0C:60:6E:50:97:5D:E4:9A\r\na=ice-options:trickle\r\na=ssrc:4130258507 cname:e6ZH8b3D3nJ6NgRv\r\na=ssrc:4130258507 msid:dOfVFdeW3cw2b22WFwi0QJbokesTvN6yr2gZ 3dfe2bc1-4483-4dc3-967c-8b41625e0a34\r\na=ssrc:4130258507 mslabel:dOfVFdeW3cw2b22WFwi0QJbokesTvN6yr2gZ\r\na=ssrc:4130258507 label:3dfe2bc1-4483-4dc3-967c-8b41625e0a34\r\na=rtcp-mux\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 124 127 123 125 107 108\r\nc=IN IP4 0.0.0.0\r\nb=AS:300\r\na=rtpmap:96 VP8/90000\r\na=rtpmap:97 rtx/90000\r\na=rtpmap:98 VP9/90000\r\na=rtpmap:99 rtx/90000\r\na=rtpmap:100 H264/90000\r\na=rtpmap:101 rtx/90000\r\na=rtpmap:102 H264/90000\r\na=rtpmap:124 rtx/90000\r\na=rtpmap:127 H264/90000\r\na=rtpmap:123 rtx/90000\r\na=rtpmap:125 red/90000\r\na=rtpmap:107 rtx/90000\r\na=rtpmap:108 ulpfec/90000\r\na=fmtp:97 apt=96\r\na=fmtp:99 apt=98\r\na=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f\r\na=fmtp:101 apt=100\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=fmtp:124 apt=102\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=fmtp:123 apt=127\r\na=fmtp:107 apt=125\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 transport-cc\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 transport-cc\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=setup:actpass\r\na=mid:video\r\na=sendonly\r\na=ice-ufrag:gQiL\r\na=ice-pwd:7SDb/bg7PASqt1DsTv9AowhI\r\na=fingerprint:sha-256 CC:7C:CE:C8:21:F1:A4:80:E0:7B:EE:5C:34:10:7F:75:67:AA:EC:A3:14:20:61:84:0C:60:6E:50:97:5D:E4:9A\r\na=ice-options:trickle\r\na=ssrc:470786839 cname:e6ZH8b3D3nJ6NgRv\r\na=ssrc:470786839 msid:dOfVFdeW3cw2b22WFwi0QJbokesTvN6yr2gZ 4eb1b658-2bdd-4671-8798-ce21a9d970d5\r\na=ssrc:470786839 mslabel:dOfVFdeW3cw2b22WFwi0QJbokesTvN6yr2gZ\r\na=ssrc:470786839 label:4eb1b658-2bdd-4671-8798-ce21a9d970d5\r\na=ssrc:810666647 cname:e6ZH8b3D3nJ6NgRv\r\na=ssrc:810666647 msid:dOfVFdeW3cw2b22WFwi0QJbokesTvN6yr2gZ 4eb1b658-2bdd-4671-8798-ce21a9d970d5\r\na=ssrc:810666647 mslabel:dOfVFdeW3cw2b22WFwi0QJbokesTvN6yr2gZ\r\na=ssrc:810666647 label:4eb1b658-2bdd-4671-8798-ce21a9d970d5\r\na=ssrc-group:FID 470786839 810666647\r\na=rtcp-mux\r\n"
},
"browser": "chrome-stable"

}, null]

response:

["signaling_message_erizo", {
"mess": {
"type": "answer",
"sdp": "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=LicodeMCU\r\nt=0 0\r\na=msid-semantic: WMS dokS9W9OyX\r\na=group:BUNDLE audio video\r\nm=audio 1 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=rtpmap:111 opus/48000/2\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=setup:active\r\na=mid:audio\r\na=recvonly\r\na=ice-ufrag:wwY8\r\na=ice-pwd:fqZgXGVt1z4rAm0Car+f3M\r\na=fingerprint:sha-256 B3:91:2C:E3:3D:66:29:D4:3A:F4:CD:97:12:22:B2:D1:49:91:83:C1:F0:72:10:35:40:A8:0C:F9:2C:D4:AB:5D\r\na=candidate:1 1 udp 2013266431 192.168.12.66 47570 typ host generation 0\r\na=end-of-candidates\r\na=rtcp-mux\r\nm=video 1 UDP/TLS/RTP/SAVPF 102\r\nc=IN IP4 0.0.0.0\r\na=rtpmap:102 H264/90000/646276160\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=rtcp-fb:102 goog-remb\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=setup:active\r\na=mid:video\r\na=recvonly\r\na=ice-ufrag:wwY8\r\na=ice-pwd:fqZgXGVt1z4rAm0Car+f3M\r\na=fingerprint:sha-256 B3:91:2C:E3:3D:66:29:D4:3A:F4:CD:97:12:22:B2:D1:49:91:83:C1:F0:72:10:35:40:A8:0C:F9:2C:D4:AB:5D\r\na=candidate:1 1 udp 2013266431 192.168.12.66 47570 typ host generation 0\r\na=end-of-candidates\r\na=rtcp-mux\r\n"
},
"streamId": 677634450258777100

}]


Step 6:

send candidate

send:

["signaling_message", {

"streamId": 677634450258777100,
"msg": {
"type": "candidate",
"candidate": {
"sdpMLineIndex": 0,
"sdpMid": "audio",
"candidate": "a=candidate:2067836411 1 udp 2122260223 192.168.238.1 59974 typ host generation 0 ufrag gQiL network-id 1"
}
},
"browser": "chrome-stable"
}, null]


Step 7:

订阅流

send:

["subscribe", {
"streamId": 677634450258777100,
"audio": true,
"video": true,
"data": true,
"browser": "chrome-stable",
"muteStream": {
"audio": false,
"video": false
}

}, null]

response:

[true, "9f564e51-1518-64bb-9485-d4db31dcfe51"]


Events:

["onAddStream",{"id":677634450258777100,"audio":true,"video":true,"data":true}]



以上信令,可以实现简单的视频会议,更为复杂的信令和功能暂未考虑


你可能感兴趣的:(Licode 信令 流程)