aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppCallManager.cpp
diff options
context:
space:
mode:
authorNiels Ole Salscheider <niels_ole@salscheider-online.de>2020-03-10 13:19:31 +0100
committerLNJ <lnj@kaidan.im>2020-03-16 22:22:59 +0100
commitbb47e1b9cd2926bed3e63f528e063e462c28975a (patch)
tree1b86c3f9774bc86a55509da35a479c88ca7c49ab /src/client/QXmppCallManager.cpp
parent133c94dcf874162860351e34aa1a92a1d942ad2c (diff)
downloadqxmpp-bb47e1b9cd2926bed3e63f528e063e462c28975a.tar.gz
Allow to set multiple STUN servers
This way we can for example add a server for IPv4 and one IPv6.
Diffstat (limited to 'src/client/QXmppCallManager.cpp')
-rw-r--r--src/client/QXmppCallManager.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/client/QXmppCallManager.cpp b/src/client/QXmppCallManager.cpp
index 8ba97c2d..dba05975 100644
--- a/src/client/QXmppCallManager.cpp
+++ b/src/client/QXmppCallManager.cpp
@@ -38,8 +38,7 @@
#include <QTimer>
QXmppCallManagerPrivate::QXmppCallManagerPrivate(QXmppCallManager *qq)
- : stunPort(0),
- turnPort(0),
+ : turnPort(0),
q(qq)
{
// Initialize GStreamer
@@ -153,16 +152,32 @@ QXmppCall *QXmppCallManager::call(const QString &jid)
return call;
}
-/// Sets the STUN server to use to determine server-reflexive addresses
+/// Sets multiple STUN servers to use to determine server-reflexive addresses
/// and ports.
///
+/// \note This may only be called prior to calling bind().
+///
+/// \param servers List of the STUN servers.
+///
+/// \since QXmpp 1.3
+
+void QXmppCallManager::setStunServers(const QList<QPair<QHostAddress, quint16>> &servers)
+{
+ d->stunServers = servers;
+}
+
+/// Sets a single STUN server to use to determine server-reflexive addresses
+/// and ports.
+///
+/// \note This may only be called prior to calling bind().
+///
/// \param host The address of the STUN server.
/// \param port The port of the STUN server.
void QXmppCallManager::setStunServer(const QHostAddress &host, quint16 port)
{
- d->stunHost = host;
- d->stunPort = port;
+ d->stunServers.clear();
+ d->stunServers.push_back(QPair<QHostAddress, quint16>(host, port));
}
/// Sets the TURN server to use to relay packets in double-NAT configurations.