Twilio视频 - “无法连接到错误的房间:SIP错误403” [英] Twilio Video - “Failed to connect to room with error: SIP error 403”

查看:374
本文介绍了Twilio视频 - “无法连接到错误的房间:SIP错误403”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误无法连接到有错误的房间:SIP错误403,当我尝试从一个iOS客户端拨打电话到另一个时使用twilio 视频sdk for swift。

I get this error "Failed to connect to room with error: SIP error 403", when I try to make a call from one iOS client to another while using twilio video sdk for swift.

当我使用手动生成的twilio访问令牌(从Twilio控制台获取)并将其插入时,我可以拨打电话(Xcode到移动设备和移动设备到移动设备)客户端应用程序。但是,当我尝试使用Twilio提供的以下服务器代码通过NodeJS服务器以编程方式从Twilio获取令牌时,我收到了上述错误。即使使用安全连接(HTTPS)从Twilio获取令牌,该错误仍然存​​在。

I am able to make a call (Xcode to mobile & mobile to mobile) when I use manually generated twilio access tokens (obtained from Twilio console) and insert them in the client app. However, I get the above error when I try to get the token programatically from Twilio via NodeJS server using the below server code provided by Twilio. The error persists even when using secure connection (HTTPS) to obtain the token from Twilio.

以下是来自Xcode的日志,

The below is the log from Xcode,

2017-01-13 07:30:47.625 VideoCall[39299:25726155] Attempting to connect to room Optional("testRoom")
2017-01-13 07:30:47.625 VideoCall[39299:25726155] provider:didActivateAudioSession:
2017-01-13 07:30:51.255 VideoCall[39299:25726155] Failed to connect to room with error: SIP error 403
2017-01-13 07:30:51.272 VideoCall[39299:25726155] provider:didDeactivateAudioSession:
2017-01-13 07:32:52.168 VideoCall[39299:25729470] ERROR:TwilioVideo:[Signaling]:RESIP::TRANSPORT: Got TLS read ret=0 error=6 error:00000006:invalid library (0):OPENSSL_internal:public key routines

NodeJS服务器代码(由Twilio提供)

NodeJS server code (provided by Twilio)

var express     = require('express');
var router      = express.Router();
var AccessToken = require('twilio').AccessToken;

// Substitute your Twilio AccountSid and ApiKey details
var ACCOUNT_SID = 'accountSid';
var API_KEY_SID = 'apiKeySid';
var API_KEY_SECRET = 'apiKeySecret';
var TWILIO_CONFIGURATION_SID = 'twilioConfigurationSid';

router.get('/getTwilioVideoAccessToken', function(req, res, next) {
    // Create an Access Token
    var accessToken = new AccessToken(
      ACCOUNT_SID,
      API_KEY_SID,
      API_KEY_SECRET
    );

      var identity = 'example-user'; 

    // Set the Identity of this token
    accessToken.identity = identity;

    // Grant access to Conversations
    var grant = new AccessToken.ConversationGrant();
    grant.configurationProfileSid = TWILIO_CONFIGURATION_SID;
    accessToken.addGrant(grant);

    // Serialize the token as a JWT
    var jwt = accessToken.toJwt();
    console.log(jwt);
    res.json({"token": jwt, "statusCode" : 200, "identity":identity})
});

解决方案:

Twilio客户支持表示我使用了错误的API_KEY_SECRET,这导致了错误,@ Aubtin Samai也指出了这一点。
可以按照此处提供的说明生成API_KEY_SECRET。

Twilio customer support had suggested that I was using an incorrect API_KEY_SECRET, which was causing the error, as also pointed out by @Aubtin Samai. One can generate the API_KEY_SECRET by following the instructions provided here.

推荐答案

如果我认为这些值不是真实值的占位符(这是403错误),那么您需要将API凭据添加到NodeJS脚本中。 ..

If I'm correct in assuming these values are not placeholders for the real ones (it's a 403 error), you need to add your API credentials to your NodeJS script...

var ACCOUNT_SID = 'accountSid';
var API_KEY_SID = 'apiKeySid';
var API_KEY_SECRET = 'apiKeySecret';
var TWILIO_CONFIGURATION_SID = 'twilioConfigurationSid';

这篇关于Twilio视频 - “无法连接到错误的房间:SIP错误403”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆