-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
187 lines (172 loc) · 4.77 KB
/
models.go
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
package main
import (
"labix.org/v2/mgo/bson"
"time"
)
type Cdr struct {
calldate time.Time
clid string
src string
dst string
channel string
dcontext string
disposition string
billsec int
duration int
uniqueid string
dstchannel string
recordfile string
waitAnswer int
inoutstatus int
causeStatus int
peer string
did string
}
type Cel struct {
EventTime int64
}
type RawCall struct {
Id bson.ObjectId `bson:"_id"`
AsteriskId string `bson:"asterisk_id"`
Calldate time.Time `bson:"call_date"`
MetadataDt time.Time `bson:"metadata_date"`
ClidName string `bson:"clid_name"`
ClidNumber string `bson:"clid_number"`
Src string `bson:"src"`
Channel string `bson:"channel"`
Dcontext string `bson:"dcontext"`
DispositionStr string `bson:"disposition_str"`
Disposition int `bson:"disposition"`
AnswerWaitTime int `bson:"answer_wait_time"`
Billsec int `bson:"billsec"`
Duration int `bson:"duration"`
Uniqueid string `bson:"uniqueId"`
InoutStatus int `bson:"inout_status"`
RecordFile string `bson:"record_file"`
Dst string `bson:"dst"`
Dnid string `bson:"dnid"`
Dstchannel string `bson:"dst_channel"`
CallDetails []CallDetail `bson:"call_details"`
Peer string `bson:"peer"`
Did string `bson:"did"`
}
type CallDetail struct {
EventType string `bson:"event_type"`
EventTime time.Time `bson:"event_time"`
CidNum string `bson:"cid_num"`
CidDnid string `bson:"cid_dnid"`
Exten string `bson:"exten"`
UniqueId string `bson:"uniqueId"`
LinkedId string `bson:"linkedId"`
Context string `bson:"context"`
Peer string `bson:"peer"`
}
type MetaData struct {
Dst string `bson:"dst"`
Dt time.Time `bson:"dt"`
Disposition int `bson:"disposition"`
}
type DidMetaData struct {
Did string `bson:"did"`
Dt time.Time `bson:"dt"`
}
type DidSummaryCall struct {
Id string `bson:"_id"`
Meta DidMetaData `bson:"metadata"`
Calls int `bson:"calls"`
Missing int `bson:"missing"`
Duration int `bson:"duration"`
}
type PeerMetaData struct {
Peer string `bson:"peer"`
Dt time.Time `bson:"dt"`
}
type PeerSummaryCall struct {
Id string `bson:"_id"`
Meta PeerMetaData `bson:"metadata"`
Calls int `bson:"calls"`
Missing int `bson:"missing"`
Duration int `bson:"duration"`
}
type DatasByHours struct {
H0 int `bson:"0"`
H1 int `bson:"1"`
H2 int `bson:"2"`
H3 int `bson:"3"`
H4 int `bson:"4"`
H5 int `bson:"5"`
H6 int `bson:"6"`
H7 int `bson:"7"`
H8 int `bson:"8"`
H9 int `bson:"9"`
H10 int `bson:"10"`
H11 int `bson:"11"`
H12 int `bson:"12"`
H13 int `bson:"13"`
H14 int `bson:"14"`
H15 int `bson:"15"`
H16 int `bson:"16"`
H17 int `bson:"17"`
H18 int `bson:"18"`
H19 int `bson:"19"`
H20 int `bson:"20"`
H21 int `bson:"21"`
H22 int `bson:"22"`
H23 int `bson:"23"`
}
type DatasByDayOfMonth struct {
D1 int `bson:"1"`
D2 int `bson:"2"`
D3 int `bson:"3"`
D4 int `bson:"4"`
D5 int `bson:"5"`
D6 int `bson:"6"`
D7 int `bson:"7"`
D8 int `bson:"8"`
D9 int `bson:"9"`
D10 int `bson:"10"`
D11 int `bson:"11"`
D12 int `bson:"12"`
D13 int `bson:"13"`
D14 int `bson:"14"`
D15 int `bson:"15"`
D16 int `bson:"16"`
D17 int `bson:"17"`
D18 int `bson:"18"`
D19 int `bson:"19"`
D20 int `bson:"20"`
D21 int `bson:"21"`
D22 int `bson:"22"`
D23 int `bson:"23"`
D24 int `bson:"24"`
D25 int `bson:"25"`
D26 int `bson:"26"`
D27 int `bson:"27"`
D28 int `bson:"28"`
D29 int `bson:"29"`
D30 int `bson:"30"`
D31 int `bson:"31"`
}
type DailyCall struct {
Id string `bson:"_id"`
Meta MetaData `bson:"metadata"`
AnswereWaitTime int `bson:"answer_wait_time"`
CallDaily int `bson:"calls"`
DurationDaily int `bson:"duration"`
CallsHourly DatasByHours `bson:"calls_per_hours"`
DurationsHourly DatasByHours `bson:"durations_per_hours"`
}
type MonthlyCall struct {
Id string `bson:"_id"`
Meta MetaData `bson:"metadata"`
AnswereWaitTime int `bson:"answer_wait_time"`
CallMonthly int `bson:"calls"`
DurationMonthly int `bson:"duration"`
CallsDaily DatasByDayOfMonth `bson:"calls_per_days"`
DurationsDaily DatasByDayOfMonth `bson:"durations_per_days"`
}
type Did struct {
Did string `bson:"did" json:"did"`
Value string `json:"value" bson:"value"`
Comment string `json:"comment" bson:"comment"`
}