sip_header.h
3.52 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
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
#ifndef __SIP_HEADER_H__
#define __SIP_HEADER_H__
#include <string>
using namespace std;
enum EEventType
{
EVENT_ON = 0, // 上线
EVENT_OFF, // 离线
EVENT_VLOST, // 视频丢失
EVENT_DEFECT, // 故障
EVENT_ADD, // 增加
EVENT_DEL, // 删除
EVENT_UPDATE, // 更新
EVENT_UNKNOW,
};
struct DeviceInfo
{
EEventType event;
std::string id{""};
std::string name;
std::string manufacturer;
std::string model;
std::string owner;
std::string civil;
std::string block;
std::string address;
std::string safetyway;
std::string registerway;
std::string certnum;
std::string certifiable;
std::string errcode;
std::string secrecy;
std::string parental;
std::string parentid;
std::string endtime;
std::string ip;
std::string port;
std::string password;
std::string status;
std::string longitude;
std::string latitude;
std::string ptz;
std::string position;
std::string room;
std::string use;
std::string supplylight;
std::string direction;
std::string resolution;
std::string businessgroup;
};
class ServerInfo {
public:
ServerInfo() {}
ServerInfo(string ua,string nonce, string ip, int port,
string sipId, string sipRealm, string sipPass, int sipTimeout, int sipExpiry, int minRtpPort, int maxRtpPort, int ws_port):
mUa(ua),mNonce(nonce),mIp(ip),mPort(port),mSipId(sipId),
mSipRealm(sipRealm),mSipPass(sipPass),mSipTimeout(sipTimeout),
mSipExpiry(sipExpiry),mMinRtpPort(minRtpPort),mMaxRtpPort(maxRtpPort),mWsPort(ws_port){}
~ServerInfo() = default;
public:
string getUa() const{
return mUa;
}
void setUa(string ua) {
mUa = ua;
}
string getNonce() const{
return mNonce;
}
void setNonce(string nonce) {
mNonce = nonce;
}
string getIp() const{
return mIp;
}
void setIp(string s) {
mIp = s;
}
int getPort() const {
return mPort;
}
void setPort(int i) {
mPort = i;
}
string getSipId() const{
return mSipId;
}
void setSipId(string s) {
mSipId = s;
}
string getSipRealm() const{
return mSipRealm;
}
void setSipRealm(string s) {
mSipRealm = s;
}
string getSipPass() const{
return mSipPass;
}
void setSipPass(string s) {
mSipPass = s;
}
bool isNoAuth() {
if (mSipPass.empty()) {
return true;
}
return false;
}
int getTimeout() const {
return mSipTimeout;
}
void setTimeout(int i) {
mSipTimeout = i;
}
int getExpiry() const {
return mSipExpiry;
}
void setExpiry(int i) {
mSipExpiry = i;
}
int getMinRtpPort() const {
return mMinRtpPort;
}
void setMinRtpPort(int i) {
mMinRtpPort = i;
}
int getMaxRtpPort() const {
return mMaxRtpPort;
}
void setMaxRtpPort(int i) {
mMaxRtpPort = i;
}
int getWsPort() const {
return mWsPort;
}
void setWsPort(int i) {
mWsPort = i;
}
private:
string mUa;
string mNonce;//SIP服务随机数值
string mIp;//SIP服务IP
int mPort{0};//SIP服务端口
string mSipId; //SIP服务器ID
string mSipRealm;//SIP服务器域
string mSipPass{""};//SIP password
int mSipTimeout; //SIP timeout
int mSipExpiry;// SIP到期
int mMinRtpPort;
int mMaxRtpPort;
int mWsPort;
};
struct CallInfo {
int cid{-1};
int did{-1};
};
#endif //__SIP_HEADER_H__