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;