Module: sip-router Branch: master Commit: c2d36c17f91dacaa242a3011394f184e43518a9f URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c2d36c17...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Thu Feb 4 00:04:24 2010 +0100
core: fire core event on each executed cfg action
- used for cfg execution tracing and interactive debugging (the new module debugger)
---
action.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/action.c b/action.c index d23b61d..e58484b 100644 --- a/action.c +++ b/action.c @@ -90,6 +90,7 @@ #include "sctp_server.h" #endif #include "switch.h" +#include "events.h"
#include <sys/types.h> #include <sys/socket.h> @@ -133,6 +134,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg) struct rvalue* rv1; struct rval_cache c1; str s; + void *srevp[2];
/* reset the value of error to E_UNSPEC so avoid unknowledgable functions to return with error (status<0) and not setting it @@ -141,6 +143,11 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg) prev_ser_error=ser_error; ser_error=E_UNSPEC;
+ /* hook for every executed action (in use by cfg debugger) */ + srevp[0] = (void*)a; + srevp[1] = (void*)msg; + sr_event_exec(SREV_CFG_RUN_ACTION, (void*)srevp); + ret=E_BUG; switch ((unsigned char)a->type){ case DROP_T: