瀏覽代碼

core: fire core event on each executed cfg action

- used for cfg execution tracing and interactive debugging (the new
module debugger)
Daniel-Constantin Mierla 15 年之前
父節點
當前提交
c2d36c17f9
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      action.c

+ 7 - 0
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: