Tropo is part of CiscoLearn More

Interrupting Your Code - Multiple Signals

You can also use an array of signals - the function will stop if it receives an interrupt signal matching any of the names in the array.

var sessionid = currentCall.sessionId;
log("The Session ID is " + sessionid);
say("http://www.phono.com/audio/holdmusic.mp3", {
    allowSignals: ["exit", "stopHold", "dequeue"]
});

say("You are now off hold.");
sessionid = $currentCall.sessionId
log "The Session ID is " + sessionid
say "http://www.phono.com/audio/holdmusic.mp3", {
    :allowSignals => ["exit", "stopHold", "dequeue"]
    }

say "You are now off hold."
<?php
$sessionid = $currentCall->sessionId;
log("The Session ID is " . $sessionid);
say("http://www.phono.com/audio/holdmusic.mp3", array(
    "allowSignals" => array("exit", "stopHold", "dequeue")
));

say("You are now off hold.");
?>
sessionid = currentCall.sessionId
log("The Session ID is " + sessionid)
say("http://www.phono.com/audio/holdmusic.mp3", {
    "allowSignals": ["exit", "stopHold", "dequeue"]
})

say("You are now off hold.")
sessionid = currentCall.sessionId
log("The Session ID is " + sessionid)
say("http://www.phono.com/audio/holdmusic.mp3", [
    allowSignals: ["exit", "stopHold", "dequeue"]
])

say("You are now off hold.")

Now for the REST methods - this is almost identical to the Request/Response shown in Interrupting Your Code - One Signal, except we're picking one of several signal options in the array to interrupt the function. We support both POST and GET.

Request

URL:

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

Replace :session-id with the 16-byte GUID session ID that Tropo gives you in currentCall.sessionId. Adding log to the application (like we did in the above example) will report the sessionId in your logs. It is also returned as a field called "id" when starting a new session through the session API.

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

{
   "signal":"stopHold"
}
<signal>
   <value>stopHold</value>
</signal>
value=stopHold

GET:

https://api.tropo.com/1.0/sessions/:session-id/signals?action=signal&value=stopHold

Response

Response Body:

{"status": "QUEUED"}
<signal>
    <status>QUEUED</status>
</signal>
status=QUEUED