-
Notifications
You must be signed in to change notification settings - Fork 0
/
MetaVoIP.h
80 lines (66 loc) · 1.71 KB
/
MetaVoIP.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef METAVOIP_H
#define METAVOIP_H
#include "MyAccount.h"
#include "MyCall.h"
#include <pjsua2.hpp>
#include <QString>
#include <QDebug>
#include <QObject>
extern "C" {
#include <pjlib.h>
#include <pjlib-util.h>
#include <pjmedia.h>
#include <pjmedia-codec.h>
#include <pjsip.h>
#include <pjsip_simple.h>
#include <pjsip_ua.h>
#include <pjsua-lib/pjsua.h>
}
class MyAccount;
class MyCall;
class MetaVoIP: public QObject
{
Q_OBJECT
public:
MetaVoIP(QString protocol, int port, QObject *parent = 0);
~MetaVoIP();
void createAccount(QString idUri, QString registrarUri, QString user, QString password);
void registerAccount();
void unregisterAccount();
void makeCall(QString number);
bool hangupCall(int callId);
void acceptCall(int callId);
bool holdCall(int callId);
bool transferCall(QString destination);
void ring(int callId);
void sendDtmf(QString num);
inline bool isLoaded()
{
return loaded;
}
inline long getConnectDuration()
{
return connectDuration;
}
inline void setConnectDuration(long connectDuration)
{
this->connectDuration = connectDuration;
}
void emitRegStateStarted(bool status);
void emitRegStateChanged(bool status);
void emitCallStateChanged(int role, int callId, int state, int status, QString remoteUri);
signals:
void regStateStarted(bool status);
void regStateChanged(bool status);
void callStateChanged(int role, int callId, int state, int status, QString remoteUri);
private:
EpConfig epCfg;
Endpoint ep;
TransportConfig tCfg;
AccountConfig aCfg;
MyAccount *account;
MyCall *call;
bool loaded;
int connectDuration;
};
#endif // METAVOIP_H