gpt4 book ai didi

javascript - Stanza.io 无法创建 WebRTC 答案

转载 作者:行者123 更新时间:2023-12-03 02:53:43 25 4
gpt4 key购买 nike

我正在使用 ejabberd + stanza.io 制作一个实时消息网站,一切都很顺利。现在我愿意使用 jingle 协议(protocol)来实现 Webrtc 音频/视频。这是我用来连接的 JS 代码:

var client = XMPP.createClient({
jid: xmpp_user+'@'+XMPP_DOMAIN,
password: cu.auth.user_password,
transport: 'websocket',
wsURL: "ws://"+xms+":5280/websocket/"
});


client.jingle.config.debug = true;


client.on('session:started', function () {
client.enableCarbons();
client.getRoster(function (err, resp) {
client.updateCaps();
client.sendPresence({
caps: client.disco.caps
});
});
});

client.connect();

问题是当我从其他应用程序(AstraChat:支持 Jingle 的 iOS 应用程序)调用用户时,我在浏览器日志中收到此消息:

Jingle: 67bzrsog243: session-initiate undefined undefined
Jingle: 67bzrsog243: Could not create WebRTC answer undefined undefined

这是 astrachat 发送的 xml:

<iq xmlns='jabber:client' xml:lang='en' to='c4ca4238a0b923820dcc509a6f75849b@h2745110.stratoserver.net/352555070032013318140962' from='med@h2745110.stratoserver.net/AstraChat-iOS-21820150' type='get' id='3e8kjajc22'><query xmlns='http://jabber.org/protocol/disco#info'/></iq>
<r xmlns='urn:xmpp:sm:3'/>
<a h='1' xmlns='urn:xmpp:sm:3'/>
<a h='2' xmlns='urn:xmpp:sm:3'/>
jingle:created
iq:set:jingle
<iq xmlns='jabber:client' xml:lang='en' to='c4ca4238a0b923820dcc509a6f75849b@h2745110.stratoserver.net/352555070032013318140962' from='med@h2745110.stratoserver.net/AstraChat-iOS-21820150' type='set' id='3e8kjajc23'><jingle xmlns='urn:xmpp:jingle:1' action='session-initiate' initiator='med@h2745110.stratoserver.net/AstraChat-iOS-21820150' responder='c4ca4238a0b923820dcc509a6f75849b@h2745110.stratoserver.net/352555070032013318140962' sid='3e8kjajc24'><content creator='initiator' name='voice'><description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'><payload-type id='101' name='speex' clockrate='8000'/></description><transport xmlns='urn:xmpp:jingle:transports:ice-udp:1' pwd='TC5NsD6IEQGXeDO8d5/3OU' ufrag='yA0z'/></content></jingle></iq>
<r xmlns='urn:xmpp:sm:3'/>
Jingle: 3e8kjajc24: session-initiate undefined undefined
Could not create WebRTC answer undefined undefined

我真的不知道如何解决这个问题,任何帮助将不胜感激。

最佳答案

根据您的日志,Astra 聊天的 session 启动是这样的:
<iq xmlns="jabber:client" xml:lang="en" to="c4ca4238a0b923820dcc509a6f75849b@h2745110.stratoserver.net/352555070032013318140962" from="med@h2745110.stratoserver.net/AstraChat-iOS-21820150" type="set" id="3e8kjajc23">
<jingle xmlns="urn:xmpp:jingle:1" action="session-initiate" initiator="med@h2745110.stratoserver.net/AstraChat-iOS-21820150" responder="c4ca4238a0b923820dcc509a6f75849b@h2745110.stratoserver.net/352555070032013318140962" sid="3e8kjajc24">
<content creator="initiator" name="voice">
<description xmlns="urn:xmpp:jingle:apps:rtp:1" media="audio">
<payload-type id="101" name="speex" clockrate="8000" />
</description>
<transport xmlns="urn:xmpp:jingle:transports:ice-udp:1" pwd="TC5NsD6IEQGXeDO8d5/3OU" ufrag="yA0z" />
</content>
</jingle>
</iq>
它仅提供 WebRTC 不支持的 speex 音频编解码器(必须使用 opus 或 G.711)。 WebRTC 中也没有强制加密。

关于javascript - Stanza.io 无法创建 WebRTC 答案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47727407/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com