无法推送通话统计信息,状态代码:403 |错误TCMetricsPublisher |特威里奥 [英] Failed to push call stats, status code: 403 | ERROR TCMetricsPublisher | Twilio

查看:110
本文介绍了无法推送通话统计信息,状态代码:403 |错误TCMetricsPublisher |特威里奥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在集成voip,因此也集成了 twilio .我还成功在 heroku 上设置了服务器代码.我成功创建了令牌,并获得了处理程序上的回调.当我在设备上运行应用程序时,则在委托中进行回调

I am integrating the voip, thus integrated twilio. I also setup the server code on heroku successfully. I create the token successfully, and getting the callback on handler as well. When I run the application on device, then callback in delegate comes

Device: <TCPresenceEvent 0x17de3840 name=jenny, available=YES> didReceivePresenceUpdate

一段时间后,发生以下错误:

After some time, below error occurred:

[ERROR TCMetricsPublisher]无法推送呼叫统计信息,状态代码:403

[ERROR TCMetricsPublisher] Failed to push call stats, status code: 403

代表回调:

  • 我在connectionDidConnect
  • 中获得了回调
  • 一段时间后,我自动在connectionDidDisconnect中获得了回调.
  • I got the callback in connectionDidConnect
  • After some time, I got the callback in connectionDidDisconnect automatically.

我的代码:

TCDevice* _phone;
TCConnection* _connection;
 NSString *urlString = [NSString stringWithFormat:@"https://tatoll.herokuapp.com/token?client=%@", name];
    NSURL *url = [NSURL URLWithString:urlString];
    NSError *error = nil;
    NSString *token = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
    if (token == nil) {
        NSLog(@"Error retrieving token: %@", [error localizedDescription]);
    } else {
        _phone = [[TCDevice alloc] initWithCapabilityToken:token delegate:self];
    }

NSDictionary *params = @{@"To": self.numberField.text};
_connection = [_phone connect:params delegate:self];

推荐答案

接收status code: 403,通常表明您提供了错误的凭据.就是说,您的帐户SID和Auth令牌未提供,或者您提供了错误的密码.

Receiving status code: 403, usually suggests that you are providing the wrong credentials. Meaning, your account SID and Auth Token are either not supplied or you supplied the wrong ones.

您可能需要验证自己是否正确传递了功能令牌 .设置功能令牌时,需要使用capability.allow_client_outgoing(application_sid)启用拨出呼叫.

You may want to validate that you are passing capability tokens properly. When you setup your capability token you need to use capability.allow_client_outgoing(application_sid) to enable outgoing calls.

from twilio.util import TwilioCapability

account_sid = "ACXXXXXXXXXXXXXXX"
auth_token = "secret"
application_sid = "AP123123"

capability = TwilioCapability(account_sid, auth_token)
capability.allow_client_incoming("tommy")
capability.allow_client_outgoing(application_sid)
print capability.generate()

如果您发现前者设置正确,则有些人也遇到了此问题,因为他们实际上没有转接呼叫.

If you find the former is set up correctly, some people have also run into this issue because they are not actually forwarding the call.

您可能听说过:

欢迎来到特威里奥"

然后挂断电话.这是因为您的 TwiML应用是按照这种方式配置的.如果您想将呼叫转移到另一个号码.您必须为呼叫转移配置Twilio,如下所示:

And then the call hangup. This is because your TwiML app is configured that way. If you would like to forward your call to another number. You have to configure your Twilio for call forwarding, like so:

<Response><Dial callerId='[replace with Twilio number]'>+86xxxxxxxxxxxxxx</Dial></Response>

这篇关于无法推送通话统计信息,状态代码:403 |错误TCMetricsPublisher |特威里奥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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