add switch_core_get_variables and allow execute_on funcs to see global vars too

This commit is contained in:
Anthony Minessale
2013-03-27 14:54:01 -05:00
parent eed868af6c
commit 861c3e3ccc
4 changed files with 19 additions and 6 deletions

View File

@@ -307,6 +307,15 @@ SWITCH_DECLARE(const char *) switch_core_get_switchname(void)
}
SWITCH_DECLARE(switch_status_t) switch_core_get_variables(switch_event_t **event)
{
switch_status_t status;
switch_thread_rwlock_rdlock(runtime.global_var_rwlock);
status = switch_event_dup(event, runtime.global_vars);
switch_thread_rwlock_unlock(runtime.global_var_rwlock);
return status;
}
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
{
char *val;