From 11dd8bcff070efabf27f5bc6459c5b84308da4df Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Fri, 27 May 2011 14:01:39 +0200 Subject: [PATCH] fix for oa core changes --- apps/db_reg_agent/DBRegAgent.cpp | 23 ++++++++++++++++++++--- apps/db_reg_agent/Makefile | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/apps/db_reg_agent/DBRegAgent.cpp b/apps/db_reg_agent/DBRegAgent.cpp index 9eeece56..a02b0fcc 100644 --- a/apps/db_reg_agent/DBRegAgent.cpp +++ b/apps/db_reg_agent/DBRegAgent.cpp @@ -581,10 +581,24 @@ void DBRegAgent::updateDBRegistration(long subscriber_id, int last_code, void DBRegAgent::onSipReplyEvent(AmSipReplyEvent* ev) { if (!ev) return; - DBG("received SIP reply event for '%s'\n", ev->reply.local_tag.c_str()); + DBG("received SIP reply event for '%s'\n", +#ifdef HAS_OFFER_ANSWER + ev->reply.from_tag.c_str() +#else + ev->reply.local_tag.c_str() +#endif + ); registrations_mut.lock(); - map::iterator it=registration_ltags.find(ev->reply.local_tag); + + string local_tag = +#ifdef HAS_OFFER_ANSWER + ev->reply.from_tag; +#else + ev->reply.local_tag; +#endif + + map::iterator it=registration_ltags.find(local_tag); if (it!=registration_ltags.end()) { long subscriber_id = it->second; map::iterator r_it=registrations.find(subscriber_id); @@ -596,8 +610,11 @@ void DBRegAgent::onSipReplyEvent(AmSipReplyEvent* ev) { } // AmSIPRegistration::RegistrationState state_before = r_it->second->getState(); +#ifdef HAS_OFFER_ANSWER + registration->getDlg()->onRxReply(ev->reply); +#else registration->getDlg()->updateStatus(ev->reply); - +#endif AmSIPRegistration::RegistrationState current_state = registration->getState(); //update registrations set diff --git a/apps/db_reg_agent/Makefile b/apps/db_reg_agent/Makefile index fc938786..bb5b3c12 100644 --- a/apps/db_reg_agent/Makefile +++ b/apps/db_reg_agent/Makefile @@ -1,7 +1,7 @@ plug_in_name = db_reg_agent module_ldflags = -lmysqlpp -module_cflags = -DMOD_NAME=\"$(plug_in_name)\" -I/usr/include/mysql++ -I/usr/include/mysql +module_cflags = -DHAS_OFFER_ANSWER -DMOD_NAME=\"$(plug_in_name)\" -I/usr/include/mysql++ -I/usr/include/mysql COREPATH ?=../../core include $(COREPATH)/plug-in/Makefile.app_module