How do I make sure a call is answered by a person and not a machine?

The quality of my PSTN or SIP lines is occasionally suspect, and I am getting a lot of false voice/machine detection results. Is there a way to guarantee that xMatters can tell when the phone is answered by a person?

The machine detection settings in xMatters 4.x should eliminate most difficulties in determining whether a phone is answered by a person or a machine, but some deployments may encounter problems where the length of certain greetings or the quality of SIP connection results in a "false positive". The only way to virtually eliminate these situations is to require user interaction for each phone call.

The following code illustrates an example method of how to modify the default script package so that it requires a User to press a key on the phone to identify that the answerer is not a machine:

In the callout > CONTACT > callout script, locate the following section:

@script::log("Call connect result = " & $result)  
IF ( ($result == "VOICE_DETECT") || ($result == "CADENCE_DETECT") )   
  $connected = true   
  @recipient::report("Reached a Person.",$notId)   
  $connectionEventMessage.message = "Callout to " & $targetName & " successful (" & $result & ")."   
  @connectionEventMessage::send()   
ELSE-IF ( $result == "MACHINE_DETECT" )   
  $connected = true   
  $voiceMail = true   
  @recipient::report("Reached Voicemail.",$notId)   
  $connectionEventMessage.message = "Callout to " & $targetName & " unsuccessful (" & $result & ")."   
  @connectionEventMessage::send()   
ELSE   
  $failureType = $result   
  @script::log("Failed to connect. Call result: " & $result & ".")   
  @recipient::report("Failed to connect. Call result: " & $result & ".",$notId)   
  $connectionEventMessage.message = "Callout to " & $targetName & " failed (" & $result & ")."   
  @connectionEventMessage::send()   
ENDIF   
IF ( ! $connected )   
  $failed = TRUE   
  if ($failureType != "" && (!$reportedFailure))   
    $reportedFailure = @session::reportFailure($notId, $failureType)   
  endif   
  exit   
ENDIF   
  
@phone::play("phrase", "call-out greeting")   
$recordingExists = @phone::isRecording("name", $targetName)   
IF($recordingExists)   
  @phone::play("name", $targetName)   
ELSE   
  @phone::play("phrase", $recipient.firstName)   
  @phone::play("phrase", $recipient.lastName)   
ENDIF  

Replace the above section with the following code:

@script::log("Call connect result = " & $result)  
IF ( $result == "ANALYSIS_ERROR" || $result == "OPERATOR_INTERCEPT" || $result == "FAX_DETECT" || $result == "NO_DIAL_TONE" || $result == "LINE_BUSY" || $result == "ANALYSIS_STOPPED" || $result == "NO_RINGBACK" || $result == "NO_ANSWER" || $result == "LOOP_DETECT")   
  $failureType = $result   
  @script::log("Failed to connect. Call result: " & $result & ".")   
  @recipient::report("Failed to connect. Call result: " & $result & ".",$liveNotificationId)   
  $connectionEventMessage.message = "Callout to " & $targetName & " failed (" & $result & ")."   
  $connectionEventMessage.request_text = "Callout to " & $targetName & " failed (" & $result & ")."   
  @connectionEventMessage::send()   
  $reportedFailure = @session::reportFailure($liveNotificationId, $failureType)   
  exit   
ENDIF   
  
@phone::play("phrase", "call-out greeting")   
$recordingExists = @phone::isRecording("name", $targetName)   
IF($recordingExists)   
  @phone::play("name", $targetName)   
ELSE   
  @phone::play("phrase", $recipient.firstName)   
  @phone::play("phrase", $recipient.lastName)   
ENDIF   
  
@phone::clearDtmf()   
@phone::play("phrase", "press any key")   
$nkey = @phone::getDigits(1, 2, "")   
@phone::clearDtmf()   
$nkeyLength = $nkey::length()   
IF ($nkeyLength == 0)   
  $connected = true   
  $voiceMail = true   
  @recipient::report("Reached Voicemail.",$liveNotificationId)   
  $connectionEventMessage.message = "Callout to " & $targetName & " unsuccessful (MACHINE_DETECT)."   
  $connectionEventMessage.request_text = "Callout to " & $targetName & " unsuccessful (MACHINE_DETECT)."   
  @connectionEventMessage::send()   
ELSE-IF ($nkeyLength == 1)   
  $connected = true   
  @recipient::report("Reached a Person.",$liveNotificationId)   
  $connectionEventMessage.message = "Callout to " & $targetName & " successful (" & $result & ")."   
  $connectionEventMessage.request_text = "Callout to " & $targetName & " successful (" & $result & ")."   
  @connectionEventMessage::send()   
ELSE   
  $failureType = $result   
  @script::log("Failed to connect. Call result: " & $result & ".")   
  @recipient::report("Failed to connect. Call result: " & $result & ".",$liveNotificationId)   
  $connectionEventMessage.message = "Callout to " & $targetName & " failed (" & $result & ")."   
  $connectionEventMessage.request_text = "Callout to " & $targetName & " failed (" & $result & ")."   
  @connectionEventMessage::send()   
ENDIF  

Note that, during testing, it was discovered that specifying wait times of more than 3 seconds may cause an answering machine to time out and cease recording because of the lack of speech. The related line of code is: $nkey = @phone::getDigits(1, 2, "")

It is recommended that you use only 2 or 3 second wait times when implementing this code.

See a similar article here.

xMatters Reference

JDN-1117 Originally created by Don Clark

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk