[Freeswitch-svn] [commit] r7138 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Tue Jan 8 11:20:01 EST 2008


Author: mikej
Date: Tue Jan  8 11:20:00 2008
New Revision: 7138

Modified:
   freeswitch/trunk/src/switch_channel.c
   freeswitch/trunk/src/switch_ivr.c

Log:
don't set blank vars, and handle them in error cases.

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Tue Jan  8 11:20:00 2008
@@ -454,7 +454,7 @@
 	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);

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Tue Jan  8 11:20:00 2008
@@ -1323,7 +1323,7 @@
 	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;
 			



More information about the Freeswitch-svn mailing list