Merge pull request #1157 in FS/freeswitch from ~LAZEDO/freeswitch:feature/fs-9955 to master

* commit '606d5354788c2c78e5e87f772e0069cbefe6ba93':
  FS-9955 [mod_kazoo] set profile var when setting channel var
This commit is contained in:
Mike Jerris 2017-01-18 10:41:28 -06:00
commit f16a71e6ff
2 changed files with 21 additions and 0 deletions

View File

@ -121,6 +121,16 @@ SWITCH_STANDARD_API(uuid_setvar_multi_function) {
stream->write_function(stream, "-ERR No variable specified\n");
} else {
switch_channel_set_variable(channel, var_name, var_value);
if (!strcasecmp(var_name, "effective_callee_id_number")) {
switch_channel_set_profile_var(channel, "callee_id_number", var_value);
} else if (!strcasecmp(var_name, "effective_callee_id_name")) {
switch_channel_set_profile_var(channel, "callee_id_name", var_value);
} else if (!strcasecmp(var_name, "effective_caller_id_number")) {
switch_channel_set_profile_var(channel, "caller_id_number", var_value);
} else if (!strcasecmp(var_name, "effective_caller_id_name")) {
switch_channel_set_profile_var(channel, "caller_id_name", var_value);
};
y++;
}
}

View File

@ -82,6 +82,17 @@ static void base_set (switch_core_session_t *session, const char *data, switch_s
expanded ? expanded : "UNDEF");
switch_channel_add_variable_var_check(channel, var, expanded, SWITCH_FALSE, stack);
if (!strcasecmp(var, "effective_callee_id_number")) {
switch_channel_set_profile_var(channel, "callee_id_number", expanded);
} else if (!strcasecmp(var, "effective_callee_id_name")) {
switch_channel_set_profile_var(channel, "callee_id_name", expanded);
} else if (!strcasecmp(var, "effective_caller_id_number")) {
switch_channel_set_profile_var(channel, "caller_id_number", expanded);
} else if (!strcasecmp(var, "effective_caller_id_name")) {
switch_channel_set_profile_var(channel, "caller_id_name", expanded);
};
if (expanded && expanded != val) {
switch_safe_free(expanded);
}