acd_info.h
4.01 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* CC/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "const_define.h"
using namespace std;
class CallDirectT {
public:
enum {
UNKNOWN,
INBOUND,
OUTBOUND
};
private:
int m_value;
public:
CallDirectT(int32_t value);
~CallDirectT();
void set_value(int32_t value);
int32_t get_value();
bool isValid();
};
class ReleaseCauseT {
public:
enum {
UNKNOWN,
THISPARTY,
OTHERPARTY
};
private:
int m_value;
public:
ReleaseCauseT(int32_t value);
~ReleaseCauseT();
void set_value(int32_t value);
int32_t get_value();
bool isValid();
};
struct calldata {
public:
calldata() : m_sessionId(0), m_callId(""), m_agentId(""), m_agentDn(""), m_caller(""),
m_callee(""), m_waitbegin(0), m_waitend(0), m_ackbegin(0), m_ackend(0),
_m_connectbegin(0), _m_connectend(0), m_callbegin(0), m_callend(0),
m_callType(ims::PartyAttributeT::P_Unknown), m_callDirect(CallDirectT::UNKNOWN),
m_releaseCause(ReleaseCauseT::UNKNOWN),
m_recordFilename(""), m_routecall(false){}
calldata(ims::SessionIdT sessionId, ims::CallIdT callId, string agentId, string agentDn,
string skill, string caller, string callee, time_t waitbegin, time_t waitend, time_t ackbegin,
time_t ackend, time_t connectbegin, time_t connectend, time_t callbegin,
time_t callend, ims::PartyAttributeT callType, CallDirectT callDirect,
ReleaseCauseT releaseCause, string recordFilename, bool routecall)
: m_sessionId(sessionId), m_callId(callId), m_agentId(agentId), m_agentDn(agentDn),
m_skill(skill), m_caller(caller),
m_callee(callee), m_waitbegin(waitbegin), m_waitend(waitend), m_ackbegin(ackbegin), m_ackend(ackend),
_m_connectbegin(connectbegin), _m_connectend(connectend), m_callbegin(callbegin), m_callend(callend),
m_callType(callType), m_callDirect(callDirect),
m_releaseCause(releaseCause), m_recordFilename(recordFilename), m_routecall(routecall){}
public:
ims::SessionIdT m_sessionId;
ims::CallIdT m_callId;
string m_agentId;
string m_agentDn;
string m_skill;
string m_caller;
string m_callee;
time_t m_waitbegin;
time_t m_waitend;
time_t m_ackbegin;
time_t m_ackend;
time_t _m_connectbegin;//other altering begin
time_t _m_connectend;//other alerting end
time_t m_callbegin;
time_t m_callend;
ims::PartyAttributeT m_callType;
CallDirectT m_callDirect;
ReleaseCauseT m_releaseCause;
string m_recordFilename;
bool m_routecall;
};
typedef bgcc::SharedPtr<calldata> calldata_ptr;
class callinfo : private calldata{
public:
callinfo();
~callinfo();
void Initial(ims::SessionIdT sessionId, const ims::CallIdT& callId, const string& agentId,
const string& agentDn, const string& skill, const string& caller, const string& callee,
time_t waitbegin, time_t waitend);
void SetAniDnis(const string& caller, const string& callee);
void SetAckBegin(time_t t);
void SetAckEnd(time_t t);
void SetConnectBegin(time_t t);
void SetConnectEnd(time_t t);
void SetCallBegin(time_t t);
void SetCallEnd(time_t t);
void SetCallType(const ims::PartyAttributeT& callType);
void SetCallDirect(int32_t callDirect);
void SetReleaseCause(int32_t releaseCause);
void SetRecordFilename(const string& recordFilename);
void SetRoutecall();
bool GetRoutecall();
bool isValid();
void reset();
void WriteCallLog();
void AddDataToCollection();
};