mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-05-09 20:02:41 +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
|
@ -175,6 +175,13 @@ struct InnerError {
|
||||||
reason: String,
|
reason: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
struct InnerHangup {
|
||||||
|
session_id: JanusId,
|
||||||
|
sender: JanusId,
|
||||||
|
reason: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
struct RoomJoined {
|
struct RoomJoined {
|
||||||
room: JanusId,
|
room: JanusId,
|
||||||
|
@ -240,20 +247,15 @@ struct EventMsg {
|
||||||
|
|
||||||
// IncomingMessage
|
// IncomingMessage
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
#[serde(tag = "janus")]
|
#[serde(tag = "janus", rename_all = "lowercase")]
|
||||||
enum JsonReply {
|
enum JsonReply {
|
||||||
#[serde(rename = "ack")]
|
|
||||||
Ack,
|
Ack,
|
||||||
#[serde(rename = "success")]
|
|
||||||
Success(SuccessMsg),
|
Success(SuccessMsg),
|
||||||
#[serde(rename = "event")]
|
|
||||||
Event(EventMsg),
|
Event(EventMsg),
|
||||||
#[serde(rename = "webrtcup")]
|
|
||||||
WebRTCUp,
|
WebRTCUp,
|
||||||
#[serde(rename = "media")]
|
|
||||||
Media,
|
Media,
|
||||||
#[serde(rename = "error")]
|
|
||||||
Error(InnerError),
|
Error(InnerError),
|
||||||
|
HangUp(InnerHangup),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
@ -519,6 +521,7 @@ impl Signaller {
|
||||||
JsonReply::Error(error) => {
|
JsonReply::Error(error) => {
|
||||||
self.raise_error(format!("code: {}, reason: {}", error.code, error.reason))
|
self.raise_error(format!("code: {}, reason: {}", error.code, error.reason))
|
||||||
}
|
}
|
||||||
|
JsonReply::HangUp(hangup) => self.raise_error(format!("hangup: {}", hangup.reason)),
|
||||||
// ignore for now
|
// ignore for now
|
||||||
JsonReply::Ack | JsonReply::Media => {}
|
JsonReply::Ack | JsonReply::Media => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue