-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyCall.h
65 lines (50 loc) · 1.3 KB
/
MyCall.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
#ifndef MYCALL_H
#define MYCALL_H
#include <pjsua2.hpp>
#include "MetaVoIP.h"
using namespace pj;
class MetaVoIP;
class MyCall : public Call
{
public:
MyCall(MetaVoIP *parent, Account &acc, int call_id = PJSUA_INVALID_ID)
: Call(acc, call_id)
{
this->parent = parent;
this->hold = false;
#ifdef Q_OS_ANDROID
this->audioMedia = nullptr;
this->captureMedia = nullptr;
#else
this->audioMedia = 0;
this->captureMedia = 0;
#endif
}
~MyCall()
{
this->audioMedia = nullptr;
this->captureMedia = nullptr;
parent = nullptr;
}
// Notification when call's state has changed.
virtual void onCallState(OnCallStateParam &prm);
virtual void onCallMediaState(OnCallMediaStateParam &prm);
virtual void onCallTransferRequest(OnCallTransferRequestParam &prm);
virtual void onCallTransferStatus(OnCallTransferStatusParam &prm);
virtual void onCallReplaceRequest(OnCallReplaceRequestParam &prm);
// virtual void onCallRxOffer(OnCallRxOfferParam &prm);
inline bool isOnHold()
{
return hold;
}
inline void setHoldTo(bool hold)
{
this->hold = hold;
}
private:
MetaVoIP *parent;
AudioMedia *audioMedia;
AudioMedia *captureMedia;
bool hold;
};
#endif // MYCALL_H