Dan*_*bio 2 php twilio symfony
在 PHP 中连接呼叫时,有没有办法获取会议 SID?
$twilio->account->calls->create(
$from,
to,
$twimlURL
);
Run Code Online (Sandbox Code Playgroud)
执行此调用操作后,我无法获取会议 ID?或者可能在 Twiml 上设置会议 SID。这可能吗?
Twilio 开发人员布道者在这里。
当您像这样通过 REST API 创建呼叫时,它尚未与会议关联。我假设$twimlURL您发送返回, <Dial><Conference>some conference name</Conference></Dial>并且这是呼叫与会议相关联的时间。
您可以通过使用 REST API 列出会议并按FriendlyName(您在 TwiML 中使用的名称)和状态过滤in-progress来获取会议 SID 。像这样:
use Twilio\Rest\Client;
$sid = "your_account_sid";
$token = "your_auth_token";
$client = new Client($sid, $token);
$conferences = $client->conferences->read(
array("status" => "in-progress", "friendlyName" => "MyRoom")
);
foreach ($conferences as $conference) {
echo $conference->sid;
}
Run Code Online (Sandbox Code Playgroud)
让我知道这是否有帮助。