Module: sems Branch: master Commit: d2d471cd9fb0436179c7bc50a612a18b16511db8 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=d2d471cd9fb0436179c7bc50a612a18b16511db8
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Tue Mar 26 21:05:07 2013 +0100 sbc: added type to events --- apps/sbc/RegisterCache.cpp | 2 +- apps/sbc/SBCEventLog.cpp | 11 ++++++++--- apps/sbc/SBCEventLog.h | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/sbc/RegisterCache.cpp b/apps/sbc/RegisterCache.cpp index ddea034..81c3682 100644 --- a/apps/sbc/RegisterCache.cpp +++ b/apps/sbc/RegisterCache.cpp @@ -119,7 +119,7 @@ void AliasEntry::fire() ev["aor"] = aor; ev["contact"] = contact_uri; DBG("Alias expired (UA): '%s' -> '%s'\n",alias.c_str(),aor.c_str()); - SBCEventLog::instance()->logEvent(alias,ev); + SBCEventLog::instance()->logEvent(alias,"ua-reg-expired",ev); } struct RegCacheLogHandler diff --git a/apps/sbc/SBCEventLog.cpp b/apps/sbc/SBCEventLog.cpp index 49387ed..a03e1b2 100644 --- a/apps/sbc/SBCEventLog.cpp +++ b/apps/sbc/SBCEventLog.cpp @@ -8,12 +8,16 @@ struct MonitoringEventLogHandler : public SBCEventLogHandler { - void logEvent(long int timestamp, const string& id, const AmArg& event) { + void logEvent(long int timestamp, const string& id, + const string& type, const AmArg& event) { + if(NULL != MONITORING_GLOBAL_INTERFACE) { AmArg di_args,ret; di_args.push(id); di_args.push("ts"); di_args.push(timestamp); + di_args.push("type"); + di_args.push(type); di_args.push("attrs"); di_args.push(event); @@ -40,10 +44,11 @@ void _SBCEventLog::setEventLogHandler(SBCEventLogHandler* lh) log_handler.reset(lh); } -void _SBCEventLog::logEvent(const string& id, const AmArg& event) +void _SBCEventLog::logEvent(const string& id, const string& type, + const AmArg& event) { if(log_handler.get()) { log_handler->logEvent(AmAppTimer::instance()->unix_clock.get(), - id, event); + id, type, event); } } diff --git a/apps/sbc/SBCEventLog.h b/apps/sbc/SBCEventLog.h index f35d53e..9979b0b 100644 --- a/apps/sbc/SBCEventLog.h +++ b/apps/sbc/SBCEventLog.h @@ -14,7 +14,7 @@ using std::map; struct SBCEventLogHandler { virtual void logEvent(long int timestamp, const string& id, - const AmArg& ev)=0; + const string& type, const AmArg& ev)=0; }; class _SBCEventLog @@ -28,7 +28,7 @@ protected: public: void useMonitoringLog(); void setEventLogHandler(SBCEventLogHandler* lh); - void logEvent(const string& id, const AmArg& event); + void logEvent(const string& id, const string& type, const AmArg& event); }; typedef singleton<_SBCEventLog> SBCEventLog; _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
