twilio say verb nested into a dial verb

夙愿已清 提交于 2019-12-10 15:05:56

问题


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.

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

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>

回答1:


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

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



来源:https://stackoverflow.com/questions/6863305/twilio-say-verb-nested-into-a-dial-verb

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