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:
Value | Description |
---|---|
human | A human was detected. The speechThreshold and speechEndThreshold parameters can be used to tweak the speech detection operation. |
answering-machine | An answering-machine was detected. The speechThreshold and speechEndThreshold parameters can be used to tweak the speech detection operation. |
tone-detected | An 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 |
silence | No speech was detected. The silenceTimeout parameter can be used to control the period. |
timeout | No result was determined. The detectionTimeout parameter can be used to control the period. |
error | An 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
Property | Description |
---|---|
eventType | The event type, value is machineDetectionComplete |
eventTime | The 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. |
accountId | The user account associated with the call. |
applicationId | The id of the application associated with the call. |
to | The phone number that received the call, in E.164 format (e.g. +15555555555). |
from | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) even if privacy is set to true. |
privacy | (optional) Hide the calling number. The callerDisplayName field can be used to customize the displayed name. |
callerDisplayName | (optional) The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If privacy is true, only the following values are valid: Restricted , Anonymous , Private , or Unavailable . |
direction | The direction of the call. Either inbound or outbound . The direction of a call never changes. |
callId | The call id associated with the event. |
callUrl | The 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. |
startTime | Time the call was started, in ISO 8601 format. |
answerTime | Time the call was answered, in ISO 8601 format. |
machineDetectionResult | Machine 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.value | Possible values are answering-machine , human , silence , timeout , or error . |
machineDetectionResult.duration | The 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"
}
}