Twilio 在电话中说动词 [英] Twilio Say Verb during a phone call

查看:29
本文介绍了Twilio 在电话中说动词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于这个问题,非常接近到我想要的.

Based off of this question, it's so close to what I want.

当双方建立连接时,我们正在尝试在通话期间触发 Say 动词.不在接机前,不在挂机后,不在客户响铃期间.

We're trying to have the Say verb trigger DURING the phone call, when both parties have established connections. Not before pickup, not after hangup, not during client ringing.

<?php
header('Content-type: text/xml');
?>
<Response>
    <Dial callerId="+[some number]" record="true">
        <Number url="say.php">
            <?php echo htmlspecialchars($_REQUEST["tocall"]); ?>
        </Number>
    </Dial>
</Response>

然后说.php..

<?php
header('Content-type: text/xml');
?>
<Response>
    <Say voice="man" language="en">Long sentence to test quality of call over duration of [time]</Say>
</Response>

如您所见,我们这样做是为了在 2 小时内测试通话质量,因此请忽略它实际说"的内容.

As you can see, we're doing this to test the quality of a call over the duration of 2 hours, so ignore what it's actually "say"ing.

我该怎么做才能在连接的电话中触发这个 say 动词,而不是任何前/后阶段的通话过程?

What do I have to do to make this say verb trigger during a connected phone call, and not any of the pre/post stage call process?

推荐答案

Twilio 员工在这里.这是一个多步骤的过程:

Twilio employee here. This is a multi-step process:

1) 正如您已经完成的那样,在 A 和 B 之间接通电话.确保指定一个 状态回调 URL指向您的网络应用程序.

1) Connect the call between person A and person B as you have already done. Make sure to specify a status callback URL that points to your webapp.

2) 当 Twilio 调用此 URL 并传递 进行中 您知道通话正在进行中.

2) When Twilio calls this URL and passes the status of in-progress you know the call is live.

3) 现在使用 REST API 来修改实时通话并注入您的 TwiML.

3) Now use the REST API to modify the live call and inject your TwiML.

应该可以.

这篇关于Twilio 在电话中说动词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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