forked from DeWarner/kalbi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.go
45 lines (40 loc) · 1.1 KB
/
interfaces.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
package interfaces
import (
"github.com/CanisLupusHUN/kalbi/sip/message"
)
// SipListener interface for sip listener i.e. Your Application
type SipListener interface {
HandleRequests(SipEventObject)
HandleResponses(SipEventObject)
}
// Transaction interface for SIP transactions
type Transaction interface {
GetBranchID() string
GetOrigin() *message.SipMsg
SetListeningPoint(ListeningPoint)
Send(*message.SipMsg, string, string)
Receive(*message.SipMsg)
GetLastMessage() *message.SipMsg
GetServerTransactionID() string
SetLastMessage(*message.SipMsg)
GetListeningPoint() ListeningPoint
}
// SipEventObject interface for SIP events
type SipEventObject interface {
GetSipMessage() *message.SipMsg
SetSipMessage(*message.SipMsg)
GetTransaction() Transaction
SetTransaction(Transaction)
SetListeningPoint(ListeningPoint)
GetListeningPoint() ListeningPoint
}
// ListeningPoint interface for listening point
type ListeningPoint interface {
Read() SipEventObject
Build(string, int)
Start()
GetHost() string
GetPort() int
SetTransportChannel(chan SipEventObject)
Send(string, string, string) error
}