summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-08-10 11:21:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-08-10 11:21:34 +0300
commit2a3f0441688ec79c87a28d8526d6d59668497ebd (patch)
tree281322e383da316f2c64495fee4500841cfc6441
parent7d9292bacb479f34275a4194c94f61edb7b15ad5 (diff)
Jabber: Jingle DROP command support
-rw-r--r--protocols/JabberG/src/jabber_proto.h2
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp4
-rw-r--r--protocols/JabberG/src/jabber_voip.cpp12
3 files changed, 13 insertions, 5 deletions
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index dc31a60dd2..d01ed55d6b 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -897,7 +897,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
bool OnICECandidate(const TiXmlElement *Node, const char *from);
bool OnRTPDescription(const TiXmlElement *Node);
bool VOIPCreatePipeline();
- bool VOIPTerminateSession();
+ bool VOIPTerminateSession(const char *reason = "cancel");
bool VOIPCallAccept(const TiXmlElement *jingleNode, const char *from);
bool VOIPCallIinitiate(MCONTACT hContact);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index bfe3fa8c97..7870c6f7ba 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1860,9 +1860,7 @@ bool CJabberProto::OnProcessJingle(const TiXmlElement *node)
vc.state = VOICE_STATE_ENDED;
NotifyEventHooks(m_hVoiceEvent, WPARAM(&vc), 0);
- VOIPTerminateSession();
- m_voipSession.Empty();
- m_voipPeerJid.Empty();
+ VOIPTerminateSession(nullptr);
return true;
}
}
diff --git a/protocols/JabberG/src/jabber_voip.cpp b/protocols/JabberG/src/jabber_voip.cpp
index a982f86066..2262466334 100644
--- a/protocols/JabberG/src/jabber_voip.cpp
+++ b/protocols/JabberG/src/jabber_voip.cpp
@@ -348,7 +348,7 @@ err:
return FALSE;
}
-bool CJabberProto::VOIPTerminateSession()
+bool CJabberProto::VOIPTerminateSession(const char *reason)
{
if (m_pipe1) {
gst_element_set_state(GST_ELEMENT(m_pipe1), GST_STATE_NULL);
@@ -357,6 +357,16 @@ bool CJabberProto::VOIPTerminateSession()
gst_print("Pipeline stopped\n");
}
+ if (reason && !m_voipSession.IsEmpty() && !m_voipPeerJid.IsEmpty()) {
+ XmlNodeIq iq("set", SerialNext(), m_voipPeerJid);
+ TiXmlElement *jingleNode = iq << XCHILDNS("jingle", JABBER_FEAT_JINGLE);
+ jingleNode << XATTR("action", "session-terminate") << XATTR("sid", m_voipSession);
+ jingleNode << XATTR("initiator", m_isOutgoing ? m_ThreadInfo->fullJID : m_voipPeerJid);
+ jingleNode << XCHILD("reason") << XCHILD(reason);
+
+ m_ThreadInfo->send(iq);
+ }
+
m_voipICEPwd.Empty();
m_voipICEUfrag.Empty();
m_medianame.Empty();