From ba937a472f313177dc2ba6368aec5bc33181835f Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Wed, 30 Apr 2008 14:44:48 +0000 Subject: [PATCH] more verbouse debug message. git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@921 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- apps/reg_agent/RegistrationAgent.cpp | 4 +++- core/ampi/SIPRegistrarClientAPI.h | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/reg_agent/RegistrationAgent.cpp b/apps/reg_agent/RegistrationAgent.cpp index 6e119996..a92f4d8d 100644 --- a/apps/reg_agent/RegistrationAgent.cpp +++ b/apps/reg_agent/RegistrationAgent.cpp @@ -34,6 +34,7 @@ #include "log.h" #include +#include "ampi/SIPRegistrarClientAPI.h" #define MOD_NAME "reg_agent" @@ -159,7 +160,8 @@ bool RegThread::check_registration(const RegInfo& ri) { return false; // does not exist int state = res.get(1).asInt(); int expires = res.get(2).asInt(); - DBG("Got state %ud with expires %ud for registration.\n", state, expires); + DBG("Got state %s with expires %us for registration.\n", + getSIPRegistationStateString(state), expires); if (state == 2) // expired ... FIXME: add values from API here return false; // else pending or active diff --git a/core/ampi/SIPRegistrarClientAPI.h b/core/ampi/SIPRegistrarClientAPI.h index c8d24864..1a3bc050 100644 --- a/core/ampi/SIPRegistrarClientAPI.h +++ b/core/ampi/SIPRegistrarClientAPI.h @@ -45,4 +45,13 @@ struct SIPRegistrationEvent : public AmEvent { }; }; +char* getSIPRegistationStateString(unsigned int s) { + switch (s) { + case 0: return "RegisterPending"; + case 1: return "RegisterActive"; + case 2: return "RegisterExpired"; + default: return "unknown"; + } +} + #endif