繁体   English   中英

Twilio 使用 DTMF 多次拨打电话和发送数字

[英]Twilio Make call and send digits multiple times using DTMF

场景:我想拨打一个设置了 IVR 的号码。 英语按 1,西班牙语按 2。 一旦选择了一个数字,它就会要求输入 6 位数的密钥。 How I can pass the next 6 digits using DTMF?

我已经彻底阅读了文档并在 StackOverflow 上进行了搜索,但没有得到相关数据。

我尝试的是;

$twilio = new Client("AC8b2cc96be2a8dbc059f2908exxxxxxxx", "88db8eeb71124a3effd6c196xxxxxxxx");
$from = "+1289724xxxx";

$to = "+1289670xxxx";

$call = $twilio->calls
               ->create($to, // to
                        $from, // from
                        [
                            "method" => "GET",
                            "sendDigits" => "wwwwwwwwww1",
                            "sendDigits" => "wwwwwwwwwwwwwwwwww123456", // Whithout this line it's working for first digit press
                            "url" => "http://demo.twilio.com/docs/voice.xml"
                        ]
               );

print($call->sid);

我正在尝试使用 PHP Rest API。 https://www.twilio.com/docs/voice/make-calls#example-3我也读过这个问题: How to send digits in Z02641F076B0CC3A17A1693616838ECF7 call

您不能两次发送相同的参数,相反,您应该将该sendDigits参数组合成一个字符串,如下所示:

$call = $twilio->calls
               ->create($to, // to
                        $from, // from
                        [
                            "method" => "GET",
                            "sendDigits" => "wwwwwwwwww1wwwwwwwwwwwwwwwwww123456",
                            "url" => "http://demo.twilio.com/docs/voice.xml"
                        ]
               );

然后它会等待,按 1,再等一会儿,然后按 123456。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM