2
0
Эх сурвалжийг харах

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 16 жил өмнө
parent
commit
8402508053
2 өөрчлөгдсөн 12 нэмэгдсэн , 3 устгасан
  1. 11 0
      action.c
  2. 1 3
      action.h

+ 11 - 0
action.c

@@ -67,6 +67,7 @@
 #include "ut.h"
 #include "lvalue.h"
 #include "sr_module.h"
+#include "select_buf.h"
 #include "mem/mem.h"
 #include "globals.h"
 #include "dset.h"
@@ -1268,3 +1269,13 @@ error:
 	h->rec_lev--;
 	return ret;
 }
+
+
+int run_top_route(struct action* a, sip_msg_t* msg)
+{
+	struct run_act_ctx ctx;
+	setsflagsval(0);
+	reset_static_buffer();
+	init_run_actions_ctx(&ctx);
+	return run_actions(&ctx, a, msg);
+}

+ 1 - 3
action.h

@@ -59,8 +59,6 @@ struct run_act_ctx{
 int do_action(struct run_act_ctx* c, struct action* a, struct sip_msg* msg);
 int run_actions(struct run_act_ctx* c, struct action* a, struct sip_msg* msg);
 
-
-
-
+int run_top_route(struct action* a, sip_msg_t* msg);
 
 #endif