[sr-dev] git:master:c3212783: core: added function to return route block name from crt action
Daniel-Constantin Mierla
miconda at gmail.com
Mon Jun 26 08:36:07 CEST 2017
Module: kamailio
Branch: master
Commit: c3212783da0af2358bcf0bcf4b5da4a8f0629251
URL: https://github.com/kamailio/kamailio/commit/c3212783da0af2358bcf0bcf4b5da4a8f0629251
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-06-26T08:22:34+02:00
core: added function to return route block name from crt action
- renamed the function that returns cfg file name from crt action
---
Modified: src/core/action.c
Modified: src/core/action.h
---
Diff: https://github.com/kamailio/kamailio/commit/c3212783da0af2358bcf0bcf4b5da4a8f0629251.diff
Patch: https://github.com/kamailio/kamailio/commit/c3212783da0af2358bcf0bcf4b5da4a8f0629251.patch
---
diff --git a/src/core/action.c b/src/core/action.c
index def9a64106..f766a0b894 100644
--- a/src/core/action.c
+++ b/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).
diff --git a/src/core/action.h b/src/core/action.h
index b4591aa115..c528fa972c 100644
--- a/src/core/action.h
+++ b/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);
More information about the sr-dev
mailing list