QXmpp  Version:1.3.1
QXmppCallManager.h
1 /*
2  * Copyright (C) 2008-2020 The QXmpp developers
3  *
4  * Author:
5  * Jeremy LainĂ©
6  *
7  * Source:
8  * https://github.com/qxmpp-project/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 #ifndef QXMPPCALLMANAGER_H
25 #define QXMPPCALLMANAGER_H
26 
27 #include "QXmppCall.h"
28 #include "QXmppClientExtension.h"
29 #include "QXmppLogger.h"
30 
31 #include <QIODevice>
32 #include <QMetaType>
33 #include <QObject>
34 
35 class QHostAddress;
36 class QXmppCallManagerPrivate;
37 class QXmppIq;
39 class QXmppJingleIq;
41 class QXmppPresence;
42 
63 
64 class QXMPP_EXPORT QXmppCallManager : public QXmppClientExtension
65 {
66  Q_OBJECT
67 
68 public:
70  ~QXmppCallManager() override;
71  void setStunServers(const QList<QPair<QHostAddress, quint16>> &servers);
72  void setStunServer(const QHostAddress &host, quint16 port = 3478);
73  void setTurnServer(const QHostAddress &host, quint16 port = 3478);
74  void setTurnUser(const QString &user);
75  void setTurnPassword(const QString &password);
76 
78  QStringList discoveryFeatures() const override;
79  bool handleStanza(const QDomElement &element) override;
81 
82 Q_SIGNALS:
87  void callReceived(QXmppCall *call);
88 
90  void callStarted(QXmppCall *call);
91 
92 public Q_SLOTS:
93  QXmppCall *call(const QString &jid);
94 
95 protected:
97  void setClient(QXmppClient *client) override;
99 
100 private Q_SLOTS:
101  void _q_callDestroyed(QObject *object);
102  void _q_disconnected();
103  void _q_iqReceived(const QXmppIq &iq);
104  void _q_jingleIqReceived(const QXmppJingleIq &iq);
105  void _q_presenceReceived(const QXmppPresence &presence);
106 
107 private:
108  QXmppCallManagerPrivate *d;
109  friend class QXmppCall;
110  friend class QXmppCallPrivate;
111  friend class QXmppCallManagerPrivate;
112 };
113 
114 #endif
QXmppJinglePayloadType
The QXmppJinglePayloadType class represents a payload type as specified by XEP-0167: Jingle RTP Sessi...
Definition: QXmppJingleIq.h:40
QXmppPresence
The QXmppPresence class represents an XMPP presence stanza.
Definition: QXmppPresence.h:35
QXmppJingleIq
The QXmppJingleIq class represents an IQ used for initiating media sessions as specified by XEP-0166:...
Definition: QXmppJingleIq.h:153
QXmppJingleCandidate
The QXmppJingleCandidate class represents a transport candidate as specified by XEP-0176: Jingle ICE-...
Definition: QXmppJingleIq.h:84
QXmppClientExtension
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:47
QXmppClientExtension::setClient
virtual void setClient(QXmppClient *client)
Definition: QXmppClientExtension.cpp:79
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition: QXmppClientExtension.cpp:54
QXmppIq
The QXmppIq class is the base class for all IQs.
Definition: QXmppIq.h:41
QXmppClient
The QXmppClient class is the main class for using QXmpp.
Definition: QXmppClient.h:94
QXmppCallManager
The QXmppCallManager class provides support for making and receiving voice calls.
Definition: QXmppCallManager.h:64
QXmppClientExtension::handleStanza
virtual bool handleStanza(const QDomElement &stanza)=0
You need to implement this method to process incoming XMPP stanzas.
QXmppCall
The QXmppCall class represents a Voice-Over-IP call to a remote party.
Definition: QXmppCall.h:43