-
Notifications
You must be signed in to change notification settings - Fork 18
/
connect.go
49 lines (42 loc) · 827 Bytes
/
connect.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
package connect
import (
"time"
log "github.com/sirupsen/logrus"
)
// Direction int
type Direction int
// Direction out or in
const (
In Direction = iota
Out
)
// Call struct
type Call struct {
LID string
Dir Direction
CID string
DID string
Ext string
TimeCall time.Time
TimeDial time.Time
TimeAnswer time.Time
Ch string
ChDest string
Rec string
Vote string
O bool
Log *log.Entry
}
// OrigFunc ?
type OrigFunc func(ext string, dest string, oID string)
// Connecter interface
type Connecter interface {
Init()
Start(call *Call)
OrigStart(call *Call, oID string)
Dial(call *Call, ext string)
StopDial(call *Call, ext string)
Answer(call *Call, ext string)
End(call *Call, cause string)
SetOriginate(orig OrigFunc)
}