diff options
author | George Hazan <george.hazan@gmail.com> | 2024-09-04 18:26:39 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-09-04 18:26:39 +0300 |
commit | b14a944f6d3b3f8e2c7fa3b10850a72e785d572f (patch) | |
tree | 8c0c2773b12451f16e26fd4544fd3dd89b975924 /plugins | |
parent | e3e89f1237a1adc7bf71824c113e4ad7c5d34cfe (diff) |
Jingle: more checks
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Jingle/src/voip.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/Jingle/src/voip.cpp b/plugins/Jingle/src/voip.cpp index e84b1ea01a..017d613587 100644 --- a/plugins/Jingle/src/voip.cpp +++ b/plugins/Jingle/src/voip.cpp @@ -376,14 +376,21 @@ bool CJabberAccount::OnRTPDescription(const TiXmlElement *jingleNode) // process remote offer auto *content = XmlGetChildByTag(jingleNode, "content", "creator", "initiator"); - auto *transport = XmlGetChildByTag(content, "transport", "xmlns", "urn:xmpp:jingle:transports:ice-udp:1"); auto *description = XmlGetChildByTag(content, "description", "xmlns", "urn:xmpp:jingle:apps:rtp:1"); auto *source = XmlGetChildByTag(description, "source", "xmlns", "urn:xmpp:jingle:apps:rtp:ssma:0"); CMStringA sdp_string(FORMAT, "v=0\r\no=- 0 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=ice-options:trickle\r\n" - "m=audio 9 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:%s\r\na=ice-pwd:%s\r\na=rtcp-mux\r\na=sendrecv\r\na=rtpmap:111 OPUS/48000/2\r\n" - "a=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\n", - XmlGetAttr(transport, "ufrag"), XmlGetAttr(transport, "pwd")); + "m=audio 9 UDP/TLS/RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=rtcp-mux\r\na=sendrecv\r\na=rtpmap:111 OPUS/48000/2\r\n" + "a=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\n"); + + if (auto *transport = XmlGetChildByTag(content, "transport", "xmlns", "urn:xmpp:jingle:transports:ice-udp:1")) { + sdp_string.AppendFormat("a=ice-ufrag:%s\r\na=ice-pwd:%s\r\n", + XmlGetAttr(transport, "ufrag"), XmlGetAttr(transport, "pwd")); + + if (auto *pFinger = XmlFirstChild(transport, "fingerprint")) + sdp_string.AppendFormat("a=setup:%s\r\na=fingerprint:sha-256 %s\r\n", + XmlGetAttr(pFinger, "setup"), pFinger->GetText()); + } if (source) { sdp_string.AppendFormat("a=ssrc:%s msid:%s\r\na=ssrc:%s cname:%s\r\n", @@ -393,10 +400,7 @@ bool CJabberAccount::OnRTPDescription(const TiXmlElement *jingleNode) XmlGetAttr(XmlGetChildByTag(source, "parameter", "name", "cname"), "value")); } - sdp_string.AppendFormat("a=mid:%s\r\na=setup:%s\r\na=fingerprint:sha-256 %s\r\na=rtcp-mux-only\r\n", - XmlGetAttr(content, "name"), - XmlGetAttr(XmlFirstChild(transport, "fingerprint"), "setup"), - XmlFirstChild(transport, "fingerprint")->GetText()); + sdp_string.AppendFormat("a=mid:%s\r\nna=rtcp-mux-only\r\n", XmlGetAttr(content, "name")); GstSDPMessage *sdp; int ret = gst_sdp_message_new(&sdp); |