Tropo is part of CiscoLearn More

Event Queuing

The event queue is a first-in-first-out queue. When an interruptible Tropo method runs, it starts processing the queue, discarding events that don't match until it reaches one that does. It then stops, leaving the rest of the items on the queue. Events that arrive during the execution of a Tropo method are processed in the same way. This means if you have a number of interruptible events in an application, you should take care to send interrupts in the order that they appear in your application.

Consider the following application (note that conference requires the terminator parameter in order to be interruptible):

say("http://example.org/holdmusic.mp3", {
    allowSignals: "exithold"
});
conference("1234", {
    terminator: "#",
    allowSignals: "endconf"
});
say "http://example.org/holdmusic.mp3", {
    :allowSignals => "exithold"}
conference "1234", {
    :terminator => "#",
    :allowSignals => "endconf"}
<?php
say("http://example.org/holdmusic.mp3", array(
    "allowSignals" => "exithold"
));
conference("1234", array(
    "terminator"=>"#",
    "allowSignals"=>"endconf"
));
?>
say("http://example.org/holdmusic.mp3", {
    "allowSignals": "exithold"
})
conference("1234", {
    "terminator": "#",
    "allowSignals": "endconf"
})
say("http://example.org/holdmusic.mp3", [
    allowSignals: "exithold"
])
conference("1234", [
    terminator: "#",
    allowSignals: "endconf"
])

You believe the hold music to be already over, so you send only an "endconf" event. But the hold music is still playing, so the say function will receive the "endconf" event, see it doesn't match, and discard it. The conference will never be interrupted.

To be safe, you can send both the "exithold" event and the "endconf" event, in order. If the hold music is already over, the conference will reject and discard the "exithold" event and move onto the next event, "endconf". If it isn't over, the hold music will be interrupted, followed immediately by the interruption of the conference.

Request

    URL:

    https://api.tropo.com/1.0/sessions/<session-id>/signals

    Replace with the 16-byte GUID session ID that Tropo gives you in currentCall.sessionId.

    Method:

    POST or GET

    Headers:

    Only required when using POST:

    accept:application/json
    
    content-type:application/json
    accept:text/xml
    
    content-type:text/xml
    content-type:application/x-www-form-urlencoded

    Request Body:

    POST:

    {
       "value":"exithold"
    }
    
    <signal>
       <value>exithold</value>
    </signal>
    
    value=exithold
    
      Followed by:
    {
       "signal":"endconf"
    }
    
    <signal>
       <value>endconf</value>
    </signal>
    
    value=endconf
    

    GET:

    https://api.tropo.com/1.0/sessions/<session-id>/signals?action=signal&value=exithold
      Followed by:
    https://api.tropo.com/1.0/sessions/<session-id>/signals?action=signal&value=endconf

Response