twilio say 动词嵌套在拨号动词中 [英] twilio say verb nested into a dial verb

查看:33
本文介绍了twilio say 动词嵌套在拨号动词中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 PHP 为 twilio 编写代码,以便当我拨打我的 twilio 号码时,它会拨打另一个号码,当用户接电话时,它会使用该号码向他们读一条消息.

I am writing code in PHP for twilio to make it so that when I call my twilio number, it calls another number and when the user picks up it reads them a message using the say number.

我该怎么做?我找不到任何嵌套在拨号动词中的 say 动词的例子?

How can I do this? I can't find any example of a say verb nested into a dial verb?

我试过这个,但它不起作用,因为 say 动词只在用户挂断后激活,所以我需要以某种方式将 say 动词嵌套到拨号动词中.

I tried this but it does not work as the say verb only activates after the user hangs up so I need to somehow nest the say verb into the dial verb.

<Response>
<Dial>
4166789876
</Dial>
<Say>hello monkey</Say>
</Response>

推荐答案

当通过 Dial 连接时,Twilio 会阻止执行更多动词,直到主叫方或被叫方挂断.

When connected via Dial, Twilio blocks execution of further verbs until the caller or called party hangs up.

如果需要为被叫方播放一条消息,可以将电话号码包裹在一个Number名词中,并指定一个url属性:

If you need a message played for the called party, you can wrap the phone number in a Number noun and specify a url attribute:

<Response>
    <Dial>
        <Number url="other-script">
            415-123-4567
        </Number>
    </Dial>
</Response>

被叫方将听到另一个脚本的结果.在此期间,来电者将继续听到振铃.然后,在另一个脚本完成后,双方将建立连接.

The called party will then hear the results of the other script. During this time the caller will continue to hear ringing. Then, after the other script is complete, the two parties will be connected.

http://www.twilio.com/docs/api/twiml/number

这篇关于twilio say 动词嵌套在拨号动词中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆