Browse code

Introducing run_top_route function

Function run_top_route can be used to initialize the environment before
a SIP message starts processing in *_route blocks. Internally it resets
the script flags, resets the select buffer, initializes the environment
using init_run_actions_ctx and passes control to the specified route
section.

Jan Janak authored on 29/03/2009 15:53:58
Showing 2 changed files
... ...
@@ -67,6 +67,7 @@
67 67
 #include "ut.h"
68 68
 #include "lvalue.h"
69 69
 #include "sr_module.h"
70
+#include "select_buf.h"
70 71
 #include "mem/mem.h"
71 72
 #include "globals.h"
72 73
 #include "dset.h"
... ...
@@ -1268,3 +1269,13 @@ error:
1268 1268
 	h->rec_lev--;
1269 1269
 	return ret;
1270 1270
 }
1271
+
1272
+
1273
+int run_top_route(struct action* a, sip_msg_t* msg)
1274
+{
1275
+	struct run_act_ctx ctx;
1276
+	setsflagsval(0);
1277
+	reset_static_buffer();
1278
+	init_run_actions_ctx(&ctx);
1279
+	return run_actions(&ctx, a, msg);
1280
+}
... ...
@@ -59,8 +59,6 @@ struct run_act_ctx{
59 59
 int do_action(struct run_act_ctx* c, struct action* a, struct sip_msg* msg);
60 60
 int run_actions(struct run_act_ctx* c, struct action* a, struct sip_msg* msg);
61 61
 
62
-
63
-
64
-
62
+int run_top_route(struct action* a, sip_msg_t* msg);
65 63
 
66 64
 #endif