接口對接,快速集成文檔參照。
任務調用接口集成
第一步:獲取實例ID以及場景ID
參照業務管理創建外呼實例和外呼話術后,進行獲取對應的實例ID(InstanceId)及場景ID(ScriptId)。獲取位置參見下圖:
業務管理:找到創建好的業務,點擊編輯,會展示實例ID。
場景ID:進入業務,找到場景管理,在所創建的話術場景側,點擊場景ID,即可獲取。
第二步:創建外呼任務
調用CreateJobGroup接口,獲取返回的JobGroupId
第三步:上傳外呼號碼名單
調用AssignJobs - 批量創建外呼任務接口,傳入上面獲取到的JobGroupId,將外呼被叫號碼名單傳入該任務中
任務結果自動推送回調
MQ簡介
介紹:對于每個外呼任務的呼叫完成狀態,智能外呼服務會通過消息隊列(RocketMQ)的方式通知調用方。消息中會返回任務Id,外呼任務的狀態(接通/無人接聽/呼叫失敗)等。
操作:接入方在阿里云購買的RocketMQ服務,智能外呼機器人目前支持RocketMQ4.0以及5.0,如果客戶需要MQ4.0,可通過自助服務工具自行申請加白為MQ 4.0,
客戶使用RocketMQ4.0后,需要客戶填入:
消息隊列實例ID:填入配置MQ完成后的實例ID。
Topic:填入MQ服務對應的Topic。
接入地址:填入MQ服務對應的接入地址。
接入點類型:根據實際接入點類型選擇NAMESRV_ADDR或ONS_ADDR。
認證類型:默認為AK_SK。
AccessKey:填入需要實際使用的MQ對應的AccessKey。
SecretKey:填入需要實際使用的MQ對應的SecretKey。
客戶使用RocketMQ5.0后,需要客戶填入
消息隊列實例ID:填入配置MQ完成后的實例ID。
Topic:填入MQ服務對應的Topic。
接入地址:填入MQ服務對應的接入地址。
接入點類型:根據實際接入點類型選擇NAMESRV_ADDR或ONS_ADDR。
認證類型:用戶名密碼。
用戶名:填入MQ服務對應的用戶名。
密碼:填入MQ服務對應的密碼。
MQ的SDK版本建議:
<dependency>
<groupId>com.aliyun.openservices</groupId>
<artifactId>ons-client</artifactId>
<version>1.8.8.Final</version
</dependency>
MQ開通以及集成
RocketMQ的購買參見其產品詳情頁:產品詳情頁。
訂閱RocketMQ消息參見RocketMQ的幫助文檔:消息隊列RocketMQ版幫助文檔。
開通消息隊列后該如何獲取任務完成信息參考文檔:
MQ消息類型:
消息級別 | 消息類型 | EventType |
任務 | 任務完成 | JobComplete |
通話 | 開始呼叫 | Dialing |
通話 | 接通通話 | CallAnswered |
通話 | 通話結束:掛機或者未接通超時 | CallFinished |
通話 | 大模型標簽 | LabelReady |
錄音 | 錄音生成成功 | RecordingReady |
CallFinished消息體:
{
"contacts": [
{
"honorific": "259049",
"id": "d045421c-5c56-4e60-bd30-52621bd40358",
"name": "259049",
"phoneNumber": "1854625****",
"referenceId": "102553299"
}
],
"eventTime": 1732032007598,
"eventType": "CallAnswered",
"extras": [
{
"key": "TenantId",
"value": "1594349927946608"
},
{
"key": "ServiceId",
"value": "208983907113910398"
}
],
"groupId": "b842817b-3a8e-455e-974f-60a22c7181a8",
"id": "c18312d3-1e3a-4f07-a00a-bf92d3bcce87",
"instanceId": "e2d412ad-6571-43a7-9624-0d779fb80a9e",
"scriptId": "0e700dc9-39e9-4872-8cc8-0654d38c9615",
"tagHits": [
],
"task": {
"actualTime": 1732032007576,
"callId": "ee819df9f4e54e26a741591431534878",
"calledNumber": "1854625****",
"callingNumber": "0218045****",
"id": "88a26ac5-645e-4423-bb39-3d5943a27dc9",
"planedTime": 1732031999000,
"status": "Executing"
}
}
JobComplete消息體:
{
"contacts": [
{
"honorific": "259049",
"id": "d045421c-5c56-4e60-bd30-52621bd40358",
"name": "259049",
"phoneNumber": "185xxxxxxx",
"referenceId": "102553299"
}
],
"eventTime": 1732032015258,
"eventType": "JobComplete",
"extras": [
{
"key": "TenantId",
"value": "1594349927946608"
},
{
"key": "ServiceId",
"value": "208983907113910398"
}
],
"groupId": "b842817b-3a8e-455e-974f-60a22c7181a8",
"id": "c18312d3-1e3a-4f07-a00a-bf92d3bcce87",
"instanceId": "e2d412ad-6571-43a7-9624-0d779fb80a9e",
"scriptId": "0e700dc9-39e9-4872-8cc8-0654d38c9615",
"status": "Succeeded",
"tagHits": [
],
"tasks": [
{
"actualTime": 1732032008000,
"callId": "ee819df9f4e54e26a741591431534878",
"calledNumber": "185xxxxxxxx",
"callingNumber": "021xxxxxxxx",
"endTime": 1732032015000,
"hasLastPlaybackCompleted": true,
"id": "88a26ac5-645e-4423-bb39-3d5943a27dc9",
"planedTime": 1732031999000,
"realRingingDuration": 7,
"ringingDuration": 25,
"status": "Succeeded"
}
]
}
CallAnswered消息體:
{
"contacts": [
{
"honorific": "259049",
"id": "d045421c-5c56-4e60-bd30-52621bd40358",
"name": "259049",
"phoneNumber": "185xxxxxxxx",
"referenceId": "102553299"
}
],
"eventTime": 1732032007598,
"eventType": "CallAnswered",
"extras": [
{
"key": "TenantId",
"value": "1594349927946608"
},
{
"key": "ServiceId",
"value": "208983907113910398"
}
],
"groupId": "b842817b-3a8e-455e-974f-60a22c7181a8",
"id": "c18312d3-1e3a-4f07-a00a-bf92d3bcce87",
"instanceId": "e2d412ad-6571-43a7-9624-0d779fb80a9e",
"scriptId": "0e700dc9-39e9-4872-8cc8-0654d38c9615",
"tagHits": [
],
"task": {
"actualTime": 1732032007576,
"callId": "ee819df9f4e54e26a741591431534878",
"calledNumber": "185xxxxxxxx",
"callingNumber": "021xxxxxxxx",
"id": "88a26ac5-645e-4423-bb39-3d5943a27dc9",
"planedTime": 1732031999000,
"status": "Executing"
}
}
LabelReady消息體:
{
"eventTime": 1732087443211,
"eventType": "LabelReady",
"instanceId": "ae4572af-376f-439f-8970-38764acbaa91",
"jobId": "12964626-49a9-4da2-beec-783b94637aff",
"labelMap": {
"通話總結": "用戶表示吸油煙機還未到貨,因此無法安排安裝。建議用戶待貨物到達后再聯系服務中心確認安裝事宜。",
"真實號碼": "未觸發",
"是否拆舊機等需求": "未觸發",
"上門時間": "未觸發",
"確認預約": "未觸發",
"修改地址": "未觸發",
"是否到貨": "未到貨",
"人工服務": "未觸發"
},
"scriptId": "a81f9147-ec4c-43d3-9dfa-e939a68b1d62",
"taskId": "4fb3a6b5-3468-4f35-b3eb-dfe9f31333d0"
}
RecordingReady消息體:
{
"eventType":"RecordingReady",
"eventTime":1588850490334,
"instanceId":"08a4c460-***-737e069a154f",
"groupId":"8869f35d-***-9b46437bc0fa",
"id":"08a4c460-***-737e069a154f",
"extras":[
{
"key":"custom",
"value":"aaa"
}
],
"contacts":[
{
"id":"762c2e16-***-00a0f13372b1",
"honorific":"test",
"name":"test",
"phoneNumber":"11111111",
"referenceId":"762c2e16-***-00a0f13372b1"
}
],
"recording":{
"taskId":"60b48efe-***-5d6b70479641",
"callId":"60b48efe-***-5d6b70479641",
"duration":5,
"fileName":"a.wav",
"mkvUrl":"https://a.wav",
"url":"https://a.wav"
}
}
各狀態枚舉值:
JobGroup狀態示例值
-JobGroupStatus {
Draft(0),草稿
Scheduling(1),調度中
Executing(2),執行中
Completed(3),已完成
Paused(4),掛起
Failed(5),失敗
Cancelled(6),已取消
Initializing(7),初始化
}
Job狀態示例值
-JobStatus {
Scheduling(0, "調度中"),
Executing(1, "執行中"),
Succeeded(2, "結束-已觸達"),
Paused(3, "暫停"),
Failed(4, "結束-未觸達"),
Cancelled(5, "已取消-人工干預"),
Drafted(6, "草稿態"),
}
Task狀態示例值
-TaskStatus {
Executing(0, "正在撥打"),
Succeeded(1, "已接通"),
NoAnswer(2, "未接通-無人接聽"),
NotExist(3, "未接通-空號"),
Busy(4, "未接通-占線"),
Cancelled(5, "未呼出-任務停止"),
Failed(6, "失敗"),
NotConnected(7, "未接通-無法接通"),
PoweredOff(8, "未接通-關機"),
OutOfService(9, "未接通-被叫停機"),
InArrears(10, "未接通-被叫欠費"),
EmptyNumber(11, "未呼出-空號不外呼"),
PerDayCallCountLimit(12, "未呼出-超出每日上限"),
ContactBlockList(13, "未呼出-黑名單"),
CallerNotRegistered(14, "未呼出-主叫號碼未注冊"),
Terminated(15, "未呼出-被終止"),
VerificationCancelled(16, "未呼出-呼叫前驗證不通過取消"),
OutOfServiceNoCall(17, "未呼出-被叫停機不外呼"),
InArrearsNoCall(18, "未呼出-被叫欠費不外呼"),
CallingNumberNotExist(19, "未呼出-主叫號碼不存在"),
SucceededFinish(20, "已接通-正常完結"),
SucceededChatbotHangUpAfterNoAnswer(21, "已接通-拒識后機器人掛機"),
SucceededChatbotHangUpAfterSilence(22, "已接通-靜默超時掛機"),
SucceededClientHangUpAfterNoAnswer(23, "已接通-拒識后用戶掛機"),
SucceededClientHangUp(24, "已接通-用戶無理由掛機"),
SucceededTransferByIntent(25, "已接通-命中意圖轉人工"),
SucceededTransferAfterNoAnswer(26, "已接通-拒識轉人工"),
SucceededInoInterAction(27, "已接通-用戶側無交互"),
SucceededError(28, "已接通-系統異常中斷"),
SucceededSpecialInterceptVoiceAssistant(29, "已接通-特殊情況攔截-語音助手"),
SucceededSpecialInterceptExtensionNumberTransfer(30, "已接通-特殊情況攔截-分機號轉接")
}
未觸達原因示例值
-JobFailureReason
{
/**
* 未知錯誤
*/
Unknown(0),
/**
* 無人接聽
*/
NoAnswer(1),
/**
* 無效的策略,策略配置不正確
*/
InvalidStrategy(2),
/**
* 調度時發現超時
*/
TimeUp(3),
/**
* 策略為空或沒有找到
*/
NoStrategy(4),
/**
* 呼叫失敗
*/
CallFailed(5),
/**
* 號碼每日呼叫次數限制
*/
PerDayCallCountLimit(6),
/**
* 禁止外呼名單
*/
ContactBlockList(7),
/**
* 空號不再外呼
*/
EmptyNumber(8),
/**
* 號碼每日呼叫次數限制
*/
JobPerDayCallCountLimit(9),
/**
* 呼叫前驗證不通過取消
*/
VerificationCancelled(10),
/**
* 止呼
*/
ContactSuspended(11),
/**
* 欠費
*/
InArrears(12),
/**
* 停機
*/
OutOfService(13),
/**
* 任務最大嘗試次數, 當RepeatBy(@see )為None時生效
*/
NoneRepeatableJobMaxAttemptCountLimit(14);
}