Author: sayer
Date: 2009-02-14 18:01:07 +0100 (Sat, 14 Feb 2009)
New Revision: 1275

Modified:
   trunk/core/AmB2ABSession.cpp
Log:
adds monitoring support


Modified: trunk/core/AmB2ABSession.cpp
===================================================================
--- trunk/core/AmB2ABSession.cpp        2009-02-14 16:31:46 UTC (rev 1274)
+++ trunk/core/AmB2ABSession.cpp        2009-02-14 17:01:07 UTC (rev 1275)
@@ -29,6 +29,7 @@
 #include "AmSessionContainer.h"
 #include "AmConfig.h"
 #include "AmMediaProcessor.h"
+#include "ampi/MonitoringAPI.h"
 
 #include <assert.h>
 
@@ -226,6 +227,9 @@
     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::setupCalleeSession(AmB2ABCalleeSession* 
callee_session,
                                             B2ABConnectLegEvent* ev) 
 {
+
+  if (NULL == callee_session)
+    return;
+
   other_id = AmSession::getNewId();
   //  return;
   assert(callee_session);
@@ -243,6 +251,10 @@
   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 @@
       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 @@
       if (sendInvite(co_ev->headers)) {
        throw string("INVITE could not be sent\n");
       }
+
       return;
     } 
     catch(const AmSession::Exception& e){

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to