Browse code

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

Daniel-Constantin Mierla authored on 16/09/2013 07:53:15
Showing 2 changed files
... ...
@@ -114,12 +114,27 @@ struct onsend_info* p_onsend=0; /* onsend route send info */
114 114
 /* current action executed from config file */
115 115
 static cfg_action_t *_cfg_crt_action = 0;
116 116
 
117
-/* return currect action executed from config file */
117
+/* return current action executed from config file */
118 118
 cfg_action_t *get_cfg_crt_action(void)
119 119
 {
120 120
 	return _cfg_crt_action;
121 121
 }
122 122
 
123
+/* return line in config for current executed action */
124
+int get_cfg_crt_line(void)
125
+{
126
+	if(_cfg_crt_action==0)
127
+		return 0;
128
+	return _cfg_crt_action->cline;
129
+}
130
+
131
+/* return name of config for current executed action */
132
+char *get_cfg_crt_name(void)
133
+{
134
+	if(_cfg_crt_action==0)
135
+		return 0;
136
+	return _cfg_crt_action->cfile;
137
+}
123 138
 
124 139
 /* handle the exit code of a module function call.
125 140
  * (used internally in do_action())
... ...
@@ -69,6 +69,8 @@ int run_actions(struct run_act_ctx* c, struct action* a, struct sip_msg* msg);
69 69
 int run_top_route(struct action* a, sip_msg_t* msg, struct run_act_ctx* c);
70 70
 
71 71
 cfg_action_t *get_cfg_crt_action(void);
72
+int get_cfg_crt_line(void);
73
+char *get_cfg_crt_name(void);
72 74
 
73 75
 #ifdef USE_LONGJMP
74 76
 int run_actions_safe(struct run_act_ctx* c, struct action* a,