remove switch_channel_export_variable's nolocal argument, more confusing than anything else
This commit is contained in:
parent
ada27c2f70
commit
2c830f84aa
|
@ -246,10 +246,10 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_partner(switch_channel_
|
|||
#define switch_channel_set_variable_partner(_channel, _var, _val) switch_channel_set_variable_partner_var_check(_channel, _var, _val, SWITCH_TRUE)
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check, switch_bool_t nolocal);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check);
|
||||
|
||||
#define switch_channel_export_variable(_channel, _varname, _value, _nolocal) switch_channel_export_variable_var_check(_channel, _varname, _value, SWITCH_TRUE, _nolocal)
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_printf(switch_channel_t *channel, const char *varname, switch_bool_t nolocal, const char *fmt, ...);
|
||||
#define switch_channel_export_variable(_channel, _varname, _value) switch_channel_export_variable_var_check(_channel, _varname, _value, SWITCH_TRUE)
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_printf(switch_channel_t *channel, const char *varname, const char *fmt, ...);
|
||||
|
||||
|
||||
/*!
|
||||
|
|
|
@ -737,38 +737,29 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t
|
|||
return status;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check, switch_bool_t nolocal)
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check)
|
||||
{
|
||||
const char *exports, *exports_varname = varname;
|
||||
switch_status_t status;
|
||||
const char *exports;
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
|
||||
exports = switch_channel_get_variable(channel, SWITCH_EXPORT_VARS_VARIABLE);
|
||||
|
||||
if (nolocal) {
|
||||
exports_varname = switch_mprintf("nolocal:%s", varname);
|
||||
}
|
||||
|
||||
if ((status = switch_channel_set_variable_var_check(channel, exports_varname, value, var_check)) != SWITCH_STATUS_SUCCESS) {
|
||||
goto done;
|
||||
|
||||
if ((status = switch_channel_set_variable_var_check(channel, varname, value, var_check)) != SWITCH_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
|
||||
if (varname && value) {
|
||||
if (exports) {
|
||||
switch_channel_set_variable_printf(channel, SWITCH_EXPORT_VARS_VARIABLE, "%s,%s", exports, exports_varname);
|
||||
switch_channel_set_variable_printf(channel, SWITCH_EXPORT_VARS_VARIABLE, "%s,%s", exports, varname);
|
||||
} else {
|
||||
switch_channel_set_variable(channel, SWITCH_EXPORT_VARS_VARIABLE, exports_varname);
|
||||
switch_channel_set_variable(channel, SWITCH_EXPORT_VARS_VARIABLE, varname);
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
if (exports_varname != varname) {
|
||||
free((char*)exports_varname);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_printf(switch_channel_t *channel, const char *varname, switch_bool_t nolocal, const char *fmt, ...)
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_printf(switch_channel_t *channel, const char *varname, const char *fmt, ...)
|
||||
{
|
||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||
char *data = NULL;
|
||||
|
@ -785,7 +776,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_export_variable_printf(switch_cha
|
|||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
status = switch_channel_export_variable(channel, varname, data, nolocal);
|
||||
status = switch_channel_export_variable(channel, varname, data);
|
||||
|
||||
free(data);
|
||||
|
||||
|
|
Loading…
Reference in New Issue