Skip to content

Commit

Permalink
Handle wsEventJobStop (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 authored Jan 9, 2024
1 parent 72f0625 commit 0a3f7c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const (
WSDisconnectEvent = "WSDisconnect"
WSCallJoinEvent = "WSCallJoin"
WSCallRecordingState = "WSCallRecordingState"
WSJobStopEvent = "WSStopJobEvent"
RTCConnectEvent = "RTCConnect"
RTCDisconnectEvent = "RTCDisconnect"
RTCTrackEvent = "RTCTrack"
Expand Down
4 changes: 4 additions & 0 deletions client/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
wsEventUserLeft = wsEvPrefix + "user_left"
wsEventCallEnd = wsEvPrefix + "call_end"
wsEventCallRecordingState = wsEvPrefix + "call_recording_state"
wsEventJobStop = wsEvPrefix + "job_stop"
)

var (
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0a3f7c3

Please sign in to comment.