FS-9955 [mod_kazoo] set profile var when setting channel var

This commit is contained in:
lazedo 2017-01-18 04:56:52 +00:00
parent b7578ecd98
commit 606d535478
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"); stream->write_function(stream, "-ERR No variable specified\n");
} else { } else {
switch_channel_set_variable(channel, var_name, var_value); 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++; y++;
} }
} }

View File

@ -82,6 +82,17 @@ static void base_set (switch_core_session_t *session, const char *data, switch_s
expanded ? expanded : "UNDEF"); expanded ? expanded : "UNDEF");
switch_channel_add_variable_var_check(channel, var, expanded, SWITCH_FALSE, stack); 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) { if (expanded && expanded != val) {
switch_safe_free(expanded); switch_safe_free(expanded);
} }