diff --git a/apps/db_reg_agent/DBRegAgent.cpp b/apps/db_reg_agent/DBRegAgent.cpp index aa878254..c2ee4ca9 100644 --- a/apps/db_reg_agent/DBRegAgent.cpp +++ b/apps/db_reg_agent/DBRegAgent.cpp @@ -388,6 +388,7 @@ void DBRegAgent::createRegistration(long subscriber_id, registrations_mut.unlock(); WARN("registration with ID %ld already exists, removing\n", subscriber_id); removeRegistration(subscriber_id); + clearRegistrationTimer(subscriber_id); registrations_mut.lock(); } @@ -822,6 +823,12 @@ void DBRegAgent::onSipReplyEvent(AmSipReplyEvent* ev) { } } + if (registration->getUnregistering()) { + registrations_mut.unlock(); + removeRegistration(subscriber_id); + registrations_mut.lock(); + } + if (!delete_status) { if (auth_pending && !save_auth_replies) { DBG("not updating DB with auth reply %u %s\n",