-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrewind.go
68 lines (52 loc) · 2.07 KB
/
rewind.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
package main
const rewindClassRewindControl = 0x0000
const rewindClassSystemConsole = 0x0100
const rewindClassApplication = 0x0900
const rewindPacketTypeKeepAlive = (rewindClassRewindControl + 0)
const rewindPacketTypeClose = (rewindClassRewindControl + 1)
const rewindPacketTypeChallenge = (rewindClassRewindControl + 2)
const rewindPacketTypeAuthentication = (rewindClassRewindControl + 3)
const rewindPacketTypeReport = (rewindClassSystemConsole + 0)
const rewindPacketTypeConfiguration = (rewindClassApplication + 0x00)
const rewindPacketTypeSubscription = (rewindClassApplication + 0x01)
const rewindPacketTypeDMRAudioFrame = (rewindClassApplication + 0x20)
const rewindPacketTypeDMRTerminatorWithLC = (rewindClassApplication + 0x12)
const rewindPacketTypeSuperHeader = (rewindClassApplication + 0x28)
const rewindPacketTypeFailureCode = (rewindClassApplication + 0x29)
const rewindProtocolSign = "REWIND01"
const rewindDataLength = (len(rewindProtocolSign) + 10)
type rewindData struct {
Sign [len(rewindProtocolSign)]byte
PacketType uint16 // rewindPacketType*
Flags uint16
SeqNum uint32
PayloadLength uint16
//Payload []byte
}
const rewindRoleApplication = 0x20
const rewindServiceSimpleApplication = (rewindRoleApplication + 0)
const rewindVersionDescription = "Call recorder"
const rewindVersionDataLength = (len(rewindVersionDescription) + 5)
type rewindVersionData struct {
RemoteID uint32
RewindService uint8 // rewindService*
Description [len(rewindVersionDescription)]byte // Software name and version
}
const rewindOptionSuperHeader = (1 << 0)
type rewindConfigurationData struct {
Options uint32 // rewindOption*
}
const rewindSessionTypePrivateVoice = 5
const rewindSessionTypeGroupVoice = 7
type rewindSubscriptionData struct {
SessionType uint32 // rewindSessionType*
DstID uint32
}
const rewindCallLength = 10
type rewindSuperHeader struct {
SessionType uint32 // rewindSessionType*
SrcID uint32
DstID uint32
SrcCall [rewindCallLength]byte
DstCall [rewindCallLength]byte
}