react-native - 在反应本机android中进行语音通话时出现错误“不支持WebRTC”
问题描述
我正在使用 react-native 中的“jssip.js”库创建语音通话。我已经使用来自 jssip 的 WebSocketInterface 为带宽帐户创建了套接字。并且还能够使用 JsSIP.UA 方法注册 sip 端点。但是在拨打电话时我收到错误为“WebRTC 不支持”。不知道为什么会这样。
let JsSIP= require('jssip');
let socket = new JsSIP.WebSocketInterface('wss://webrtc.registration.bandwidth.com:10443');
let configuration = {
sockets: [socket],
uri: 'sip:***@****.com',
password: '********'
};
let ua = new JsSIP.UA(configuration);
ua.start();
ua.on('unregistered', (call)=>{
console.log("client unregistered");
});
ua.on('progress', (call)=>{
console.log("progress");
});
ua.on('registered', (call)=>{
console.log("client registered");
}); //I have got this log
let eventHandlers = {
'progress': function (e) {
console.log('call is in progress');
},
'failed': function (e) {
console.log('call failed with cause: ');
}
};
let option = {
'eventHandlers': eventHandlers,
'mediaConstraints': {'audio': true, 'video': false},
'pcConfig': {rtcpMuxPolicy: 'negotiate'}
};
ua.call(toNumber, option);
解决方案
推荐阅读
- c++ - C++ - 分离头文件和实现文件
- javascript - TypeError : undefined 不是函数 Array.reduce
- python - pytest.mark.parametrize 似乎只能 xfail 预期的异常
- c - 无法制作 nLoader
- ms-access - Access 2013 DB 神秘更改为只读
- http - 通过 HTTP 中间件验证 WebSocket 连接 - Golang
- c - scanf整数的每个数字并将整数存储在C中
- scala - “值>>不是”编译错误的成员
- azure - 从 Azure 文件复制到 BLOB
- php - kahlan - 单元测试不起作用 - 获取 - 异常`代码(0),消息“未定义变量`请求`