mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-21 08:28:14 +00:00
webrtc: janus: handle 'hangup' messages from Janus
Fix error about this message not being handled: { "janus": "hangup", "session_id": 4758817463851315, "sender": 4126342934227009, "reason": "Close PC" } Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1481>
This commit is contained in:
parent
992f8d9a5d
commit
8f997ea4e3
1 changed files with 10 additions and 7 deletions
|
@ -175,6 +175,13 @@ struct InnerError {
|
|||
reason: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
struct InnerHangup {
|
||||
session_id: JanusId,
|
||||
sender: JanusId,
|
||||
reason: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
struct RoomJoined {
|
||||
room: JanusId,
|
||||
|
@ -240,20 +247,15 @@ struct EventMsg {
|
|||
|
||||
// IncomingMessage
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[serde(tag = "janus")]
|
||||
#[serde(tag = "janus", rename_all = "lowercase")]
|
||||
enum JsonReply {
|
||||
#[serde(rename = "ack")]
|
||||
Ack,
|
||||
#[serde(rename = "success")]
|
||||
Success(SuccessMsg),
|
||||
#[serde(rename = "event")]
|
||||
Event(EventMsg),
|
||||
#[serde(rename = "webrtcup")]
|
||||
WebRTCUp,
|
||||
#[serde(rename = "media")]
|
||||
Media,
|
||||
#[serde(rename = "error")]
|
||||
Error(InnerError),
|
||||
HangUp(InnerHangup),
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
@ -519,6 +521,7 @@ impl Signaller {
|
|||
JsonReply::Error(error) => {
|
||||
self.raise_error(format!("code: {}, reason: {}", error.code, error.reason))
|
||||
}
|
||||
JsonReply::HangUp(hangup) => self.raise_error(format!("hangup: {}", hangup.reason)),
|
||||
// ignore for now
|
||||
JsonReply::Ack | JsonReply::Media => {}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue