QXmpp: QXmppCallManager.h Source File

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
QXmppCallManager.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2// SPDX-FileCopyrightText: 2019 Niels Ole Salscheider <ole@salscheider.org>
3// SPDX-FileCopyrightText: 2025 Linus Jahn <lnj@kaidan.im>
4//
5// SPDX-License-Identifier: LGPL-2.1-or-later
6
7#ifndef QXMPPCALLMANAGER_H
8#define QXMPPCALLMANAGER_H
9
10#include "QXmppClientExtension.h"
11#include "QXmppTask.h"
12
13class QXmppCall;
14class QXmppCallManagerPrivate;
15class QXmppIq;
16class QXmppJingleIq;
17class QXmppPresence;
18
19namespace QXmpp {
20struct StunServer;
21struct TurnServer;
22} // namespace QXmpp
23
24 class QXMPP_EXPORT QXmppCallManager : public QXmppClientExtension
25{
26 Q_OBJECT
27
28public:
30 enum class Media {
31 Audio,
32 AudioVideo,
33 };
34
35 QXmppCallManager();
36 ~QXmppCallManager() override;
37
38 void setFallbackStunServers(const QList<QXmpp::StunServer> &);
39 void setFallbackTurnServer(const std::optional<QXmpp::TurnServer> &);
40 bool dtlsRequired() const;
41 void setDtlsRequired(bool);
42
44 QStringList discoveryFeatures() const override;
45 bool handleStanza(const QDomElement &element) override;
47
48 Q_SIGNAL void callReceived(std::unique_ptr<QXmppCall> &call);
49
50 std::unique_ptr<QXmppCall> call(const QString &jid, Media media = Media::Audio, const QString &proposedSid = {});
51
52protected:
54 void onRegistered(QXmppClient *client) override;
55 void onUnregistered(QXmppClient *client) override;
57
58private:
59 void onCallDestroyed(QObject *object);
60 void onDisconnected();
61 using IncomingIqResult = std::variant<QXmppIq, QXmppStanza::Error, QXmppTask<std::variant<QXmppIq>>>;
62 IncomingIqResult handleIq(QXmppJingleIq &&iq);
63 void onPresenceReceived(const QXmppPresence &presence);
64 QXmppTask<void> refreshStunTurnConfig();
65
66 const std::unique_ptr<QXmppCallManagerPrivate> d;
67 friend class QXmppCall;
68 friend class QXmppCallPrivate;
69 friend class QXmppCallManagerPrivate;
70 friend class tst_QXmppCallManager;
71};
72
73#endif
QXmppCall
Definition QXmppCall.h:24
QXmppCallManager
The QXmppCallManager class provides support for making and receiving voice calls.
Definition QXmppCallManager.h:25
QXmppCallManager::setDtlsRequired
void setDtlsRequired(bool)
Definition QXmppCallManager.cpp:483
QXmppCallManager::dtlsRequired
bool dtlsRequired() const
Definition QXmppCallManager.cpp:472
QXmppCallManager::setFallbackTurnServer
void setFallbackTurnServer(const std::optional< QXmpp::TurnServer > &)
Definition QXmppCallManager.cpp:323
QXmppCallManager::Media
Media
Media type for starting a call.
Definition QXmppCallManager.h:30
QXmppCallManager::QXmppCallManager
QXmppCallManager()
Definition QXmppCallManager.cpp:283
QXmppCallManager::call
std::unique_ptr< QXmppCall > call(const QString &jid, Media media=Media::Audio, const QString &proposedSid={})
Definition QXmppCallManager.cpp:377
QXmppCallManager::~QXmppCallManager
~QXmppCallManager() override
QXmppCallManager::callReceived
Q_SIGNAL void callReceived(std::unique_ptr< QXmppCall > &call)
QXmppCallManager::setFallbackStunServers
void setFallbackStunServers(const QList< QXmpp::StunServer > &)
Definition QXmppCallManager.cpp:301
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppClientExtension::onUnregistered
virtual void onUnregistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:95
QXmppClientExtension::onRegistered
virtual void onRegistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:85
QXmppClientExtension::QXmppClientExtension
QXmppClientExtension()
Definition QXmppClientExtension.cpp:12
QXmppClientExtension::handleStanza
virtual bool handleStanza(const QDomElement &stanza)
You need to implement this method to process incoming XMPP stanzas.
Definition client/compat/removed_api.cpp:44
QXmppClient
Main class for starting and managing connections to XMPP servers.
Definition QXmppClient.h:62
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition QXmppIq.h:23
QXmppJingleIq
The QXmppJingleIq class represents an IQ used for initiating media sessions as specified by XEP-0166:...
Definition QXmppJingleData.h:439
QXmppPresence
The QXmppPresence class represents an XMPP presence stanza.
Definition QXmppPresence.h:22
QXmppTask
Definition QXmppTask.h:46
QXmpp
Definition Algorithms.h:14
QXmpp::StunServer
STUN server address.
Definition QXmppStunServer.h:19
QXmpp::TurnServer
TURN server address.
Definition QXmppTurnServer.h:19