Twilio Say Verb during a phone call

 ̄綄美尐妖づ 提交于 2019-12-24 00:06:07

问题


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

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>

And say.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>

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.

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?


回答1:


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

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) When Twilio calls this URL and passes the status of in-progress you know the call is live.

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

That should do it.



来源:https://stackoverflow.com/questions/26597496/twilio-say-verb-during-a-phone-call

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!