每個 payload 開頭都有Documentation Index
Fetch the complete documentation index at: https://docs.pathors.com/llms.txt
Use this file to discover all available pages before exploring further.
event 欄位指出觸發的事件種類。把 body 當 discriminated union、用這個欄位分流。
Discriminator。
session.ended / call.ended / session.finalized 之一。Pathors session ID。
事件 emit 時的 ISO 8601 timestamp。
session.ended
對話結束時觸發。對 call session,通話的最終狀態跟時長此時可能還沒就緒。
對話結束時 agent 停在的 pathway node。
這個 session 的訊息總數。
這個 session 提取出來的變數,以名稱為 key。
event 在多事件支援之前的 legacy 別名。未來版本會移除 —— 新 receiver 請改用 event。call.ended
通話結束時觸發。Call session 限定 —— text session 不會收到這個事件。
擁有此 agent 的 project ID。
最終 domain status。可能值:
userHangup、agentHangup、transferred、voicemail、errorTransferred、busy、userNoAnswer、userRejected、invalidNumber、sipTrunkFailure、agentNoAnswer、error、unknown、Ended。通話秒數。對於不計費的結束狀態(busy、no-answer、無效號碼)為
0。session.finalized
這個 session 的所有事情都做完時觸發。Payload 已經把原本要從 session.ended 跟 call.ended 各自抓出來的資料合併到同一個 body,receiver 只需處理這一個事件。
對 text session,call 相關欄位(callStatus、callDuration)整個被省略(不是設成 null)。用欄位有沒有來區分 call vs text:
擁有此 agent 的 project ID。
對話結束時 agent 停在的 pathway node。
這個 session 的訊息總數。
這個 session 提取出來的變數。
Call session 限定。 同
call.ended 的 callStatus。Text session 被省略。Call session 限定。 同
call.ended 的 callDuration。Text session 被省略。實作範例
用event 欄位 dispatch 三個事件的 receiver:
順序
訂閱多個事件時,session.finalized 對某個 session 一定最後到。
Call session 的典型順序:
session.endedcall.endedsession.finalized
session.ended 跟 session.finalized 緊接著到。
session.ended 跟 call.ended 在 edge case(例如使用者直接掛斷在 agent 還沒走到結尾節點時)沒有嚴格順序。