简体   繁体   English

Chrome / Android Jingle-SDP ICE连接失败

[英]Chrome / Android Jingle-SDP ICE connection failure

I am working on developing an application for Android devices that allows voice / video calling to other WebRTC enabled devices connected to an XMPP server. 我正在为Android设备开发一个应用程序,该应用程序允许与连接到XMPP服务器的其他启用WebRTC的设备进行语音/视频通话。 I have already been successful in getting the application to voice / video chat between Android devices, and now I am working on extending that capability to WebRTC enabled browsers. 我已经成功地使应用程序在Android设备之间进行语音/视频聊天,现在我正在将该功能扩展到支持WebRTC的浏览器。 I have successfully had browser to browser voice / video calling, however that system works on the SDP protocol, and the Android application I have built works on the Jingle protocol. 我已经成功拥有浏览器到浏览器的语音/视频通话功能,但是该系统可在SDP协议上运行,而我构建的Android应用程序可在Jingle协议上运行。 I know that I can rewrite the Android application to work on the SDP protocol, as that has been done before. 我知道我可以重写Android应用程序以使用SDP协议,就像以前所做的那样。 However, I would like to continue using the Jingle protocol on the Android devices, as the application I have built has developed many features / capabilities that are heavily dependent on the Jingle based code within LibJingle. 但是,我想继续在Android设备上使用Jingle协议,因为我构建的应用程序开发了许多功能,这些功能在很大程度上取决于LibJingle中基于Jingle的代码。

Building off of SDP / Jingle translators that have already been done (the Phono library specifically) I currently have a browser client and an Android device negotiating the media aspects of the voice / video call successfully. 基于已经完成的SDP / Jingle转换器(特别是Phono库 )的构建,我目前拥有一个浏览器客户端和一个Android设备,可以成功地协商语音/视频通话的媒体方面。 However, things seem to be failing while one side tries to connect to the other. 但是,当一侧尝试连接到另一侧时,事情似乎失败了。 Part of me believes that the failure lies with the ICE / JINGLE translations. 我的一部分认为,失败的原因在于ICE / JINGLE的翻译。 I have noticed that the ice candidates passed to the browser, via "onicecandidate", do not contain any username and password information. 我注意到,通过“ onicecandidate”传递给浏览器的ice候选人不包含任何用户名和密码信息。 I have tried copying the username and password information in the original SDP offer, generated by the browser client, into each of the appropriate ice candidates (voice vs. video), but that has not yielded any success. 我尝试将浏览器客户端生成的原始SDP产品中的用户名和密码信息复制到每个适当的ice候选对象(语音与视频)中,但是并没有成功。 I have also tried just not including any username and password information in the transport stanza, but that too yielded nothing. 我还尝试过在传输节中不包括任何用户名和密码信息,但这也无济于事。

I ran wireshark on the browser side during the entire bit of communications, and I continued to see binding errors between the browser and the Android device until the Android device finally sent a "session-terminate" signal. 在整个通信过程中,我都是在浏览器端运行wireshark,然后继续看到浏览器与Android设备之间的绑定错误,直到Android设备最终发送“会话终止”信号。 Specifically, I am seeing the following: 具体来说,我看到以下内容:

STUN 158 Binding Request user: r8bGP7y5LklOOKEb:IjgBbKgXQe9V8Pur STUN 158绑定请求用户:r8bGP7y5LklOOKEb:IjgBbKgXQe9V8Pur

Stale Credentials user: r8bGP7y5LklOOKEb:IjgBbKgXQe9V8PurSTUN 130 Binding Error Response error-code: 274 ( Unknown error code ) 陈旧凭证用户:r8bGP7y5LklOOKEb:IjgBbKgXQe9V8PurSTUN 130绑定错误响应错误代码:274( 未知错误代码

Eventually the error response stops showing up, and then messages like the following start showing up: 最终,错误响应停止显示,然后出现如下所示的消息:

ICMP 186 Destination unreachable (Port unreachable) ICMP 186目标不可达(端口不可达)

I am still quite new to the ICE / transport part of the negotiations, so I am not sure if any of the wireshark logs were relevant, or if I am even diagnosing the problem correctly. 我对谈判的ICE /运输部分还很陌生,所以我不确定是否有任何Wireshk日志是否相关,或者我什至无法正确诊断问题。

Does anyone know what I might be doing wrong? 有人知道我可能做错了吗? Or have any experience getting the connection between an SDP based client and a Jingle based client working? 还是有任何使基于SDP的客户端和基于Jingle的客户端之间的连接有效的经验?

To clarify what I am doing in the ICE translations. 为了澄清我在ICE翻译中的工作。

SDP candidate: SDP候选人:

a=candidate:[foundation] [component-id] [transport type] [priority] [connection address] [port] [candidate type] [username] [password] [generation] a =候选:[基础] [组件ID] [传输类型] [优先级] [连接地址] [端口] [候选类型] [用户名] [密码] [世代]

Jingle candidate: 叮当候选人:

<candidate component="[comp]" name="[name]" address="[ip]" port="[port]" 
protocol="[proto]" username="[uname]" password="[pass]" preference="[pref]" 
generation="[gen]"/>

When going from Jingle to SDP, I use the following mapping: 从Jingle到SDP时,我使用以下映射:

foundation = randomly generated number
component-id = comp
transport type = udp
priority = pref * 10000
connection address = ip
port = port
candidate type = typ host
username = uname
password = pass
sdpMLineIndex = 0 if audio, 1 if video
sdpMid = audio / video 

When going from SDP to Jingle, I use the following mapping: 从SDP到丁当时,我使用以下映射:

comp = component-id
name = event.candidate.sdpMid (with the adjustment of rtp and rtcp based on 
       component value)
ip = connection address
port = port
proto = transport type
uname = varies from being empty to being the respective one generated in the
        original SDP media information
pass = varies from being empty to being the respective one generated in the
       original SDP media information
pref = 0.99
gen = 0

An example of the ICE candidates that I am getting in Chrome: 我在Chrome中获得的ICE候选人的示例:

a=candidate:3376904655 2 udp 2113937151 192.168.1.144 46794 typ host generation 0
a=candidate:1208975227 1 udp 1845501695 xxx.xxx.xxx.xxx 46794 typ srflx raddr 192.168.1.144 rport 46794 generation 0

An example of the ICE candidates that I am getting from Jingle: 我从Jingle获得的ICE候选人的示例:

<candidate name="video_rtp" address="xxx.xxx.xxx.xxx" port="37275" preference="0.99" username="4XqIQDW4n9lJrIOM" protocol="udp" generation="0" password="F0Vc9tWo4S2/VhleJ/BdNOId" type="local" network="wlan0"/>
<candidate name="video_rtp" address="xxx.xxx.xxx.xxx" port="54429" preference="0.86" username="0ftgSUZ0qRFXlMh5" protocol="udp" generation="0" password="lIyHJZuZt8L/wIZnnqfQfRED" type="stun" network="wlan0"/>

So, as it turns out, LibJingle isn't yet equipped to work with SDP / ICE conversions. 因此,事实证明,LibJingle尚不具备SDP / ICE转换功能。 Specifically, LibJingle does not currently support the XEP-0176-compliant version of ICE signaling . 具体而言, LibJingle当前不支持ICE信号的XEP-0176兼容版本 So, the only recourse was to redo the system to an SDP based system. 因此,唯一的办法就是将系统重做为基于SDP的系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM