Twilio - 如何拨打第三方号码并将他添加到会议中? [英] Twilio - How to dial third party number and add him to conference?

查看:42
本文介绍了Twilio - 如何拨打第三方号码并将他添加到会议中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Twilio 会议时遇到一个小问题.

I am facing a small problem while using Twilio conference.

我的 API 收到来电并将来电者转到新的空会议室:

My API gets incoming call and puts caller to new and empty conference room:

<Response>
    <Dial>
        <Conference waitUrl="http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient">Conf 1</Conference>
    </Dial>
</Response>

所以我让来电者在空荡荡的会议室里等待并听音乐.
我想拨打其他号码并将其添加到此会议室.
这个数字不是 twilio.
我该怎么做?

So I got caller waiting in an empty conference room and listening music.
I want to dial some other number and to add it to this confrence room.
That number is non-twilio.
How can I do this?

推荐答案

您可以使用 Twilio REST API 进行出站呼叫,并将该呼叫定向到您的会议室.在 PHP 中,这可以像这样完成:

You could use the Twilio REST API to make an outbound call, and direct that call into your conference room. In PHP this can be done like this:

(来自 twilio-php 帮助程序库)

require('/path/to/twilio-php/Services/Twilio.php');

$client = new Services_Twilio($sid, $token);
$call = $client->account->calls->create(
  'some-twilio-number', // From a valid Twilio number
  'other-number-to-call', // Number to call
  'http://example.com/some_twiml'
);

您在此处使用的 URL 应提供 TwiML,使呼叫者与您的原始呼叫位于同一个房间(与您在问题中所用的完全相同).实际上,一个人给你打电话,然后你给另一个人打电话,把他们放在同一个房间里.

The URL you use here should serve TwiML that puts the caller into the same room as your original call (exactly as you have in your question). In effect, one person called you, then you called the other person and put them into the same room.

(为了全面披露,我为 Twilio 工作.)

(In the interests of full disclosure, I worked for Twilio.)

这篇关于Twilio - 如何拨打第三方号码并将他添加到会议中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆