Outbound calls can be made to external customers using SmartAssist Voice Gateway (SAVG). The answering machine detection feature can be enabled on outbound calls to indicate whether a person or a machine has answered a call.
When the dialed call is answered, the answering machine detection feature starts listening to the outbound call, and after a short period, sends an indication of whether a person or a machine has answered the call.
This process happens in two parts:
- The application triggers an Outbound Call.
- Receiving Call Status Notifications.
1. Triggering the Outbound Call via API
The application triggers an outbound call using an HTTP POST request to the endpoint.
Method | POST |
Endpoint | https://{{host}}/api/1.1/public/bot/{{botId}}/smartassist/dialout |
Content Type | application/json |
Authorization | auth: {{JWT}} See How to generate the JWT Token. |
API Scope | SmartAssist Dialout |
Path Parameters
Parameter | Description | Type |
---|---|---|
host | Environment URL, for example, https://smartassist.kore.ai | string, required |
Query Parameters
PARAMETER | DESCRIPTION | TYPE |
---|---|---|
botId | botId or streamId. You can access it from the bot’s General Settings page. | string, required |
target | URI of the target of the outbound call. For example:
|
string, required |
caller | User part for the caller ID of the outbound call. It is the experience flow number in smartAssist. | string, required |
notifyurl | Absolute URL of the dialer application where SAVG sends notifications. If not provided, no notifications are sent. |
string, optional |
trunk | The trunk is a carrier for the account. If not provided, It will pick the default carrier for that account. |
string, optional |
metadata | Data to be sent to the bot (can be used to provide information to the bot about the call,
such as the name of the target). |
object, optional |
timers | An object containing various timeout properties. Learn more. | object, optional |
machinedetection | Activates machine (answering machine and fax) detection. Possible values:
|
string, optional |
thresholdWordCount | Number of spoken words in a greeting that result in an amd_machine_detected result. | number, optional |
Timers Configuration
PROPERTY | DESCRIPTION | REQUIRED |
---|---|---|
timers.noSpeechTimeoutMs |
Time in milliseconds to wait for a speech before returning
amd_no_speech_detected. |
no, default=5000 |
timers.decisionTimeoutMs |
Time in milliseconds to wait before returning
amd_decision_timeout. |
no, default=15000 |
timers.toneTimeoutMs |
Time in milliseconds to wait to hear a tone. | no, default=20000 |
timers.greetingCompletionTimeoutMs |
Silence in milliseconds to wait for during greeting
before returning amd_machine_stopped_speaking. |
no, default=2000 |
timers.noSpeechTimeoutMs |
Time in milliseconds to wait for a speech
before returning amd_no_speech_detected. |
no, default=5000 |
Sample Request
curl --location --request POST '{{host}}/api/1.1/public/bot/{{botId}}/smartassist/dialout' \ --header 'Format: application/json' \ --header 'auth: {{JWT_TOKEN}}' { "bot": "st-e38782ff-0d89-52e9-5678769a49fdexxxx", "target": "tel:911234567890", "caller": "+127061657882", "trunk": "TRUNK", "timers": { "noSpeechTimeoutMs": 12000, "decisionTimeoutMs": 15000, "toneTimeoutMs": 10000, "greetingCompletionTimeoutMs": 10000 }, "thresholdWordCount": 4, "machineDetection": "detect", "notifyurl": "https://de8a-115-114-88-222.ngrok-free.app/notify", "metadata": { "jobPosition": "Software Engineer", "userName": "John Doe", "companyName": "abc corporation", "jobLocation": "USA" } }
Sample Response
{ "sid":"f9bd46ab-ecbd-4216-842e-0c58db3axxxx", "callId":"2c01240f-6880-123c-179b-02d8f501xxxx" }
2. Receiving Call Status Notifications
To receive call status notifications using the notifyUrl
property on the dial-out request.
When this property is set, SAVG sends an HTTP POST request to the specified URL.
Sample Response
POST /notify HTTP/1.1 Host: 892c-115-114-88-222.ngrok-free.app User-Agent: abc { "conversationId": "29e2d933-527e-429c-95b9-ba4f7c7bxxxx", "reasonCode": "caller-disconnected", "status": "completed", "reason": "200 OK", "duration": 14, "machinedetection": "amd_human_detected", "callconnecttime": "5/8/2023,11:32:49AM", "callDisconnectTime": "5/8/2023,11:33:03AM" }, POST /notify HTTP/1.1 Host: 892c-115-114-88-222.ngrok-free.app User-Agent: abc { "conversationId": "29e2d933-527e-429c-95b9-ba4f7c7bxxxx", "reasonCode": "SAVG-disconnected", "status": "completed", "reason": "200 OK", "duration": 14, "machinedetection": "amd_machine_detected", "callconnecttime": "5/8/2023,11:32:49AM", "callDisconnectTime": "5/8/2023,11:33:03AM" }, POST /notify HTTP/1.1 Host: 892c-115-114-88-222.ngrok-free.app User-Agent: abc { "conversationId": "4e010fea-cd93-47a0-a548-36d5f621xxxx", "reasonCode": "caller-disconnected", "status": "completed", "reason": "200 OK", "duration": 10, "machinedetection": "disabled", "callconnecttime": "5/8/2023,11:29:55AM", "callDisconnectTime": "5/8/2023,11:30:05AM" }, POST /notify HTTP/1.1 Host: 892c-115-114-88-222.ngrok-free.app User-Agent: abc { "conversationId": "305ae3c4-b527-4bfd-ad75-9b6abdaaxxxx", "status": "failed", "reason": "503 Service Unavailable", "machinedetection": "disconnect", "callconnecttime": "5/8/2023,11:31:30AM", "reasonCode": "Service Unavailable", "callDisconnectTime": "5/8/2023,11:31:30AM" }, POST /notify HTTP/1.1 Host: 892c-115-114-88-222.ngrok-free.app User-Agent: abc { "conversationId": "80af8588-31c7-4877-a798-a3603c30xxxx", "status": "failed", "reason": "486 Busy Here", "machinedetection": "disconnect", "callconnecttime": "5/8/2023,11:36:33AM", "reasonCode": "Busy Here", "callDisconnectTime": "5/8/2023,11:36:33AM" }, POST /notify HTTP/1.1 Host: 892c-115-114-88-222.ngrok-free.app User-Agent: abc { "conversationId": "40a95de6-949a-4403-b735-233daxxxx", "status": "failed", "reason": "480 Temporarily Unavailable", "machinedetection": "disconnect", "callconnecttime": "5/8/2023,11:37:46AM", "reasonCode": "Temporarily Unavailable", "callDisconnectTime": "5/8/2023,11:37:46AM" }
Response Body Parameters
PARAMETER | DESCRIPTION | TYPE |
---|---|---|
conversationId | UUID of the conversation
(matches the |
string, required |
status | Call status:
|
string, required |
reasonCode | If the status is “failed”, it provides the reason for the failure:
If the status is “completed”, it provides the reason for the call end:
|
string, required |
reason | Free text describing the reason for the failure (for example, the SIP Reason header). | string, required |
callconnecttime | The time when the call was connected (when the end-user picked up the phone). | string, required |
callDisconnecttime | The time when the call was disconnected. | string, required |
duration | The duration of the call from connectTime to the end of the call in seconds. | string, required |
machinedetection | This property is included when answering machine detection
is enabled ( and the call ends. It provides the detection reason:
|
string, required |