Loading...
Searching...
No Matches
QXmppCallManager.h
// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
// SPDX-FileCopyrightText: 2019 Niels Ole Salscheider <ole@salscheider.org>
// SPDX-FileCopyrightText: 2025 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPCALLMANAGER_H
#define QXMPPCALLMANAGER_H
#include "QXmppClientExtension.h"
#include "QXmppTask.h"
class QXmppCall;
class QXmppCallManagerPrivate;
class QXmppIq;
class QXmppJingleIq;
class QXmppPresence;
namespace QXmpp {
struct StunServer;
struct TurnServer;
} // namespace QXmpp
class QXMPP_EXPORT QXmppCallManager : public QXmppClientExtension
{
Q_OBJECT
public:
enum class Media {
Audio,
AudioVideo,
};
QXmppCallManager();
~QXmppCallManager() override;
void setFallbackStunServers(const QList<QXmpp::StunServer> &);
void setFallbackTurnServer(const std::optional<QXmpp::TurnServer> &);
bool dtlsRequired() const;
void setDtlsRequired(bool);
QStringList discoveryFeatures() const override;
bool handleStanza(const QDomElement &element) override;
Q_SIGNAL void callReceived(std::unique_ptr<QXmppCall> &call);
std::unique_ptr<QXmppCall> call(const QString &jid, Media media = Media::Audio, const QString &proposedSid = {});
protected:
void onRegistered(QXmppClient *client) override;
void onUnregistered(QXmppClient *client) override;
private:
void onCallDestroyed(QObject *object);
void onDisconnected();
using IncomingIqResult = std::variant<QXmppIq, QXmppStanza::Error, QXmppTask<std::variant<QXmppIq>>>;
IncomingIqResult handleIq(QXmppJingleIq &&iq);
void onPresenceReceived(const QXmppPresence &presence);
QXmppTask<void> refreshStunTurnConfig();
const std::unique_ptr<QXmppCallManagerPrivate> d;
friend class QXmppCall;
friend class QXmppCallPrivate;
friend class QXmppCallManagerPrivate;
friend class tst_QXmppCallManager;
};
#endif
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
QXmppCall
Definition QXmppCall.h:24
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