有没有办法我们可以拨打两个号码并让他们加入会议 [英] Is there a way we can dial two numbers and make them join a conference
问题描述
我是 Twilio 的新手.是否可以使用 Twilio-PHP 拨打两个电话号码并将他们加入会议?我知道我们可以将两个已接电话加入会议,我想知道我们是否可以对两个已拨电话进行同样的操作.如果是,如果有人向我推荐文档的那部分,我将不胜感激.
提前致谢.
I am new to Twilio. Is it possible to make calls to two phone numbers and join them into a conference using Twilio-PHP? I know we can join two received calls into a conference, I'm wondering if we can do the same with two dialed calls. If yes , I would be grateful if someone refers me to that part of documentation.
Thanks in Advance.
推荐答案
Twilio 开发人员布道者在这里.
Twilio developer evangelist here.
你绝对可以做到.当您从 Twilio 内发起呼叫时,您会传递三个参数:您呼叫的号码、您呼叫的号码和 URL.该 URL 应该指向某个 TwiML,您可以像接到电话一样使用它.当出站呼叫得到应答时,Twilio 就会查看 URL 以了解如何处理呼叫.
You absolutely can do that. When you initiate a call from within Twilio you pass three arguments, the number you're calling from, the number you're calling and a URL. That URL should point to some TwiML and you can use it much in the same way you would when you receive a call. When the outbound call is answered that's when Twilio looks at the URL to find out what to do with the call.
因此,这里有一个示例,假设您需要 Twilio PHP 库并设置相关变量:
So, here's an example, assuming you've required the Twilio PHP library and set up the relevant variables:
// Make an API client
$client = new Services_Twilio($sid, $token, $version);
// Use the API client to create an outbound call
$call = $client->account->calls->create(
$to,
$from,
'http://example.com/conference.php'
);
然后,在您的 URL 中,在本例中为 example.com/conference,您只需要返回一些 TwiML 即可输入被呼叫加入会议的人员.所以,你需要一个看起来像这样的 Conference.php 文件:
Then, at your URL, in this case example.com/conference, you just need to return some TwiML to enter the people being called into the conference. So, you'd need a conference.php file that looked a bit like this:
<?php
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
<Dial>
<Conference>YOUR_CONFERENCE_ID</Conference>
</Dial>
</Response>
让我知道这是否有帮助.
Let me know if that helps at all.
这篇关于有没有办法我们可以拨打两个号码并让他们加入会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!