adds monitoring support

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1275 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 18 years ago
parent 61e3d3b36c
commit 78f177f4ee

@ -29,6 +29,7 @@
#include "AmSessionContainer.h"
#include "AmConfig.h"
#include "AmMediaProcessor.h"
#include "ampi/MonitoringAPI.h"
#include <assert.h>
@ -226,6 +227,9 @@ void AmB2ABCallerSession::relayEvent(AmEvent* ev)
B2ABConnectLegEvent* co_ev = dynamic_cast<B2ABConnectLegEvent*>(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<B2ABConnectLegEvent*>(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){

Loading…
Cancel
Save