Browse code

core: fire core event on each executed cfg action

- used for cfg execution tracing and interactive debugging (the new
module debugger)

Daniel-Constantin Mierla authored on 03/02/2010 23:04:24
Showing 1 changed files
... ...
@@ -90,6 +90,7 @@
90 90
 #include "sctp_server.h"
91 91
 #endif
92 92
 #include "switch.h"
93
+#include "events.h"
93 94
 
94 95
 #include <sys/types.h>
95 96
 #include <sys/socket.h>
... ...
@@ -133,6 +134,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
133 133
 	struct rvalue* rv1;
134 134
 	struct rval_cache c1;
135 135
 	str s;
136
+	void *srevp[2];
136 137
 
137 138
 	/* reset the value of error to E_UNSPEC so avoid unknowledgable
138 139
 	   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)
141 141
 	prev_ser_error=ser_error;
142 142
 	ser_error=E_UNSPEC;
143 143
 
144
+	/* hook for every executed action (in use by cfg debugger) */
145
+	srevp[0] = (void*)a;
146
+	srevp[1] = (void*)msg;
147
+	sr_event_exec(SREV_CFG_RUN_ACTION, (void*)srevp);
148
+
144 149
 	ret=E_BUG;
145 150
 	switch ((unsigned char)a->type){
146 151
 		case DROP_T: