首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Twilio\Twiml php在<Gather>中嵌套Twilio <Gather>

如何使用Twilio\Twiml php在<Gather>中嵌套Twilio <Gather>
EN

Stack Overflow用户
提问于 2017-05-31 12:52:21
回答 1查看 270关注 0票数 1

我要如何在集合内筑巢玩耍?我有以下Twiml xml:

代码语言:javascript
复制
 $twiml = new Twiml();
    $twiml->gather('gather',array());
    $twiml->play('https://api.twilio.com/cowbell.mp3', array("loop" => 5));
    $response = Response::make($twiml, 200);
    $response->header('Content-Type', 'text/xml');
    return $response;

所需结果:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather input="speech" action="/completed">
  <Play loop="5">https://api.twilio.com/cowbell.mp3</Play>
</Gather>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-31 13:28:10

用这个:

代码语言:javascript
复制
$twiml = new Twilio\Twiml();
$gather = $twiml->gather(array('input' => 'speech', 'action' => '/completed'));
$gather->play('https://api.twilio.com/cowbell.mp3', array("loop" => 5));

$response = Response::make($twiml, 200);
$response->header('Content-Type', 'text/xml');
return $response;
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44285367

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档