我在这里的死胡同,我已经搜索了API参考,谷歌和堆栈溢出,但找不到答案,我正在寻找。
我怎样才能改变什么stun服务器要使用在sipJS-0.19
在sipJS和JsSip的早期版本中,我可以这样做
var callOptions = {
mediaConstraints: {
audio: true,
video: true
},
pcConfig: {
iceServers: [
{ urls: ["stun:my.stun.server.com"] }
],
iceTransportPolicy: "all"
}
};
我在最新的sipJS上试过这个
sessionDescriptionHandlerOptions: {
constraints: { audio: true, video: false },
peerConnectionConfiguration: {
iceServers: [{
urls:"stun:my.stun.server.com"
}],
'iceTransportPolicy': "all"
}
}
});
这仍然显示在控制台中默认的眩晕。
iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all"
我尝试过将peerConnectionConfiguration改为rtcConfiguration
或者将其添加到userAgentOptions中,结果仍然相同。
发布于 2021-09-01 17:16:39
根据当前版本的sip.js (0.20.0),这可以通过UserAgentOptions.sessionDescriptionHandlerFactoryOptions.peerConnectionConfiguration
选项来实现。
这些选项的完整架构如下:
bundlePolicy: "balanced", // Note: max-bundle is not supported by the demo backend currently (5/15/17)
certificates: undefined,
iceCandidatePoolSize: 0,
iceServers: [{ urls: "stun:stun.l.google.com:19302" }], // TURN URL example: "turn:88.88.88.0:3478", "test", "test"
iceTransportPolicy: "all",
peerIdentity: undefined,
rtcpMuxPolicy: "require"
因此,要关闭UserAgent的冰服务器,只需添加
var agent = new UserAgent({
//... other options
sessionDescriptionHandlerFactoryOptions: {
iceGatheringTimeout: 500, //currently, the smallest allowed value
peerConnectionConfiguration: {
iceServers: []
}
}
});
要确认这一点,请获取“已建立”(Invitation.state)邀请对象(来自传入呼叫),然后查看sessionDescriptionHandler.sessionDescriptionHandlerConfiguration.peerConnectionConfiguration.iceServers
值,您将看到上面设置的空列表。
https://stackoverflow.com/questions/66578496
复制相似问题