【发布时间】:2017-12-29 14:42:32
【问题描述】:
我正在尝试在 twilio 上使用客户端上传并尝试购买 twilio 号码。
另外,我需要获取动态语音 URL 才能动态录制电话会议。
<?php
require_once 'vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;
// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "*********************";
$token = "*******************";
$client = new Client($sid, $token);
$numbers = $client->availablePhoneNumbers('US')->local->read(
array("areaCode" => "424")
);
$twilioNumber = $numbers[0]->phoneNumber;
$newNumber = $client->incomingPhoneNumbers->create(
[
"voiceUrl" => "host url",
"voiceMethod" => "GET"
]
);
if ($newNumber) {
return $twilioNumber;
} else {
return 0;
}
// 在 voiceUrl 参数中,我传递了一个电话会议连接代码托管链接,但它没有动态更新到 twilio 帐户。
【问题讨论】:
-
欢迎来到 SO,你能给我们提供更多关于什么不起作用的信息吗?见stackoverflow.com/help/how-to-ask
标签: php twilio-api twilio-php