我正在使用可编程视频。我需要帮助来拦截诸如Task Created,Task Completed之类的事件,以将其记录到数据库以进行故障排除。我无法获得解释相关视频的链接/文档。有什么帮助吗?
答案 0 :(得分:1)
您可以在此处找到有关房间状态回调的详细信息:Rooms Status Callbacks
这是Twilio在创建房间并结束时发送的数据样本:
// created
{
"AccountSid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"RoomName": "MyRoom",
"RoomSid": "RMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"RoomStatus": "in-progress",
"SequenceNumber": 0,
"StatusCallbackEvent": "room-created",
"Timestamp": "2017-09-12T17:29:51.432Z"
}
// ended
{
"AccountSid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"RoomDuration": "952",
"RoomName": "MyRoom",
"RoomSid": "RMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"RoomStatus": "completed",
"SequenceNumber": 15,
"StatusCallbackEvent": "room-ended",
"Timestamp": "2017-09-12T17:45:44.379Z"
}
每个房间的事件都有一个SequenceNumber
,从0开始自动递增。