From 31d0a1a02d68e17d658c67647d52e584be68ca75 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 8 Jan 2008 16:20:00 +0000 Subject: [PATCH] don't set blank vars, and handle them in error cases. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7138 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_channel.c | 2 +- src/switch_ivr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index 637b4232e9..38948c2a45 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -454,7 +454,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable(switch_channel_t *ch if (!switch_strlen_zero(varname)) { switch_mutex_lock(channel->profile_mutex); switch_event_del_header(channel->variables, varname); - if (value) { + if (!switch_strlen_zero(value)) { switch_event_add_header(channel->variables, SWITCH_STACK_BOTTOM, varname, "%s", value); } switch_mutex_unlock(channel->profile_mutex); diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 8a1ac74d75..4e307eb2f7 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -1323,7 +1323,7 @@ SWITCH_DECLARE(int) switch_ivr_set_xml_chan_vars(switch_xml_t xml, switch_channe if (!hi) return off; for (; hi; hi = hi->next) { - if (hi->name && hi->value && ((variable = switch_xml_add_child_d(xml, hi->name, off++)))) { + if (!switch_strlen_zero(hi->name) && !switch_strlen_zero(hi->value) && ((variable = switch_xml_add_child_d(xml, hi->name, off++)))) { char *data; switch_size_t dlen = strlen(hi->value) * 3;