Commit 12040639c849a79d76045415ed056a9d3debff04

Authored by Hu Chunming
1 parent e975618a

未注册但是发保活信息的设备,令其重新注册

Showing 1 changed file with 5 additions and 3 deletions
sip/SipServer.cpp
@@ -555,7 +555,7 @@ void SipServer::response_message(eXosip_event_t *evtp) { @@ -555,7 +555,7 @@ void SipServer::response_message(eXosip_event_t *evtp) {
555 return; 555 return;
556 } 556 }
557 557
558 - // std::cout << CmdType << std::endl; 558 + LOG_INFO("CmdType={},DeviceID={}", CmdType, DeviceID);
559 559
560 if(!strcmp(CmdType, "Catalog")) { 560 if(!strcmp(CmdType, "Catalog")) {
561 this->response_message_answer(evtp,200); 561 this->response_message_answer(evtp,200);
@@ -580,13 +580,15 @@ void SipServer::response_message(eXosip_event_t *evtp) { @@ -580,13 +580,15 @@ void SipServer::response_message(eXosip_event_t *evtp) {
580 m_device_map[info.id] = info; 580 m_device_map[info.id] = info;
581 581
582 } else if(!strcmp(CmdType, "Keepalive")){ 582 } else if(!strcmp(CmdType, "Keepalive")){
583 - this->response_message_answer(evtp,200);  
584 - LOG_INFO("CmdType={},DeviceID={}", CmdType, DeviceID);  
585 std::lock_guard<std::mutex> l_c(m_client_map_mtx); 583 std::lock_guard<std::mutex> l_c(m_client_map_mtx);
586 auto it = mClientMap.find(DeviceID); 584 auto it = mClientMap.find(DeviceID);
587 if (it != mClientMap.end()) { 585 if (it != mClientMap.end()) {
  586 + response_message_answer(evtp,200);
588 it->second->updateHeartBeat(Utools::get_cur_time_ms()); 587 it->second->updateHeartBeat(Utools::get_cur_time_ms());
589 return ; 588 return ;
  589 + } else {
  590 + // 未注册设备发保活信息,超过设备的最大超时次数后,设备将进行初始注册
  591 + response_message_answer(evtp,408);
590 } 592 }
591 }else{ 593 }else{
592 this->response_message_answer(evtp,200); 594 this->response_message_answer(evtp,200);