[sr-dev] git:master: core: added wrapper functions to return cfg line and name for current action

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 16 09:54:43 CEST 2013


Module: sip-router
Branch: master
Commit: ca568ee6996cc93e8518f277cf34111bc0c78299
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ca568ee6996cc93e8518f277cf34111bc0c78299

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon Sep 16 09:53:15 2013 +0200

core: added wrapper functions to return cfg line and name for current action

---

 action.c |   17 ++++++++++++++++-
 action.h |    2 ++
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/action.c b/action.c
index 72f4fe9..5fa50ee 100644
--- a/action.c
+++ b/action.c
@@ -114,12 +114,27 @@ struct onsend_info* p_onsend=0; /* onsend route send info */
 /* current action executed from config file */
 static cfg_action_t *_cfg_crt_action = 0;
 
-/* return currect action executed from config file */
+/* return current action executed from config file */
 cfg_action_t *get_cfg_crt_action(void)
 {
 	return _cfg_crt_action;
 }
 
+/* return line in config for current executed action */
+int get_cfg_crt_line(void)
+{
+	if(_cfg_crt_action==0)
+		return 0;
+	return _cfg_crt_action->cline;
+}
+
+/* return name of config for current executed action */
+char *get_cfg_crt_name(void)
+{
+	if(_cfg_crt_action==0)
+		return 0;
+	return _cfg_crt_action->cfile;
+}
 
 /* handle the exit code of a module function call.
  * (used internally in do_action())
diff --git a/action.h b/action.h
index d715a65..2ef00f7 100644
--- a/action.h
+++ b/action.h
@@ -69,6 +69,8 @@ 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, struct run_act_ctx* c);
 
 cfg_action_t *get_cfg_crt_action(void);
+int get_cfg_crt_line(void);
+char *get_cfg_crt_name(void);
 
 #ifdef USE_LONGJMP
 int run_actions_safe(struct run_act_ctx* c, struct action* a,




More information about the sr-dev mailing list