【问题标题】:Twilio Studio Calls DropTwilio Studio 通话中断
【发布时间】:2018-04-30 20:31:08
【问题描述】:

如果我链接到我的会议脚本,则使用 Twilio Studio,一旦帖子返回 200,呼叫就会挂断。

有没有办法让通话保持活跃?

<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php

// this line loads the library 
require $_SERVER['DOCUMENT_ROOT'] . '/vendor/twilio-php-master/Twilio/autoload.php';
use Twilio\Twiml;

// Update with your own phone number in E.164 format
$MODERATOR = '0000';

$response = new Twiml;

// Start with a <Dial> verb
$dial = $response->dial();

// If the caller is our MODERATOR, then start the conference when they
// join and end the conference when they leave
if ($_REQUEST['From'] == $MODERATOR) {
  $dial->conference('My conference', array(
                'startConferenceOnEnter' => True,
                'endConferenceOnExit' => True
                ));
} else {
  // Otherwise have the caller join as a regular participant
  $dial->conference('My conference', array(
                'startConferenceOnEnter' => True
                ));
}

print $response;

?>

【问题讨论】:

    标签: php twilio conference


    【解决方案1】:

    这里是 Twilio 开发者宣传员。

    为什么不在这里使用 HTTP 请求,而不是使用 Connect Call To 小部件将呼叫连接到会议?

    如果您需要使用 HTTP 请求,请确保您的 PHP 将 Content-Type 标头设置为 text/xmlapplication/xml 并在 header('Content-type: text/xml'); 之前设置 echo 响应。

    【讨论】:

    • 感谢您的提醒。我正在使用该方法,以便我可以通过 PHP 记录调用,因为我似乎无法让 HTTP Post 小部件发送 $_POST["From"]
    • 您如何尝试在 Post 小部件中发送 From
    • 与我在第一篇文章中的截图相同.. URL > POST 但我似乎无法在我的 php 脚本中连接到 $_POST["From"]。
    • 哦,您需要将参数添加到小部件中的 POST 请求正文中。试试From={{ flow.trigger.call.From }}
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多