diff --git a/bin/sip_server_cfg.xml b/bin/sip_server_cfg.xml
index a0ea699..cbc3ce0 100644
--- a/bin/sip_server_cfg.xml
+++ b/bin/sip_server_cfg.xml
@@ -3,10 +3,10 @@
SY_Sip_Server
12345678
192.168.60.179
- 15060
+ 5060
34020000002000000002
3402000000
- sy123456
+
1800
3600
9006
diff --git a/sip/SipServer.cpp b/sip/SipServer.cpp
index 60cf414..663d850 100644
--- a/sip/SipServer.cpp
+++ b/sip/SipServer.cpp
@@ -96,6 +96,12 @@ bool SipServer::Init(ServerInfo* pInfo, WebSocketServer* pServer) {
mInfo = *pInfo;
+ if (mInfo.isNoAuth()) {
+ LOG_INFO("do not need password");
+ } else {
+ LOG_INFO("need password");
+ }
+
m_pWsServer = pServer;
m_event_loop_thread = new std::thread(event_loop_thread, this);
@@ -493,8 +499,9 @@ void SipServer::cacheClient(osip_uri_t *url, int expiry) {
RequestCatalog(client);
} else if (type >= 131 && type <= 199) {
RequestDeviceInfo(client);
- }
- else {
+ } else if (type >= 200 && type <= 299) {
+ RequestCatalog(client);
+ } else {
LOG_WARN("device type is not supported:{}",type);
}
@@ -574,7 +581,7 @@ void SipServer::response_message(eXosip_event_t *evtp) {
} else if(!strcmp(CmdType, "Keepalive")){
this->response_message_answer(evtp,200);
- // LOG_INFO("CmdType={},DeviceID={}", CmdType, DeviceID);
+ LOG_INFO("CmdType={},DeviceID={}", CmdType, DeviceID);
std::lock_guard l_c(m_client_map_mtx);
auto it = mClientMap.find(DeviceID);
if (it != mClientMap.end()) {
@@ -873,9 +880,12 @@ void SipServer::cacheCatalog() {
if (type >= 111 && type <= 130) {
// NVR注册成功,立即请求设备目录
RequestCatalog(client);
- }
- else if (type >= 131 && type <= 199) {
+ } else if (type >= 131 && type <= 199) {
RequestDeviceInfo(client);
+ } else if (type >= 200 && type <= 299) {
+ RequestCatalog(client);
+ } else {
+ LOG_WARN("device type is not supported:{}",type);
}
}