From 78f177f4ee8f56efafb03e6b70d1834b3ff059d8 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Sat, 14 Feb 2009 17:01:07 +0000 Subject: [PATCH] adds monitoring support git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1275 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmB2ABSession.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/AmB2ABSession.cpp b/core/AmB2ABSession.cpp index 0ce46b3f..b1f634da 100644 --- a/core/AmB2ABSession.cpp +++ b/core/AmB2ABSession.cpp @@ -29,6 +29,7 @@ #include "AmSessionContainer.h" #include "AmConfig.h" #include "AmMediaProcessor.h" +#include "ampi/MonitoringAPI.h" #include @@ -226,6 +227,9 @@ void AmB2ABCallerSession::relayEvent(AmEvent* ev) B2ABConnectLegEvent* co_ev = dynamic_cast(ev); if( co_ev ) { setupCalleeSession(createCalleeSession(), co_ev); + if (other_id.length()) { + MONITORING_LOG(getLocalTag().c_str(), "b2b_leg", other_id.c_str()); + } } } @@ -235,6 +239,10 @@ void AmB2ABCallerSession::relayEvent(AmEvent* ev) void AmB2ABCallerSession::setupCalleeSession(AmB2ABCalleeSession* callee_session, B2ABConnectLegEvent* ev) { + + if (NULL == callee_session) + return; + other_id = AmSession::getNewId(); // return; assert(callee_session); @@ -243,6 +251,10 @@ void AmB2ABCallerSession::setupCalleeSession(AmB2ABCalleeSession* callee_session callee_dlg.callid = AmSession::getNewId() + "@" + AmConfig::LocalIP; callee_dlg.local_tag = other_id; + + MONITORING_LOG(other_id.c_str(), + "dir", "out"); + callee_session->start(); AmSessionContainer* sess_cont = AmSessionContainer::instance(); @@ -282,6 +294,12 @@ void AmB2ABCalleeSession::onB2ABEvent(B2ABEvent* ev) B2ABConnectLegEvent* co_ev = dynamic_cast(ev); assert(co_ev); + MONITORING_LOG4(getLocalTag().c_str(), + "b2b_leg", other_id.c_str(), + "from", co_ev->local_party.c_str(), + "to", co_ev->remote_party.c_str(), + "ruri", co_ev->remote_uri.c_str()); + dlg.local_party = co_ev->local_party; dlg.local_uri = co_ev->local_uri; @@ -298,6 +316,7 @@ void AmB2ABCalleeSession::onB2ABEvent(B2ABEvent* ev) if (sendInvite(co_ev->headers)) { throw string("INVITE could not be sent\n"); } + return; } catch(const AmSession::Exception& e){