Module: sip-router
Branch: master
Commit: bed067f3fb8423f0d138903f8d58941d19b81360
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bed067f…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: Sat Jun 7 09:19:38 2014 +0200
debugger: show routename in cfgtrace output
---
modules/debugger/debugger_api.c | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/modules/debugger/debugger_api.c b/modules/debugger/debugger_api.c
index c611fa1..e3b53db 100644
--- a/modules/debugger/debugger_api.c
+++ b/modules/debugger/debugger_api.c
@@ -287,6 +287,32 @@ int dbg_msgid_filter(struct sip_msg *msg, unsigned int flags, void
*bar)
}
}
+char* get_current_route_type_name()
+{
+ switch(route_type){
+ case REQUEST_ROUTE:
+ return "request_route";
+ case FAILURE_ROUTE:
+ return "failure_route";
+ case TM_ONREPLY_ROUTE:
+ case CORE_ONREPLY_ROUTE:
+ case ONREPLY_ROUTE:
+ return "onreply_route";
+ case BRANCH_ROUTE:
+ return "branch_route";
+ case ONSEND_ROUTE:
+ return "onsend_route";
+ case ERROR_ROUTE:
+ return "error_route";
+ case LOCAL_ROUTE:
+ return "local_route";
+ case BRANCH_FAILURE_ROUTE:
+ return "branch_failure_route";
+ default:
+ return "unknown_route";
+ }
+}
+
/**
* callback executed for each cfg action
*/
@@ -329,8 +355,10 @@ int dbg_cfg_trace(void *data)
{
LOG__(_dbg_cfgtrace_facility, _dbg_cfgtrace_level,
_dbg_cfgtrace_lname, _dbg_cfgtrace_prefix,
- " c=[%s] l=%d a=%d n=%.*s\n",
- ZSW(a->cfile), a->cline, a->type, an->len, ZSW(an->s)
+ "%s=[%s] c=[%s] l=%d a=%d n=%.*s\n",
+ get_current_route_type_name(), ZSW(a->rname),
+ ZSW(a->cfile), a->cline,
+ a->type, an->len, ZSW(an->s)
);
}
}