Tropo is part of CiscoLearn More

Unanswered Calls & Call Failures

There will be times when an outbound call fails or times out - a timeout occurs when the call rings but never answers, while a failure occurs if the call never rings at all - maybe the number is disconnected or you're accidentally trying to call the letter Q instead of a phone number (note that phone numbers in the US need to be in the format +14075551212; international numbers would be something like +31105551212, depending on the destination country).

Tropo includes error handling through the use of built in event handlers - onAnswer defines what to do if the call is answered, onTimeout defines what to do if the call times out and onCallFailure defines what to do if the call can't be completed at all:

call('+447700900444', {
   timeout:120,
   onAnswer: function() {
       say("Tag, you’re it!");
       log("Obnoxious call complete");
   },
   onTimeout: function() {
       log("Call timed out");
   },
   onCallFailure: function() {
       log("Call could not be completed as dialed");
   }
});
call '+447700900444', {
   :onAnswer => lambda {
       say "Tag, you're it!"
       log "Obnoxious call complete"},
   :onTimeout => lambda {
       say "Call timed out" },
   :onCallFailure => lambda {
       log "Call could not be complete as dialed" }
}
<?php
call("+447700900444", array(
   "timeout" => 120,
   "onAnswer" => "answerFCN",
   "onTimeout" => "timeoutFCN",
   "onCallFailure" => "callFailureFCN"
   )
);
function answerFCN($event) {
   say("Tag, you’re it!");
   _log("Obnoxious call complete");
}
function timeoutFCN($event) {
   _log("Call timed out");
}
function callFailureFCN($event) {
   _log("Call could not be completed as dialed");
}
?>
call("+447700900444", {
   "timeout":120,
   "onAnswer": lambda event : say("Tag, you're it!") and log("Obnoxious call complete"),
   "onTimeout":lambda event : log("Call timed out"),
   "onCallFailure": lambda event : log("Call could not be completed as dialed")
})
call('+447700900444', [
   onAnswer: {
       say("Tag, you're it!")
       log("Obnoxious call complete") },
   onTimeout: {
       log("Call timed out") },
   onCallFailure: {
       log("Call could not be complete as dialed") }
])

Please note, you will need to contact support to verify your account prior to making outbound calls.