简体   繁体   English

使用Twilio iOS Client拨打电话

[英]Outgoing calls with Twilio iOS Client

I am using the Twilio API and can successfully make outgoing calls to a phone number, but when I try to enter another username to connect to, nothing happens. 我正在使用Twilio API并且可以成功拨打电话号码,但是当我尝试输入另一个用户名进行连接时,没有任何反应。 I have two emulators running (one with the Android quickstart client, with which I can make outgoing calls to another user. I can make calls from the Android client to the iOS client using usernames and it works fine, but when I try to do the same from the iOS client to the Android client, nothing happens. I don't get a crash or anything, I just get the initial sound that it tries to start, then the disconnect sound. Here is my code: 我有两个运行的模拟器(一个使用Android快速启动客户端,我可以通过它向另一个用户拨打电话。我可以使用用户名从Android客户端拨打到iOS客户端,它工作正常,但是当我尝试执行同样从iOS客户端到Android客户端,没有任何反应。我没有崩溃或任何事情,我只是得到它试图启动的初始声音,然后是断开声音。这是我的代码:

- (IBAction)dialButtonPressed:(id)sender {
    [self.dialField resignFirstResponder];
    NSDictionary *params = @{@"To": self.dialField.text};
    _connection = [_phone connect:params delegate:nil];
}

I have searched everywhere I can think of online, but every reference seems to talk only about calls with a phone number. 我已经搜遍了我能在网上想到的所有地方,但是每个参考文献似乎都只谈到有电话号码的电话。 The Twilio API for Android handles this easily, but I cannot figure it out for iOS. 适用于Android的Twilio API可以轻松处理这个问题,但我无法解决iOS问题。 Any suggestions would be greatly appreciated. 任何建议将不胜感激。

Thanks in advance!! 提前致谢!!

Much thanks to Zack from Twilio who finally noticed that we just needed to add client: before the username when trying to call a user rather than a phone number (When using the Heroku App for the server setup as instructed in the Quickstart tutorial). 非常感谢来自Twilio的Zack,他最终注意到我们只需要添加客户端:在用户名之前尝试呼叫用户而不是电话号码(当按照快速入门教程中的指示使用Heroku App进行服务器设置时)。 Not sure why this is not built into the iOS instructions, but it is to the Android version. 不知道为什么这不是内置在iOS指令中,而是它是Android版本。 I'm just glad to have something that works. 我很高兴有一些有用的东西。

I just have to dial client: then the username right into the dial field and it works. 我只需要拨打客户端:然后将用户名直接拨入拨号字段即可。 Now I can make any desired programming changes. 现在我可以进行任何所需的编程更改。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM