From 0a3f7c3ac8c43c5125a9f8d91306a915d4e47431 Mon Sep 17 00:00:00 2001 From: Claudio Costa Date: Tue, 9 Jan 2024 14:16:36 -0600 Subject: [PATCH] Handle wsEventJobStop (#127) --- client/client.go | 1 + client/websocket.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/client/client.go b/client/client.go index 1c89229..27a3a12 100644 --- a/client/client.go +++ b/client/client.go @@ -24,6 +24,7 @@ const ( WSDisconnectEvent = "WSDisconnect" WSCallJoinEvent = "WSCallJoin" WSCallRecordingState = "WSCallRecordingState" + WSJobStopEvent = "WSStopJobEvent" RTCConnectEvent = "RTCConnect" RTCDisconnectEvent = "RTCDisconnect" RTCTrackEvent = "RTCTrack" diff --git a/client/websocket.go b/client/websocket.go index ea0fbfd..01aedec 100644 --- a/client/websocket.go +++ b/client/websocket.go @@ -38,6 +38,7 @@ const ( wsEventUserLeft = wsEvPrefix + "user_left" wsEventCallEnd = wsEvPrefix + "call_end" wsEventCallRecordingState = wsEvPrefix + "call_recording_state" + wsEventJobStop = wsEvPrefix + "job_stop" ) var ( @@ -190,6 +191,9 @@ func (c *Client) handleWSMsg(msg ws.Message) error { var recState CallJobState recState.FromMap(data) c.emit(WSCallRecordingState, recState) + case wsEventJobStop: + jobID, _ := ev.GetData()["job_id"].(string) + c.emit(WSJobStopEvent, jobID) default: } case ws.BinaryMessage: