Tropo is part of CiscoLearn More

Machine Detection

Machine Detection - also known as Voicemail Detection - is a common need for a variety of applications. Pretty much any outbound call could use the ability to identify whether your call reached a live human or not, and Tropo provides a method to handle it - the "machineDetection" parameter of the call method.

call('14075551212', {
   timeout:30.0,
   machineDetection: {introduction: "Verifying human or a machine...please hold while we determine...almost finished. Thank you!", voice: "Victor"},
   onAnswer: function(event) {
       say("Detected " + event.value.userType);
   },  
   onTimeout: function(event) {
       say("Call timed out");
   },  
   onCallFailure: function(event){ 
       say("Call could not be complete as dialed");
   }
});
call '14075551212', {
   :timeout => 30,
   :machineDetection => {"introduction" => "Verifying human or a machine...please hold while we determine...almost finished. Thank you!", "voice" => "Victor"},
   :onAnswer => lambda {  |event|     
     say "Detected " + event.value.userType},
   :onTimeout => lambda { |event|
     say "Call timed out"},
   :onCallFailure => lambda { |event|
     log "Call could not be complete as dialed"}
}
<?php
call("14075551212", array(
   "timeout" => 30,
   "machineDetection" => array("introduction" => "Verifying human or a machine...please hold while we determine...almost finished. Thank you!" , "voice" => "Victor"),
   "onAnswer" => "answerFCN",
   "onTimeout" => "timeoutFCN",
   "onCallFailure" => "callFailureFCN"
   )
);
function answerFCN($event) {
   say("Detected " . $event->value->userType);
}
function timeoutFCN($event) {
   _log("Call timed out");
}
function callFailureFCN($event) {
   _log("Call could not be completed as dialed");
}
?>
call('14075551212', {
   "timeout":30,
   "machineDetection": {"introduction": 'Verifying human or a machine...please hold while we determine...almost finished. Thank you!', "voice": 'Victor'},
   "onAnswer": lambda event : say("Detected " + event.value.userType),
   "onTimeout": lambda event : log("Call timed out"),
   "onCallFailure": lambda event : log("Call could not be completed as dialed")
})
call('14075551212', [
   timeout: 120,
   machineDetection: [introduction: "Verifying human or a machine...please hold while we determine...almost finished. Thank you!", voice: "Victor"],
   onAnswer: { event ->
       say("Detected " + event.value.userType)},
   onTimeout: {
       log("Call timed out") },
   onCallFailure: {
       log("Call could not be complete as dialed") }
])

The "introduction" should be long enough to give Tropo time to detect a human or machine. The longer the introduction, the more time we have to determine how the call was answered. If the introduction is long enough to play until the voicemail "beep" plays, Tropo will have the most accurate detection. It takes a minimum of four seconds to determine if a call was answered by a human or machine, so introductions four seconds or shorter will always return HUMAN.

In the examples shown, the value is returned in a simple say but you can then use the value as needed - repeat a message, to try the call again, log in a database, whatever you'd like.