diff --git a/sip/SipServer.cpp b/sip/SipServer.cpp index 663d850..7442d91 100644 --- a/sip/SipServer.cpp +++ b/sip/SipServer.cpp @@ -555,7 +555,7 @@ void SipServer::response_message(eXosip_event_t *evtp) { return; } - // std::cout << CmdType << std::endl; + LOG_INFO("CmdType={},DeviceID={}", CmdType, DeviceID); if(!strcmp(CmdType, "Catalog")) { this->response_message_answer(evtp,200); @@ -580,13 +580,15 @@ void SipServer::response_message(eXosip_event_t *evtp) { m_device_map[info.id] = info; } else if(!strcmp(CmdType, "Keepalive")){ - this->response_message_answer(evtp,200); - LOG_INFO("CmdType={},DeviceID={}", CmdType, DeviceID); std::lock_guard l_c(m_client_map_mtx); auto it = mClientMap.find(DeviceID); if (it != mClientMap.end()) { + response_message_answer(evtp,200); it->second->updateHeartBeat(Utools::get_cur_time_ms()); return ; + } else { + // 未注册设备发保活信息,超过设备的最大超时次数后,设备将进行初始注册 + response_message_answer(evtp,408); } }else{ this->response_message_answer(evtp,200);