API 參考

接收事件

call.ended

call.ended 代表通話已結束,包含 data.call.id、reason 同 duration_seconds。喺 subscribed_events 列出 call.ended 就可以收到外撥結束事件。

事件載荷

{
  "id": "evt_call_example",
  "type": "call.ended",
  "provider": "whatsapp",
  "account_id": "acc_example",
  "occurred_at": "2026-10-10T12:00:42Z",
  "data": {
    "call": {
      "id": "call_example",
      "direction": "outbound",
      "media_type": "voice",
      "state": "ended"
    },
    "reason": "remote_hangup",
    "duration_seconds": 42
  }
}

備註

  • call.ended 代表通話已結束,包含 data.call.id、reason 同 duration_seconds。喺 subscribed_events 列出 call.ended 就可以收到外撥結束事件。
  • 一般工作區要喺 subscribed_events 明確列出 call.answered、call.ended,先可以收到相應外撥事件。內測工作區亦可以用 *、空陣列或省略訂閱。投遞、重試同死信重播時會重新核對資格同訂閱。message.* 通話記錄獨立。
  • duration_seconds 係接通秒數,向下取整;0 未必代表未接通,應同時記錄 call.answered。建立階段同步失敗可能沒有 call.ended。本事件唔等同聊天系統訊息。