2015-09-27 55 views
0

我正在从本地主机运行hello-world客户端示例。
Kurento媒体服务器安装在Amazon EC2实例上。所有TCP和UDP端口都打开。 对于kurento谷歌STUN服务器配置和公共IP从亚马逊分配给HttpEndPoint(公布IP) 我管理建立套接字连接和交换iceCandidates。Kurento在结果中返回空值

UPDATE STUN服务器在WebRtcEnpoint.conf.ini配置是这样的:stunServerAddress = stun.1.google.com stunServerPort = 19302

在这个STUN似乎做工精细这篇文章的时间。

最后两帧总是返回这样的:

{"id":26,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 

{"id":27,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 

所以该值始终为空。

这里是帧的交换的完整列表:

{"id":15,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.185 
{"id":16,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.185 
{"id":17,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.185 
{"id":18,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.210 
{"id":19,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.210 
{"id":20,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.210 
{"id":21,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.210 
{"id":22,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.210 
{"id":23,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.210 
{"id":24,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":"32d60f30-b7c6-4bba-a626-2af81356641d"}} 135 
13:20:50.211 
{"id":25,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":"v=0\r\no=- 3652338053 3652338053 IN IP4 0.0.0.0\r\ns=Kurento Media Server\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\na=msid-semantic: WMS GQCQVoS3xcQNmo4JJyGzwHIL1YzJ8QPZiQP3\r\na=group:BUNDLE audio video\r\nm=audio 1 RTP/SAVPF 111 0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=rtpmap:111 opus/48000/2\r\na=rtpmap:0 PCMU/8000\r\na=setup:active\r\na=mid:audio\r\na=sendrecv\r\na=rtcp-mux\r\na=fmtp:111 minptime=10; useinbandfec=1\r\na=maxptime:60\r\na=ssrc:142379529 cname:[email protected]ost-cb3eed9a\r\na=ice-ufrag:Rk14\r\na=ice-pwd:N8cBI2tYxNA96MBRt33lr/\r\na=fingerprint:sha-256 60:F6:3A:EB:47:7E:01:9C:B1:A8:7A:F2:4A:6A:98:A0:E9:1B:04:64:E9:76:04:AF:2F:19:96:FC:27:38:4D:B7\r\nm=video 1 RTP/SAVPF 100\r\nb=AS:500\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=rtpmap:100 VP8/90000\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=setup:active\r\na=mid:video\r\na=sendrecv\r\na=rtcp-mux\r\na=ssrc:3535835016 cname:[email protected]\r\na=ice-ufrag:Rk14\r\na=ice-pwd:N8cBI2tYxNA96MBRt33lr/\r\na=fingerprint:sha-256 60:F6:3A:EB:47:7E:01:9C:B1:A8:7A:F2:4A:6A:98:A0:E9:1B:04:64:E9:76:04:AF:2F:19:96:FC:27:38:4D:B7\r\n"}} 1389  
13:20:50.211 
{"jsonrpc":"2.0","method":"onEvent","params":{"value":{"data":{"candidate":{"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 1 UDP 2013266431 10.189.139.160 44044 typ host","sdpMLineIndex":0,"sdpMid":"audio"},"source":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","tags":[],"timestamp":"1443349253","type":"OnIceCandidate"},"object":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","type":"OnIceCandidate"}}} 581 
13:20:50.215 
{"jsonrpc":"2.0","method":"onEvent","params":{"value":{"data":{"candidate":{"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 1 UDP 2013266431 10.189.139.160 44044 typ host","sdpMLineIndex":1,"sdpMid":"video"},"source":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","tags":[],"timestamp":"1443349253","type":"OnIceCandidate"},"object":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","type":"OnIceCandidate"}}} 581 
13:20:50.215 
{"jsonrpc":"2.0","method":"onEvent","params":{"value":{"data":{"candidate":{"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 2 UDP 2013266430 10.189.139.160 46539 typ host","sdpMLineIndex":0,"sdpMid":"audio"},"source":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","tags":[],"timestamp":"1443349253","type":"OnIceCandidate"},"object":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","type":"OnIceCandidate"}}} 581 
13:20:50.215 
{"jsonrpc":"2.0","method":"onEvent","params":{"value":{"data":{"candidate":{"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 2 UDP 2013266430 10.189.139.160 46539 typ host","sdpMLineIndex":1,"sdpMid":"video"},"source":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","tags":[],"timestamp":"1443349253","type":"OnIceCandidate"},"object":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","type":"OnIceCandidate"}}} 581 
13:20:50.535 
{"id":26,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.535 
{"id":27,"jsonrpc":"2.0","result":{"sessionId":"4b9642c4-5d42-41e0-ba61-83698b85552f","value":null}} 101 
13:20:50.53 

回答

0

您的KMS不产生STUN的候选人,因为你可以从这个看到帧

13:20:50.211 
{"jsonrpc":"2.0","method":"onEvent","params":{"value":{"data":{"candidate":{"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 1 UDP 2013266431 10.189.139.160 44044 typ host","sdpMLineIndex":0,"sdpMid":"audio"},"source":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","tags":[],"timestamp":"1443349253","type":"OnIceCandidate"},"object":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","type":"OnIceCandidate"}}} 581 
13:20:50.215 
{"jsonrpc":"2.0","method":"onEvent","params":{"value":{"data":{"candidate":{"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 1 UDP 2013266431 10.189.139.160 44044 typ host","sdpMLineIndex":1,"sdpMid":"video"},"source":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","tags":[],"timestamp":"1443349253","type":"OnIceCandidate"},"object":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","type":"OnIceCandidate"}}} 581 
13:20:50.215 
{"jsonrpc":"2.0","method":"onEvent","params":{"value":{"data":{"candidate":{"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 2 UDP 2013266430 10.189.139.160 46539 typ host","sdpMLineIndex":0,"sdpMid":"audio"},"source":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","tags":[],"timestamp":"1443349253","type":"OnIceCandidate"},"object":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","type":"OnIceCandidate"}}} 581 
13:20:50.215 
{"jsonrpc":"2.0","method":"onEvent","params":{"value":{"data":{"candidate":{"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 2 UDP 2013266430 10.189.139.160 46539 typ host","sdpMLineIndex":1,"sdpMid":"video"},"source":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","tags":[],"timestamp":"1443349253","type":"OnIceCandidate"},"object":"a7d787c2-c252-47e5-b576-8923f69886a0_kurento.MediaPipeline/73f8d561-6349-4d1d-b2e6-9e2743e0c8d2_kurento.WebRtcEndpoint","type":"OnIceCandidate"}}} 581 

这意味着,无论你的STUN配置不正确,或者配置的STUN服务器不工作。您可以看看这个公共STUN服务器的这个list,并记住您只能在您的KMS配置中使用IP,因为libnice不接受CNAME。


旁注:HttpEndPoint配置没有在WebRTC功能


编辑1

在STUN的配置,这是不支持任何影响您正在使用的CNAME。请阅读this关于如何配置KMS以使用STUN/TURN的部分文档。它应该是这样的

stunServerAddress=173.194.66.127 
stunServerPort=19302 

确保您使用的服务器正在工作。您可能需要检查其中的几个。

+0

嗨@igracia和谢谢你的评论。我使用STUN配置编辑了我的问题,并遵循Kurento教程。 此服务器根据您引用的工具工作。谢谢。 –

+0

您的STUN配置不正确,因为只有IP可以使用。检查更新的答案,并按照文档链接查找更多信息 – igracia

+0

@OlegMezhv你有没有检查过?它解决了吗? – igracia