Twillio Call Screening silence on answer

£可爱£侵袭症+ 提交于 2019-12-12 04:07:06

问题


I am using the call screening example at https://www.twilio.com/docs/howto/callscreening

When I place a call to my incoming Twilio number via landline, it is forwarded to my mobile and I am prompted to "press a key to accept" Problem is that as soon as I answer it on my mobile the incoming call stops getting the ringing tone and has silence until about 5 seconds after I press any key.

As soon as I answer the call on my mobile the user is presented with silence and has the impression that the call has been answered but it is not until I have pressed a key to accept the call and further until Twilio does its hookup of the call, that is the point that I can talk to the person.

Could I present them with music or a ringing tone until the cal really has been connected to me?

Here is the code of the forwarding

<?php 

// Set the numbers to call
$numbers = array("<number to call 1>", "<number to call 2>", "<number to call   n>");
$number_index = isset($_REQUEST['number_index']) ? $_REQUEST['number_index'] : "0";
$DialCallStatus = isset($_REQUEST['DialCallStatus']) ?    $_REQUEST['DialCallStatus'] : "";

header("content-type: text/xml"); 

// Check the status of the call and 
// that there is a valid number to call

if($DialCallStatus!="completed" && $number_index<count($numbers)){ 
?>
<Response>
<Dial action="attempt_call.php?number_index=<?php echo $number_index+1 ?>">
    <Number url="screen_for_machine.php">
    <?php echo $numbers[$number_index] ?>
    </Number>
</Dial>
</Response>
<?php
} else {
?>
<Response>
    <Hangup/>
</Response>
<?php
}
?>

And the part that asks me to accept the call

<?php header("content-type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<Response>
<Gather action="complete_call.php">
    <Say>Press any key to accept this call</Say>
</Gather>
<Hangup/>
</Response>

回答1:


Twilio Customer Support here.

What I would recommend is that you place the incoming caller into conference, this would allow you to use the waitURL parameter to play hold music whilst your agent decides to take the call:

https://www.twilio.com/docs/howto/simple-conference



来源:https://stackoverflow.com/questions/29504427/twillio-call-screening-silence-on-answer

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