Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

twilio say verb nested into a dial verb

Tags:

php

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.

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>
like image 552
Bulvak Avatar asked Jul 28 '11 17:07

Bulvak


1 Answers

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

like image 69
webbiedave Avatar answered Oct 17 '22 16:10

webbiedave