plivo / plivoframework

Open Source Telephony Application Prototyping Framework
http://www.plivo.com/open-source/
Other
418 stars 179 forks source link

Added new Callback element #80

Closed mattwilliamson closed 12 years ago

mattwilliamson commented 12 years ago

I've added support for the Callback element. This will send an HTTP request to the URL specified when the XML element is executed. This lets the developer know when a specific part of the XML has been reached. For example, this can allow the developer to perform mod_soundtouch commands via the REST API after the first Speak is executed.

Sample Usage

<Response>
    <Speak engine="cepstral" voice="Allison-8kHz">Before Callback</Speak>
    <Callback>http://localhost:8001/speak-executed/</Callback>
    <Speak engine="cepstral" voice="Allison-8kHz">After Callback</Speak>
</Response>

The callback URL will receive the following params after the elements before Callback are executed:

[To] => 15553470933
[Direction] => inbound
[From] => 1004
[CallerName] => Plivo
[CallUUID] => fcfd25e5-246e-4200-8400-b2b56845c68d
[CallStatus] => in-progress
mike-plivo commented 12 years ago

Hi matt,

this is a good idea however I think it will be better to name this Element "Notify" . What do you think ?

mattwilliamson commented 12 years ago

That sounds good to me. I'll rename it today.

On Mar 12, 2012, at 6:14, Michael Ricordeaureply@reply.github.com wrote:

Hi matt,

this is a good idea however I think it will be better to name this Element "Notify" . What do you think ?


Reply to this email directly or view it on GitHub: https://github.com/plivo/plivo/pull/80#issuecomment-4448947