QXmpp: QXmppCallManager_p.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppCallManager_p.h
1// SPDX-FileCopyrightText: 2019 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_P_H
8#define QXMPPCALLMANAGER_P_H
9
10#include "QXmppCall.h"
11#include "QXmppExternalService.h"
12#include "QXmppPromise.h"
13#include "QXmppStunServer.h"
14#include "QXmppTurnServer.h"
15
16#include "Async.h"
17
18#include <QDateTime>
19
20class QXmppCallManager;
21class QXmppJingleReason;
22
23//
24// W A R N I N G
25// -------------
26//
27// This file is not part of the QXmpp API.
28// This header file may change from version to version without notice,
29// or even be removed.
30//
31// We mean it.
32//
33
34namespace QXmpp::Private {
35
36struct StunServerConfig {
37 StunServer server;
38 std::optional<QDateTime> expires;
39};
40
41struct TurnServerConfig {
42 TurnServer server;
43 std::optional<QDateTime> expires;
44};
45
46struct StunTurnConfig {
47 QList<StunServerConfig> stun;
48 std::optional<TurnServerConfig> turn;
49};
50
51using ServiceResult = std::variant<QXmppExternalService, QXmppError>;
52using ServicesResult = std::variant<QVector<QXmppExternalService>, QXmppError>;
53QXmppTask<ServicesResult> requestExternalServices(QXmppClient *client, const QString &jid);
54QXmppTask<ServiceResult> requestCredentials(QXmppClient *client, const QString &jid, const QString &type, const QString &host);
55
56using StunTurnResult = std::variant<StunTurnConfig, QXmppError>;
57QXmppTask<StunTurnResult> requestStunTurnConfig(QXmppClient *client, QXmppLoggable *context);
58
59} // namespace QXmpp::Private
60
61class QXmppCallManagerPrivate
62{
63public:
64 explicit QXmppCallManagerPrivate(QXmppCallManager *qq);
65
66 void addCall(QXmppCall *call);
67 QList<QXmpp::StunServer> stunServers() const;
68 std::optional<QXmpp::TurnServer> turnServer() const;
69
70 QList<QXmppCall *> calls;
71
72 // STUN/TURN config
73 std::optional<QXmpp::Private::MultiPromise<void>> refreshStunTurnConfigPromise;
74 std::optional<QXmpp::Private::StunTurnConfig> stunTurnServers;
75 QList<QXmpp::StunServer> fallbackStunServers;
76 std::optional<QXmpp::TurnServer> fallbackTurnServer;
77
78 bool dtlsRequired = false;
79 bool supportsDtls = false;
80
81private:
82 QXmppCallManager *q;
83};
84
85#endif
QXmppCallManager
The QXmppCallManager class provides support for making and receiving voice calls.
Definition QXmppCallManager.h:25
QXmppJingleReason
Definition QXmppJingleData.h:352