mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-06 01:08:42 +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/1508>
This commit is contained in:
parent
be055f6dfa
commit
a502dba6d5
1 changed files with 10 additions and 7 deletions
|
@ -161,6 +161,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,
|
||||
|
@ -218,20 +225,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)]
|
||||
|
@ -477,6 +479,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