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
This commit is contained in:
Michael Jerris 2008-01-08 16:20:00 +00:00
parent 5b01ced55c
commit 31d0a1a02d
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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;