From 8280a89ad1c7fc80b8484160c67259e62302e042 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 5 Aug 2022 20:26:57 +0300 Subject: Jabber: voip fix --- protocols/JabberG/src/jabber_opt.cpp | 4 ++++ protocols/JabberG/src/jabber_voip.cpp | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index d1d57b26a9..97a9251693 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -762,6 +762,10 @@ public: m_proto->m_omemo.init(); else m_proto->m_omemo.deinit(); + + if (!m_proto->m_bEnableVOIP) + m_proto->VOIPTerminateSession(); + m_proto->UpdateFeatHash(); m_proto->SendPresence(m_proto->m_iStatus, true); return true; diff --git a/protocols/JabberG/src/jabber_voip.cpp b/protocols/JabberG/src/jabber_voip.cpp index 5f80c1c364..fec95780de 100644 --- a/protocols/JabberG/src/jabber_voip.cpp +++ b/protocols/JabberG/src/jabber_voip.cpp @@ -276,6 +276,9 @@ void dbgprint(const gchar *string) bool CJabberProto::VOIPCreatePipeline(void) { + if (!m_bEnableVOIP) + return false; + //gstreamer init static bool gstinited = 0; if (!gstinited) { @@ -347,12 +350,11 @@ err: bool CJabberProto::VOIPTerminateSession() { - gst_print("Terminating session"); if (m_pipe1) { gst_element_set_state(GST_ELEMENT(m_pipe1), GST_STATE_NULL); g_clear_object(&m_pipe1); - gst_print("Pipeline stopped\n"); gst_object_unref(m_pipe1); + gst_print("Pipeline stopped\n"); } m_voipICEPwd.Empty(); @@ -457,12 +459,15 @@ bool CJabberProto::OnICECandidate(const TiXmlElement *Node, const char *) bool CJabberProto::VOIPCallIinitiate(MCONTACT hContact) { - if (m_voipSession != "") { + if (!m_voipSession.IsEmpty()) { VOIPTerminateSession(); MessageBoxA(0, "Terminated", NULL, 0); return 0; } + if (!m_bEnableVOIP) + return false; + CMStringA jid(ptrA(getUStringA(hContact, "jid"))); if (jid == "") return 0; -- cgit v1.2.3