Browse Source

core: added function to return route block name from crt action

- renamed the function that returns cfg file name from crt action
Daniel-Constantin Mierla 8 years ago
parent
commit
c3212783da
2 changed files with 11 additions and 2 deletions
  1. 9 1
      src/core/action.c
  2. 2 1
      src/core/action.h

+ 9 - 1
src/core/action.c

@@ -103,13 +103,21 @@ int get_cfg_crt_line(void)
 }
 
 /* return name of config for current executed action */
-char *get_cfg_crt_name(void)
+char *get_cfg_crt_file_name(void)
 {
 	if(_cfg_crt_action==0)
 		return 0;
 	return _cfg_crt_action->cfile;
 }
 
+/* return name of routing block for current executed action */
+char *get_cfg_crt_route_name(void)
+{
+	if(_cfg_crt_action==0)
+		return 0;
+	return _cfg_crt_action->rname;
+}
+
 /* handle the exit code of a module function call.
  * (used internally in do_action())
  * @param h - script handle (h->last_retcode and h->run_flags will be set).

+ 2 - 1
src/core/action.h

@@ -62,7 +62,8 @@ 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);
+char *get_cfg_crt_file_name(void);
+char *get_cfg_crt_route_name(void);
 
 void set_max_recursive_level(unsigned int lev);