Skip to main content

Machine Detection Complete

caution

This event is not sent when sync answering machine detection mode is chosen.

This event is sent to the url informed when requesting a machine detection operation. It contains the machine detection operation result, which can be:

ValueDescription
humanA human was detected. The speechThreshold and speechEndThreshold parameters can be used to tweak the speech detection operation.
answering-machineAn answering-machine was detected. The speechThreshold and speechEndThreshold parameters can be used to tweak the speech detection operation.
tone-detectedAn end of message tone was detected. Please note that tone-detection will only be sent if it had been enabled on your account. If a tone is detected and tone-detection is not enabled on the account, we will send answering-machine instead. If you wish to have tone-detection enabled, please contact support
silenceNo speech was detected. The silenceTimeout parameter can be used to control the period.
timeoutNo result was determined. The detectionTimeout parameter can be used to control the period.
errorAn error ocurred during the machine detection operation.

To modify the call in progress after receiving this event, your application should send a request to the Update Call edpoint.

Request Parameters

PropertyDescription
eventTypeThe event type, value is machineDetectionComplete
eventTimeThe approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
accountIdThe user account associated with the call.
applicationIdThe id of the application associated with the call.
toThe phone number that received the call, in E.164 format (e.g. +15555555555).
fromThe provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
directionThe direction of the call. Either inbound or outbound. The direction of a call never changes.
callIdThe call id associated with the event.
callUrlThe URL of the call associated with the event.
enqueuedTime(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
startTimeTime the call was started, in ISO 8601 format.
answerTimeTime the call was answered, in ISO 8601 format.
machineDetectionResultMachine Detection Analysis Object. Possible values are answering-machine, tone-detected, human, silence, timeout, or error. Please note that tone-detection will only be sent if it had been enabled on your account. If a tone is detected and tone-detection is not enabled on the account, we will send answering-machine instead. If you wish to have tone-detection enabled, please contact support
machineDetectionResult.valuePossible values are answering-machine, human, silence, timeout, or error.
machineDetectionResult.durationThe amount of time it took to determine the result.
tag(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.

Expected Response

HTTP/1.1 204

Examples

Machine Detection Complete Event

POST http://yourUrl.example/machineDetectionComplete
Content-Type: application/json

{
"eventType" : "machineDetectionComplete",
"callId" : "c-6a0d8e3e-1c71aa98-fb05-46ca-acf8-f735db20fa28",
"from" : "+15551112222",
"to" : "+15553334444",
"direction" : "outbound",
"applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086",
"accountId" : "55555555",
"startTime" : "2021-11-10T11:20:02.123Z",
"eventTime" : "2021-11-10T11:20:07.709Z",
"callUrl" : "https://voice.bandwidth.com/api/v2/accounts/55555555/calls/c-6a0d8e3e-1c71aa98-fb05-46ca-acf8-f735db20fa28",
"tag" : "example-tag",
"answerTime" : "2021-11-10T11:20:02.292Z",
"machineDetectionResult" : {
"value" : "answering-machine",
"duration" : "PT4.9891287S"
}
}

Machine Detection Complete Event with Enqueued Time

POST http://yourUrl.example/machineDetectionComplete
Content-Type: application/json

{
"eventType" : "machineDetectionComplete",
"callId" : "c-6a0d8e3e-1c71aa98-fb05-46ca-acf8-f735db20fa28",
"from" : "+15551112222",
"to" : "+15553334444",
"direction" : "outbound",
"applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086",
"accountId" : "55555555",
"enqueuedTime" : "2021-11-10T11:19:56.870Z",
"startTime" : "2021-11-10T11:20:02.123Z",
"eventTime" : "2021-11-10T11:20:07.709Z",
"callUrl" : "https://voice.bandwidth.com/api/v2/accounts/55555555/calls/c-6a0d8e3e-1c71aa98-fb05-46ca-acf8-f735db20fa28",
"tag" : "example-tag",
"answerTime" : "2021-11-10T11:20:02.292Z",
"machineDetectionResult" : {
"value" : "answering-machine",
"duration" : "PT4.9891287S"
}
}