From 432de1c04996a19bea301f0070454dddcd83cefa Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 2 Apr 2010 00:16:34 -0500 Subject: [PATCH 1/4] Release freeswitch-1.0.5.14226d2 --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 16ba3e6999..4a5c0934ed 100644 --- a/configure.in +++ b/configure.in @@ -3,11 +3,11 @@ # Must change all of the below together # For a release, set revision for that tagged release as well and uncomment -AC_INIT([freeswitch], [1.0.head], BUG-REPORT-ADDRESS) +AC_INIT([freeswitch], [1.0.5], BUG-REPORT-ADDRESS) AC_SUBST(SWITCH_VERSION_MAJOR, [1]) AC_SUBST(SWITCH_VERSION_MINOR, [0]) -AC_SUBST(SWITCH_VERSION_MICRO, [head]) -#AC_SUBST(SWITCH_VERSION_REVISION, []) +AC_SUBST(SWITCH_VERSION_MICRO, [5]) +AC_SUBST(SWITCH_VERSION_REVISION, [14226d2]) AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template]) AC_CONFIG_FILES([.version:.version.in]) From a8c20e294f01fe2809fcebc926d335d297af3679 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 6 Apr 2010 13:05:27 -0500 Subject: [PATCH 2/4] Release freeswitch-1.0.6 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 16ba3e6999..33bd8d9cb8 100644 --- a/configure.in +++ b/configure.in @@ -3,10 +3,10 @@ # Must change all of the below together # For a release, set revision for that tagged release as well and uncomment -AC_INIT([freeswitch], [1.0.head], BUG-REPORT-ADDRESS) +AC_INIT([freeswitch], [1.0.6], BUG-REPORT-ADDRESS) AC_SUBST(SWITCH_VERSION_MAJOR, [1]) AC_SUBST(SWITCH_VERSION_MINOR, [0]) -AC_SUBST(SWITCH_VERSION_MICRO, [head]) +AC_SUBST(SWITCH_VERSION_MICRO, [6]) #AC_SUBST(SWITCH_VERSION_REVISION, []) AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template]) From ada27c2f70a1fbf1d609c3403469dee51403db40 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Wed, 7 Apr 2010 14:55:55 -0400 Subject: [PATCH 3/4] add switch_channel_export_variable_printf --- src/include/switch_channel.h | 2 ++ src/switch_channel.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/include/switch_channel.h b/src/include/switch_channel.h index 5529d9af66..84b0f7fdaf 100644 --- a/src/include/switch_channel.h +++ b/src/include/switch_channel.h @@ -249,6 +249,8 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_partner(switch_channel_ 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); #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, ...); + /*! \brief Retrieve a variable from a given channel diff --git a/src/switch_channel.c b/src/switch_channel.c index ba9429721a..6019836c15 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -768,6 +768,30 @@ done: 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_status_t status = SWITCH_STATUS_FALSE; + char *data = NULL; + va_list ap; + int ret; + + switch_assert(channel != NULL); + + va_start(ap, fmt); + ret = switch_vasprintf(&data, fmt, ap); + va_end(ap); + + if (ret == -1) { + return SWITCH_STATUS_FALSE; + } + + status = switch_channel_export_variable(channel, varname, data, nolocal); + + free(data); + + return status; +} + SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check) { From 2c830f84aa8e5a5b05c55c5f02ae0025c4986bd2 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Wed, 7 Apr 2010 15:02:00 -0400 Subject: [PATCH 4/4] remove switch_channel_export_variable's nolocal argument, more confusing than anything else --- src/include/switch_channel.h | 6 +++--- src/switch_channel.c | 29 ++++++++++------------------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/include/switch_channel.h b/src/include/switch_channel.h index 84b0f7fdaf..f21d36d63a 100644 --- a/src/include/switch_channel.h +++ b/src/include/switch_channel.h @@ -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, ...); /*! diff --git a/src/switch_channel.c b/src/switch_channel.c index 6019836c15..345d4e791a 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -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);