gpt4 book ai didi

ios - 我正在尝试使用 Twilio sdk 进行调用,但我的调用在 2 或 3 秒后断开

转载 作者:行者123 更新时间:2023-11-29 12:00:41 24 4
gpt4 key购买 nike

我正在尝试使用 Twilio sdk 进行调用 但我的电话在 2 或 3 秒后就断开了。我的 Twilio 帐户已升级。我正在使用下面的代码

-(IBAction)mainButtonPressed:(id)sender
{
BasicPhoneAppDelegate* delegate = (BasicPhoneAppDelegate*)[UIApplication sharedApplication].delegate;
BasicPhone* basicPhone = delegate.phone;

if (!basicPhone.connection || basicPhone.connection.state == TCConnectionStateDisconnected)
{
NSString* strToNumber = self.textOutgoingDest.text;
if (strToNumber && ![strToNumber isEqualToString:@""]) {

switch (_eOutgoingType) {
case BPOutgoingNumber:
break;

case BPOutgoingClient:
strToNumber = [NSString stringWithFormat:@"client:%@", strToNumber];
break;

default:
break;
}

NSDictionary* dictParams = [NSDictionary dictionaryWithObjectsAndKeys:strToNumber, @"To", nil];
[self.phone connectWithParams:dictParams];
}
else {
[self.phone connectWithParams:nil];
}
}
else
{
[basicPhone disconnect];
}

[self syncMainButton];
}

最佳答案

我的问题已经解决了

-(IBAction)mainButtonPressed:(id)sender
{
BasicPhoneAppDelegate* delegate = (BasicPhoneAppDelegate*)[UIApplication sharedApplication].delegate;
BasicPhone* basicPhone = delegate.phone;

if (!basicPhone.connection || basicPhone.connection.state == TCConnectionStateDisconnected)
{
NSString* strToNumber = self.textOutgoingDest.text;
if (strToNumber && ![strToNumber isEqualToString:@""])
{
strToNumber = [NSString stringWithFormat:@"%@", strToNumber];
NSDictionary* dictParams = [NSDictionary dictionaryWithObjectsAndKeys:strToNumber, @"number", nil];
[self.phone connectWithParams:dictParams];
}
else
{
[self.phone connectWithParams:nil];
}
}
else
{
[basicPhone disconnect];
}

[self syncMainButton];
}

关于ios - 我正在尝试使用 Twilio sdk 进行调用,但我的调用在 2 或 3 秒后断开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37139899/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com