[SR-Dev] git:master: Introducing run_top_route function
Jan Janak
jan at iptel.org
Sun Mar 29 18:07:15 CEST 2009
Module: sip-router
Branch: master
Commit: 8402508053d83414ab3eea62a9a24731c4b23bd3
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8402508053d83414ab3eea62a9a24731c4b23bd3
Author: Jan Janak <jan at iptel.org>
Committer: Jan Janak <jan at iptel.org>
Date: Sun Mar 29 17:53:58 2009 +0200
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.
---
action.c | 11 +++++++++++
action.h | 4 +---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/action.c b/action.c
index 82812d7..b4758a5 100644
--- a/action.c
+++ b/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);
+}
diff --git a/action.h b/action.h
index 9739d34..05b68cf 100644
--- a/action.h
+++ b/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
More information about the sr-dev
mailing list