]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
remove switch_channel_export_variable's nolocal argument, more confusing than anythin...
authorMathieu Rene <mrene@avgs.ca>
Wed, 7 Apr 2010 19:02:00 +0000 (15:02 -0400)
committerMathieu Rene <mrene@avgs.ca>
Wed, 7 Apr 2010 19:02:00 +0000 (15:02 -0400)
src/include/switch_channel.h
src/switch_channel.c

index 84b0f7fdafab119712e2c44e84552397d50ef670..f21d36d63ae2d3e205fc6eb8eb015a41bf7fb8f3 100644 (file)
@@ -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, ...);
 
 
 /*!
index 6019836c1590ebcf8968f25e2146fc6f6a64e0b8..345d4e791a5ec3a6c5ab430e20156e268e350f67 100644 (file)
@@ -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);