mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-12 20:47:06 +00:00
add global_setvar/getvar api command
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6195 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
06bab2c04e
commit
6c7a868c6e
2 files changed
+58
-8
No files matched your search
+12
-8
@@ -152,15 +152,19 @@ SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *v
|
||||
{
|
||||
char *val;
|
||||
|
||||
switch_mutex_lock(runtime.throttle_mutex);
|
||||
val = (char *) switch_core_hash_find(runtime.global_vars, varname);
|
||||
if (val) {
|
||||
free(val);
|
||||
if (varname) {
|
||||
switch_mutex_lock(runtime.throttle_mutex);
|
||||
val = (char *) switch_core_hash_find(runtime.global_vars, varname);
|
||||
if (val) {
|
||||
free(val);
|
||||
}
|
||||
if (value) {
|
||||
switch_core_hash_insert(runtime.global_vars, varname, strdup(value));
|
||||
} else {
|
||||
switch_core_hash_delete(runtime.global_vars, varname);
|
||||
}
|
||||
switch_mutex_unlock(runtime.throttle_mutex);
|
||||
}
|
||||
if (value) {
|
||||
switch_core_hash_insert(runtime.global_vars, varname, strdup(value));
|
||||
}
|
||||
switch_mutex_unlock(runtime.throttle_mutex);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(char *) switch_core_get_uuid(void)
|
||||
|
||||
Reference in new issue
Block a user