gpt4 book ai didi

php - Twilio 在通话中说动词

转载 作者:行者123 更新时间:2023-12-05 07:57:35 26 4
gpt4 key购买 nike

基于 this question ,它非常接近我想要的。

当双方都建立连接时,我们试图在通话期间触发 Say 动词。不在接听之前,不在挂断之后,不在客户响铃期间。

<?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 小时通话的质量,因此请忽略它实际“说”的内容。

我必须怎么做才能在接通的电话调用期间触发这个 say 动词,而不是任何前/后阶段调用过程?

最佳答案

这里是 Twilio 员工。这是一个多步骤过程:

1) 如前所述,连接 A 和 B 之间的通话。确保指定 status callback URL指向您的网络应用程序。

2) 当 Twilio 调用此 URL 并传递 in-progress 的状态时你知道电话是实时的。

3) 现在使用 REST API 来 modify the live call并注入(inject)您的 TwiML。

应该这样做。

关于php - Twilio 在通话中说动词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26597496/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com