Revision
15211
Author
anthm
Date
2009-10-23 11:03:42 -0500 (Fri, 23 Oct 2009)

Log Message

change switch_strlen_zero to zstr

Modified Paths

Diff

Modified: freeswitch/trunk/src/include/switch_utils.h (15210 => 15211)


--- freeswitch/trunk/src/include/switch_utils.h	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/include/switch_utils.h	2009-10-23 16:03:42 UTC (rev 15211)
@@ -74,11 +74,11 @@
   \param s the string to test
   \return true value if the string is NULL or zero length
 */
-#define switch_strlen_zero(s) (!s || *(s) == '\0')
-#define switch_strlen_zero_buf(s) (*(s) == '\0')
+#define zstr(s) (!s || *(s) == '\0')
+#define zstr_buf(s) (*(s) == '\0')
 static inline switch_bool_t switch_is_moh(const char *s)
 {
-	if (switch_strlen_zero(s) || !strcasecmp(s, "silence") || !strcasecmp(s, "indicate_hold")) {
+	if (zstr(s) || !strcasecmp(s, "silence") || !strcasecmp(s, "indicate_hold")) {
 		return SWITCH_FALSE;
 	}
 	return SWITCH_TRUE;

Modified: freeswitch/trunk/src/mod/applications/mod_cidlookup/mod_cidlookup.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_cidlookup/mod_cidlookup.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_cidlookup/mod_cidlookup.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -98,7 +98,7 @@
 	
 	if ((callback_type == CONFIG_LOAD || callback_type == CONFIG_RELOAD) && changed) {
 
-		if(switch_strlen_zero(newvalue)) {
+		if(zstr(newvalue)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No local database defined.\n");
 		} else {
 			odbc_dsn = strdup(newvalue);
@@ -325,7 +325,7 @@
 	curl_easy_cleanup(curl_handle);
 	
 	if (	http_data.stream.data &&
-			!switch_strlen_zero((char *)http_data.stream.data) &&
+			!zstr((char *)http_data.stream.data) &&
 			strcmp(" ", http_data.stream.data) ) {
 		
 		name = switch_core_strdup(pool, http_data.stream.data);
@@ -564,7 +564,7 @@
 	switch_bool_t skipurl = SWITCH_FALSE;
 	switch_bool_t skipcitystate = SWITCH_FALSE;
 	
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		switch_goto_status(SWITCH_STATUS_SUCCESS, usage);
 	}
 

Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -49,7 +49,7 @@
 {
 	char host[256] = "";
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%s", "parameter missing\n");
 	} else {
 		if (switch_resolve_host(cmd, host, sizeof(host)) == SWITCH_STATUS_SUCCESS) {
@@ -146,7 +146,7 @@
 	int diff;
 	int max = 10;
 	char *p;
-	if (switch_strlen_zero(cmd)){
+	if (zstr(cmd)){
 		stream->write_function(stream, "parameter missing\n");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -189,7 +189,7 @@
 	char *fp = NULL;
 	const char *call_delim = ",";
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto end;
 	}
 
@@ -224,7 +224,7 @@
 		domain = switch_core_get_variable("domain");
 	}
 	
-	if (!switch_strlen_zero(domain)) {
+	if (!zstr(domain)) {
 		switch_xml_t xml, x_domain, x_group;
 		switch_event_t *params;
 		switch_stream_handle_t dstream = { 0 };
@@ -377,7 +377,7 @@
 	const char *rval = "false";
 	char *group;
 	
-	if (switch_strlen_zero(cmd) || !(mydata = strdup(cmd))) {
+	if (zstr(cmd) || !(mydata = strdup(cmd))) {
 		goto end;
 	}
 
@@ -427,7 +427,7 @@
 	const char *container = "params", *elem = "param";
 	switch_event_t *params = NULL;
 
-	if (switch_strlen_zero(cmd) || !(mydata = strdup(cmd))) {
+	if (zstr(cmd) || !(mydata = strdup(cmd))) {
 		goto end;
 	}
 
@@ -580,7 +580,7 @@
 {
 	char digest[SWITCH_MD5_DIGEST_STRING_SIZE] = { 0 };
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%s", "!err!");
 	} else {
 		switch_md5_string(digest, (void *) cmd, strlen(cmd));
@@ -595,7 +595,7 @@
 	char *reply = "";
 	char *data = NULL;
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		data = strdup(cmd);
 		switch_url_decode(data);
 		reply = data;
@@ -627,7 +627,7 @@
 
 	ip = ip_buf;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%s", "-STUN Failed! NO STUN SERVER\n");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -658,7 +658,7 @@
 
 	switch_core_new_memory_pool(&pool);
 
-	if (switch_strlen_zero(stun_ip)) {
+	if (zstr(stun_ip)) {
 		stream->write_function(stream, "%s", "-STUN Failed! NO STUN SERVER\n");
 	} else {
 		if ((switch_stun_lookup(&ip, &port, stun_ip, stun_port, &error, pool)) == SWITCH_STATUS_SUCCESS && ip && port) {
@@ -684,7 +684,7 @@
 	switch_core_session_t *xsession;
 	char uuid[80] = "";
 	
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-ERR, no input\n");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -699,7 +699,7 @@
 		}
 	}
 	
-	if (switch_strlen_zero(mycmd)) {
+	if (zstr(mycmd)) {
 		stream->write_function(stream, "-ERR, no input\n");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -739,7 +739,7 @@
 	char uuid[80] = "";
 	const char *p, *input = cmd;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%s", "");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -751,7 +751,7 @@
 		}
 	}
 	
-	if (switch_strlen_zero(input)) {
+	if (zstr(input)) {
 		stream->write_function(stream, "%s", "");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -778,7 +778,7 @@
 
 SWITCH_STANDARD_API(module_exists_function)
 {
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		if (switch_loadable_module_exists(cmd) == SWITCH_STATUS_SUCCESS) {
 			stream->write_function(stream, "true");
 		} else {
@@ -793,7 +793,7 @@
 {
 	switch_xml_t root = NULL, domain = NULL;
 	
-	if (!switch_strlen_zero(cmd)) {	
+	if (!zstr(cmd)) {	
 		if (switch_xml_locate_domain(cmd, NULL, &root, &domain) == SWITCH_STATUS_SUCCESS) {
 			stream->write_function(stream, "true");
 			switch_xml_free(root); 
@@ -811,7 +811,7 @@
 	char *data = NULL;
 	int len = 0 ;
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		len = (strlen(cmd) * 3) + 1;
 		switch_zmalloc(data, len);
 		switch_url_encode(cmd, data, len);
@@ -1249,7 +1249,7 @@
 	char *mydata, *argv[5];
 	int32_t arg = 0;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", CTL_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1374,7 +1374,7 @@
 {
 	const char *err;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", LOAD_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1395,7 +1395,7 @@
 	switch_bool_t force = SWITCH_FALSE;
 	const char *p = cmd;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1419,7 +1419,7 @@
 	}
  end:
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1439,7 +1439,7 @@
 	switch_bool_t force = SWITCH_FALSE;
 	const char *p = cmd;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1462,7 +1462,7 @@
 	}
  end:
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1504,7 +1504,7 @@
 	char *mycmd = NULL, *kcause = NULL;
 	switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 
-	if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
+	if (zstr(cmd) || !(mycmd = strdup(cmd))) {
 		stream->write_function(stream, "-USAGE: %s\n", KILL_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1513,11 +1513,11 @@
 		*kcause++ = '\0';
 	}
 
-	if (switch_strlen_zero(mycmd) || !(ksession = switch_core_session_locate(mycmd))) {
+	if (zstr(mycmd) || !(ksession = switch_core_session_locate(mycmd))) {
 		stream->write_function(stream, "-ERR No Such Channel!\n");
 	} else {
 		switch_channel_t *channel = switch_core_session_get_channel(ksession);
-		if (!switch_strlen_zero(kcause)){
+		if (!zstr(kcause)){
 			cause = switch_channel_str2cause(kcause);
 		}  
 		switch_channel_hangup(channel, cause);
@@ -1536,7 +1536,7 @@
 	char *mycmd = NULL, *argv[3] = { 0 };
 	int argc = 0;
 
-	if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
+	if (zstr(cmd) || !(mycmd = strdup(cmd))) {
 		goto usage;
 	}
 
@@ -1590,7 +1590,7 @@
 	int argc = 0;
 	char *tuuid, *dest, *dp, *context, *arg = NULL;
 
-	if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
+	if (zstr(cmd) || !(mycmd = strdup(cmd))) {
 		stream->write_function(stream, "-USAGE: %s\n", TRANSFER_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1606,7 +1606,7 @@
 	dp = argv[2];
 	context = argv[3];
 
-	if (switch_strlen_zero(tuuid) || !(tsession = switch_core_session_locate(tuuid))) {
+	if (zstr(tuuid) || !(tsession = switch_core_session_locate(tuuid))) {
 		stream->write_function(stream, "-ERR No Such Channel!\n");
 		goto done;
 	}
@@ -1734,13 +1734,13 @@
 	switch_core_session_t *tsession = NULL;
 	char *uuid = NULL, *text = NULL;
 
-	if (!switch_strlen_zero(cmd) && (uuid = strdup(cmd))) {
+	if (!zstr(cmd) && (uuid = strdup(cmd))) {
 		if ((text = strchr(uuid, ' '))) {
 			*text++ = '\0';
 		}
 	}
 
-	if (switch_strlen_zero(uuid) || switch_strlen_zero(text)) {
+	if (zstr(uuid) || zstr(text)) {
 		stream->write_function(stream, "-USAGE: %s\n", UUID_CHAT_SYNTAX);
 	} else {
 		if ((tsession = switch_core_session_locate(uuid))) {
@@ -1772,13 +1772,13 @@
 	switch_core_session_t *tsession = NULL;
 	char *uuid = NULL, *text = NULL;
 
-	if (!switch_strlen_zero(cmd) && (uuid = strdup(cmd))) {
+	if (!zstr(cmd) && (uuid = strdup(cmd))) {
 		if ((text = strchr(uuid, ' '))) {
 			*text++ = '\0';
 		}
 	}
 
-	if (switch_strlen_zero(uuid) || switch_strlen_zero(text)) {
+	if (zstr(uuid) || zstr(text)) {
 		stream->write_function(stream, "-USAGE: %s\n", UUID_DEFLECT_SYNTAX);
 	} else {
 		if ((tsession = switch_core_session_locate(uuid))) {
@@ -1807,11 +1807,11 @@
 	char *mycmd = NULL, *argv[6] = { 0 };
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
-	if (switch_strlen_zero(cmd) || argc < 2 || argc > 5 || switch_strlen_zero(argv[0])) {
+	if (zstr(cmd) || argc < 2 || argc > 5 || zstr(argv[0])) {
 		stream->write_function(stream, "-USAGE: %s\n", SCHED_TRANSFER_SYNTAX);
 	} else {
 		char *uuid = argv[1];
@@ -1846,11 +1846,11 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
-	if (switch_strlen_zero(cmd) || argc < 1 || switch_strlen_zero(argv[0])) {
+	if (zstr(cmd) || argc < 1 || zstr(argv[0])) {
 		stream->write_function(stream, "-USAGE: %s\n", SCHED_HANGUP_SYNTAX);
 	} else {
 		char *uuid = argv[1];
@@ -1888,11 +1888,11 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
-	if (switch_strlen_zero(cmd) || argc < 1 || switch_strlen_zero(argv[0])) {
+	if (zstr(cmd) || argc < 1 || zstr(argv[0])) {
 		stream->write_function(stream, "-USAGE: %s\n", MEDIA_SYNTAX);
 	} else {
 		if (!strcasecmp(argv[0], "off")) {
@@ -1919,11 +1919,11 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
-	if (switch_strlen_zero(cmd) || argc < 2) {
+	if (zstr(cmd) || argc < 2) {
 		stream->write_function(stream, "-USAGE: %s\n", BROADCAST_SYNTAX);
 	} else {
 		switch_media_flag_t flags = SMF_NONE;
@@ -1955,11 +1955,11 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
-	if (switch_strlen_zero(cmd) || argc < 3 || switch_strlen_zero(argv[0])) {
+	if (zstr(cmd) || argc < 3 || zstr(argv[0])) {
 		stream->write_function(stream, "-USAGE: %s\n", SCHED_BROADCAST_SYNTAX);
 	} else {
 		switch_media_flag_t flags = SMF_NONE;
@@ -1998,11 +1998,11 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
-	if (switch_strlen_zero(cmd) || argc < 1 || switch_strlen_zero(argv[0])) {
+	if (zstr(cmd) || argc < 1 || zstr(argv[0])) {
 		stream->write_function(stream, "-USAGE: %s\n", HOLD_SYNTAX);
 	} else {
 		if (!strcasecmp(argv[0], "off")) {
@@ -2029,11 +2029,11 @@
 	int argc = 0;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
-	if (switch_strlen_zero(cmd) || argc < 2 || switch_strlen_zero(argv[0]) || switch_strlen_zero(argv[1])) {
+	if (zstr(cmd) || argc < 2 || zstr(argv[0]) || zstr(argv[1])) {
 		stream->write_function(stream, "-USAGE: %s\n", DISPLAY_SYNTAX);
 	} else {
 		switch_core_session_message_t msg = { 0 };
@@ -2065,11 +2065,11 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
-	if (switch_strlen_zero(cmd) || argc < 2) {
+	if (zstr(cmd) || argc < 2) {
 		stream->write_function(stream, "-USAGE: %s\n", UUID_SYNTAX);
 	} else {
 		switch_status_t status;
@@ -2105,7 +2105,7 @@
 	int argc = 0;
 	uint32_t limit = 0;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto usage;
 	}
 
@@ -2122,7 +2122,7 @@
 	path = argv[2];
 	limit = argv[3] ? atoi(argv[3]) : 0;
 
-	if (switch_strlen_zero(uuid) || switch_strlen_zero(action) || switch_strlen_zero(path)) {
+	if (zstr(uuid) || zstr(action) || zstr(path)) {
 		goto usage;
 	}
 
@@ -2171,7 +2171,7 @@
 	uint32_t limit = 0;
 	char *flags = NULL;
 
-	if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
+	if (zstr(cmd) || !(mycmd = strdup(cmd))) {
 		goto usage;
 	}
 
@@ -2185,7 +2185,7 @@
 	limit = argv[3] ? atoi(argv[3]) : 0;
 	flags = argv[4];
 
-	if (switch_strlen_zero(uuid) || switch_strlen_zero(action) || switch_strlen_zero(path)) {
+	if (zstr(uuid) || zstr(action) || zstr(path)) {
 		goto usage;
 	}
 
@@ -2232,7 +2232,7 @@
 	switch_channel_t *channel = NULL;
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-USAGE: %s\n", BREAK_SYNTAX);
 		goto done;
 	}
@@ -2277,11 +2277,11 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
-	if (switch_strlen_zero(cmd) || argc < 2 || switch_strlen_zero(argv[0])) {
+	if (zstr(cmd) || argc < 2 || zstr(argv[0])) {
 		stream->write_function(stream, "-USAGE: %s\n", PAUSE_SYNTAX);
 	} else {
 		char *uuid = argv[0];
@@ -2320,7 +2320,7 @@
 	uint8_t machine = 1;
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
-	if (session || switch_strlen_zero(cmd)) {
+	if (session || zstr(cmd)) {
 		stream->write_function(stream, "-USAGE %s\n", ORIGINATE_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -3000,7 +3000,7 @@
 	/* switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "SQL: %s.\n", sql); */
 	
 	if (!strcasecmp(as, "delim") || !strcasecmp(as, "csv")) {
-		if (switch_strlen_zero(holder.delim)) {
+		if (zstr(holder.delim)) {
 			if (!(holder.delim = argv[3])) {
 				holder.delim = ",";
 			}
@@ -3075,7 +3075,7 @@
 {
 	char showcmd[1024];
 	int all = 0;
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		sprintf(showcmd, "help");
 		all = 1;
 	} else {
@@ -3100,7 +3100,7 @@
 	switch_core_session_t *l_session = NULL;
 	int x = 0, sched = 0;
 
-	if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
+	if (zstr(cmd) || !(mycmd = strdup(cmd))) {
 		goto error;
 	}
 
@@ -3158,7 +3158,7 @@
 {
 	switch_core_session_t *fsession;
 
-	if (!switch_strlen_zero(cmd) && (fsession = switch_core_session_locate(cmd))) {
+	if (!zstr(cmd) && (fsession = switch_core_session_locate(cmd))) {
 		switch_channel_flush_dtmf(switch_core_session_get_channel(fsession));
 		switch_core_session_rwunlock(fsession);
 		stream->write_function(stream, "+OK\n");
@@ -3176,9 +3176,9 @@
 	char *mycmd = NULL, *argv[3] = { 0 };
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
-		if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) {
+		if ((argc == 2 || argc == 3) && !zstr(argv[0])) {
 			char *uuid = argv[0];
 			char *var_name = argv[1];
 			char *var_value = NULL;
@@ -3191,7 +3191,7 @@
 				switch_channel_t *channel;
 				channel = switch_core_session_get_channel(psession);
 
-				if (switch_strlen_zero(var_name)) {
+				if (zstr(var_name)) {
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
 					stream->write_function(stream, "-ERR No variable specified\n");
 				} else {
@@ -3224,7 +3224,7 @@
 	int argc = 0;
 	char *var_name, *var_value = NULL;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		char *uuid = mycmd;
 		if (!(vars = strchr(uuid, ' '))) {
 			goto done;
@@ -3241,7 +3241,7 @@
 				if (var_name && (var_value = strchr(var_name, '='))) {
 					*var_value++ = '\0';
 				}
-				if (switch_strlen_zero(var_name)) {
+				if (zstr(var_name)) {
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
 					stream->write_function(stream, "-ERR No variable specified\n");
 				} else {
@@ -3289,9 +3289,9 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
-		if (argc >= 2 && !switch_strlen_zero(argv[0])) {
+		if (argc >= 2 && !zstr(argv[0])) {
 			char *uuid = argv[0];
 			char *var_name = argv[1];
 			const char *var_value = NULL;
@@ -3300,7 +3300,7 @@
 				switch_channel_t *channel;
 				channel = switch_core_session_get_channel(psession);
 
-				if (switch_strlen_zero(var_name)) {
+				if (zstr(var_name)) {
 					stream->write_function(stream, "-ERR No variable name specified!\n");
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
 				} else {
@@ -3336,7 +3336,7 @@
 	char *uuid = NULL, *dtmf_data = NULL;
 	int argc = 0;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto usage;
 	}
 
@@ -3350,7 +3350,7 @@
 
 	uuid = argv[0];
 	dtmf_data = argv[1];
-	if (switch_strlen_zero(uuid) || switch_strlen_zero(dtmf_data)) {
+	if (zstr(uuid) || zstr(dtmf_data)) {
 		goto usage;
 	}
 
@@ -3381,9 +3381,9 @@
 	char *mycmd = NULL, *argv[4] = { 0 };
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
-		if (argc >= 0 && !switch_strlen_zero(argv[0])) {
+		if (argc >= 0 && !zstr(argv[0])) {
 			char *uuid = argv[0];
 			char *format = argv[1];
 
@@ -3445,13 +3445,13 @@
 	char *mycmd = NULL, *argv[2] = { 0 };
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, '=', argv, (sizeof(argv) / sizeof(argv[0])));
-		if (argc > 0 && !switch_strlen_zero(argv[0])) {
+		if (argc > 0 && !zstr(argv[0])) {
 			char *var_name = argv[0];
 			char *var_value = argv[1];
 
-			if (switch_strlen_zero(var_value)) {
+			if (zstr(var_value)) {
 				var_value = NULL;
 			}
 			switch_core_set_variable(var_name, var_value);
@@ -3470,7 +3470,7 @@
 #define GLOBAL_GETVAR_SYNTAX "<var>"
 SWITCH_STANDARD_API(global_getvar_function)
 {
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		switch_core_dump_variables(stream);
 	} else {
 		stream->write_function(stream, "%s", switch_str_nil(switch_core_get_variable(cmd)));
@@ -3481,7 +3481,7 @@
 #define SYSTEM_SYNTAX "<command>"
 SWITCH_STANDARD_API(system_function)
 {
-    if (switch_strlen_zero(cmd)) {
+    if (zstr(cmd)) {
         stream->write_function(stream, "-USAGE: %s\n", SYSTEM_SYNTAX);
         return SWITCH_STATUS_SUCCESS;
     } 
@@ -3498,7 +3498,7 @@
 #define SYSTEM_SYNTAX "<command>"
 SWITCH_STANDARD_API(bg_system_function)
 {
-    if (switch_strlen_zero(cmd)) {
+    if (zstr(cmd)) {
         stream->write_function(stream, "-USAGE: %s\n", SYSTEM_SYNTAX);
         return SWITCH_STATUS_SUCCESS;
     } 
@@ -3517,7 +3517,7 @@
 	const char *tz_name = NULL;
 	char date[80] = "";
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		format = strchr(cmd, ' ');
 		tz_name = cmd;
 		if (format) {
@@ -3542,7 +3542,7 @@
 	char *val = NULL;
 	switch_call_cause_t cause = SWITCH_CAUSE_MANAGER_REQUEST;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 		switch_assert(argv[0]);
 		if ((cause = switch_channel_str2cause(argv[0])) == SWITCH_CAUSE_NONE) {
@@ -3556,13 +3556,13 @@
 		var = NULL;
 	}
 
-	if (switch_strlen_zero(var)) {
+	if (zstr(var)) {
 		switch_core_session_hupall(cause);
 	} else {
 		switch_core_session_hupall_matching_var(var, val, cause);
 	}
 	
-	if (switch_strlen_zero(var)) {
+	if (zstr(var)) {
 		stream->write_function(stream, "+OK hangup all channels with cause %s\n", switch_channel_cause2str(cause));
 	} else {
 		stream->write_function(stream, "+OK hangup all channels matching [%s]=[%s] with cause: %s\n", var, val, switch_channel_cause2str(cause));

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -676,7 +676,7 @@
 			switch_snprintf(saymsg, sizeof(saymsg), "Auto Calling %d parties", call_list->itteration);
 			conference_member_say(member, saymsg, 0);
 		} else {
-			if (switch_strlen_zero(conference->special_announce)) {
+			if (zstr(conference->special_announce)) {
 				/* announce the total number of members in the conference */
 				if (conference->count >= conference->announce_count && conference->announce_count > 1) {
 					switch_snprintf(msg, sizeof(msg), "There are %d callers", conference->count);
@@ -1882,7 +1882,7 @@
 						
 						if (switch_test_flag(member, MFLAG_MUTE_DETECT) && !switch_test_flag(member, MFLAG_CAN_SPEAK)) {
 
-							if (!switch_strlen_zero(member->conference->mute_detect_sound)) {
+							if (!zstr(member->conference->mute_detect_sound)) {
 								conference_member_play_file(member, member->conference->mute_detect_sound, 0);
 							}
 
@@ -2782,7 +2782,7 @@
 		expanded = NULL;
 	}
 	if (!strncasecmp(file, "say:", 4)) {
-		if (!switch_strlen_zero(file + 4)) {
+		if (!zstr(file + 4)) {
 			status = conference_member_say(member, file + 4, leadin);
 		}
 		goto done;
@@ -2793,7 +2793,7 @@
 				goto done;
 			}
 			file = dfile;
-		} else if (!switch_strlen_zero(file)) {
+		} else if (!zstr(file)) {
 			status = conference_member_say(member, file, leadin);
 			goto done;
 		}
@@ -2853,7 +2853,7 @@
 	switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE;
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (member == NULL || switch_strlen_zero(text))
+	if (member == NULL || zstr(text))
 		return SWITCH_STATUS_FALSE;
 
 	switch_assert(conference != NULL);
@@ -2935,7 +2935,7 @@
 
 	switch_assert(conference != NULL);
 
-	if (switch_strlen_zero(text)) {
+	if (zstr(text)) {
 		return SWITCH_STATUS_GENERR;
 	}
 
@@ -3123,7 +3123,7 @@
 		return SWITCH_STATUS_GENERR;
 
 	switch_clear_flag_locked(member, MFLAG_CAN_SPEAK);
-	if (!switch_strlen_zero(member->conference->muted_sound)) {
+	if (!zstr(member->conference->muted_sound)) {
 		conference_member_play_file(member, member->conference->muted_sound, 0);
 	} else {
 		char msg[512];
@@ -3155,7 +3155,7 @@
 	if (stream != NULL) {
 		stream->write_function(stream, "OK unmute %u\n", member->id);
 	}
-	if (!switch_strlen_zero(member->conference->unmuted_sound)) {
+	if (!zstr(member->conference->unmuted_sound)) {
 		conference_member_play_file(member, member->conference->unmuted_sound, 0);
 	} else {
 		char msg[512];
@@ -3250,7 +3250,7 @@
 		return SWITCH_STATUS_GENERR;
 	}
 
-	if (switch_strlen_zero(dtmf)) {
+	if (zstr(dtmf)) {
 		stream->write_function(stream, "Invalid input!\n");
 		return SWITCH_STATUS_GENERR;
 	}
@@ -3620,7 +3620,7 @@
 {
 	switch_event_t *event;
 
-	if (switch_strlen_zero(text)) {
+	if (zstr(text)) {
 		stream->write_function(stream, "(say) Error! No text.\n");
 		return SWITCH_STATUS_GENERR;
 	}
@@ -3650,7 +3650,7 @@
 	conference_member_t *member;
 	switch_event_t *event;
 
-	if (switch_strlen_zero(text)) {
+	if (zstr(text)) {
 		stream->write_function(stream, "(saymember) No Text!\n");
 		goto done;
 	}
@@ -3667,7 +3667,7 @@
 
 	id = atoi(workspace);
 
-	if (!id || switch_strlen_zero(text)) {
+	if (!id || zstr(text)) {
 		stream->write_function(stream, "(saymember) No Text!\n");
 		goto done;
 	}
@@ -3910,7 +3910,7 @@
 	switch_assert(conference != NULL);
 	switch_assert(stream != NULL);
 
-	if (argc > 3 && !switch_strlen_zero(argv[2])) {
+	if (argc > 3 && !zstr(argv[2])) {
 		int x;
 
 		conf_name = strdup(argv[2]);
@@ -4274,7 +4274,7 @@
 					const char *modified_cmdline = cmdline;
 					const char *cmd = conf_api_sub_commands[i].pname;
 
-					if (!switch_strlen_zero(modified_cmdline) && (start_text = strstr(modified_cmdline, cmd))) {
+					if (!zstr(modified_cmdline) && (start_text = strstr(modified_cmdline, cmd))) {
 						modified_cmdline = start_text + strlen(cmd);
 						while (modified_cmdline && (*modified_cmdline == ' ' || *modified_cmdline == '\t')) {
 							modified_cmdline++;
@@ -4421,11 +4421,11 @@
 		caller_channel = switch_core_session_get_channel(session);
 	}
 
-	if (switch_strlen_zero(cid_name)) {
+	if (zstr(cid_name)) {
 		cid_name = conference->caller_id_name;
 	}
 
-	if (switch_strlen_zero(cid_num)) {
+	if (zstr(cid_num)) {
 		cid_num = conference->caller_id_number;
 	}
 
@@ -4810,7 +4810,7 @@
 
 	call_list = switch_channel_get_private(channel, "_conference_autocall_list_");
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		call_list = NULL;
 	} else {
 		np = switch_core_session_alloc(session, sizeof(*np));
@@ -4964,7 +4964,7 @@
 	}
 
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Invalid arguments\n");
 		return;
 	}
@@ -5121,11 +5121,11 @@
 			switch_channel_set_variable(channel, "conference_name", conference->name);
 
 			/* Set MOH from variable if not set */
-			if(switch_strlen_zero(conference->moh_sound)) {
+			if(zstr(conference->moh_sound)) {
 				conference->moh_sound = switch_core_strdup(conference->pool, switch_channel_get_variable(channel, "conference_moh_sound"));
 			}
 			/* Set perpetual-sound from variable if not set */
-			if(switch_strlen_zero(conference->perpetual_sound)) {
+			if(zstr(conference->perpetual_sound)) {
 				conference->perpetual_sound = switch_core_strdup(conference->pool, switch_channel_get_variable(channel, "conference_perpetual_sound"));
 			}
 			
@@ -5155,7 +5155,7 @@
 
 
 		/* if this is not an outbound call, deal with conference pins */
-		if (enforce_security && !switch_strlen_zero(dpin)) {
+		if (enforce_security && !zstr(dpin)) {
 			char pin_buf[80] = "";
 			int pin_retries = 3;	/* XXX - this should be configurable - i'm too lazy to do it right now... */
 			int pin_valid = 0;
@@ -5259,7 +5259,7 @@
 	}
 
 	/* if we're using "bridge:" make an outbound call and bridge it in */
-	if (!switch_strlen_zero(bridgeto) && strcasecmp(bridgeto, "none")) {
+	if (!zstr(bridgeto) && strcasecmp(bridgeto, "none")) {
 		switch_call_cause_t cause;
 		if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, &cause) != SWITCH_STATUS_SUCCESS) {
 			goto done;
@@ -5512,7 +5512,7 @@
 	switch_assert(conference != NULL);
 
 	for (i = 0, status = SWITCH_STATUS_SUCCESS; status == SWITCH_STATUS_SUCCESS && i < CCFNTBL_QTY; i++) {
-		if (!switch_strlen_zero(ccfntbl[i].digits)) {
+		if (!zstr(ccfntbl[i].digits)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
 							  "Installing default caller control action '%s' bound to '%s'.\n", ccfntbl[i].key, ccfntbl[i].digits);
 			action = (caller_control_action_t *) switch_core_alloc(conference->pool, sizeof(caller_control_action_t));
@@ -5548,7 +5548,7 @@
 		char *val = (char *) switch_xml_attr(xml_kvp, "digits");
 		char *data = (char *) switch_xml_attr_soft(xml_kvp, "data");
 
-		if (!switch_strlen_zero(key) && !switch_strlen_zero(val)) {
+		if (!zstr(key) && !zstr(val)) {
 			uint32_t i;
 
 			/* scan through all of the valid actions, and if found, */
@@ -5640,7 +5640,7 @@
 	char *auto_record = NULL;
 
 	/* Validate the conference name */
-	if (switch_strlen_zero(name)) {
+	if (zstr(name)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Record! no name.\n");
 		return NULL;
 	}
@@ -5665,14 +5665,14 @@
 			var = buf;
 		}
 
-		if (!strcasecmp(var, "rate") && !switch_strlen_zero(val)) {
+		if (!strcasecmp(var, "rate") && !zstr(val)) {
 			uint32_t tmp = atoi(val);
 			if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 48000) {
 				rate = tmp;
 			}
-		} else if (!strcasecmp(var, "domain") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "domain") && !zstr(val)) {
 			domain = val;
-		} else if (!strcasecmp(var, "interval") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "interval") && !zstr(val)) {
 			uint32_t tmp = atoi(val);
 			if (SWITCH_ACCEPTABLE_INTERVAL(tmp)) {
 				interval = tmp;
@@ -5680,59 +5680,59 @@
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
 								  "Interval must be multipe of 10 and less than %d, Using default of 20\n", SWITCH_MAX_INTERVAL);
 			}
-		} else if (!strcasecmp(var, "timer-name") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "timer-name") && !zstr(val)) {
 			timer_name = val;
-		} else if (!strcasecmp(var, "tts-engine") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "tts-engine") && !zstr(val)) {
 			tts_engine = val;
-		} else if (!strcasecmp(var, "tts-voice") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "tts-voice") && !zstr(val)) {
 			tts_voice = val;
-		} else if (!strcasecmp(var, "enter-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "enter-sound") && !zstr(val)) {
 			enter_sound = val;
-		} else if (!strcasecmp(var, "exit-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "exit-sound") && !zstr(val)) {
 			exit_sound = val;
-		} else if (!strcasecmp(var, "alone-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "alone-sound") && !zstr(val)) {
 			alone_sound = val;
-		} else if (!strcasecmp(var, "perpetual-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "perpetual-sound") && !zstr(val)) {
 			perpetual_sound = val;
-		} else if (!strcasecmp(var, "moh-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "moh-sound") && !zstr(val)) {
 			moh_sound = val;
-		} else if (!strcasecmp(var, "ack-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "ack-sound") && !zstr(val)) {
 			ack_sound = val;
-		} else if (!strcasecmp(var, "nack-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "nack-sound") && !zstr(val)) {
 			nack_sound = val;
-		} else if (!strcasecmp(var, "muted-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "muted-sound") && !zstr(val)) {
 			muted_sound = val;
-		} else if (!strcasecmp(var, "mute-detect-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "mute-detect-sound") && !zstr(val)) {
 			mute_detect_sound = val;
-		} else if (!strcasecmp(var, "unmuted-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "unmuted-sound") && !zstr(val)) {
 			unmuted_sound = val;
-		} else if (!strcasecmp(var, "locked-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "locked-sound") && !zstr(val)) {
 			locked_sound = val;
-		} else if (!strcasecmp(var, "is-locked-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "is-locked-sound") && !zstr(val)) {
 			is_locked_sound = val;
-		} else if (!strcasecmp(var, "is-unlocked-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "is-unlocked-sound") && !zstr(val)) {
 			is_unlocked_sound = val;
-		} else if (!strcasecmp(var, "member-flags") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "member-flags") && !zstr(val)) {
 			member_flags = val;
-		} else if (!strcasecmp(var, "conference-flags") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "conference-flags") && !zstr(val)) {
 			conference_flags = val;
-		} else if (!strcasecmp(var, "kicked-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "kicked-sound") && !zstr(val)) {
 			kicked_sound = val;
-		} else if (!strcasecmp(var, "pin") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "pin") && !zstr(val)) {
 			pin = val;
-		} else if (!strcasecmp(var, "pin-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "pin-sound") && !zstr(val)) {
 			pin_sound = val;
-		} else if (!strcasecmp(var, "bad-pin-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "bad-pin-sound") && !zstr(val)) {
 			bad_pin_sound = val;
-		} else if (!strcasecmp(var, "energy-level") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "energy-level") && !zstr(val)) {
 			energy_level = val;
-		} else if (!strcasecmp(var, "caller-id-name") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "caller-id-name") && !zstr(val)) {
 			caller_id_name = val;
-		} else if (!strcasecmp(var, "caller-id-number") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "caller-id-number") && !zstr(val)) {
 			caller_id_number = val;
-		} else if (!strcasecmp(var, "caller-controls") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "caller-controls") && !zstr(val)) {
 			caller_controls = val;
-		} else if (!strcasecmp(var, "comfort-noise") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "comfort-noise") && !zstr(val)) {
 			int tmp;
 			tmp = atoi(val);
 			if (tmp > 1 && tmp < 10000) {
@@ -5740,9 +5740,9 @@
 			} else if (switch_true(val)) {
 				comfort_noise_level = 1400;
 			}
-		} else if (!strcasecmp(var, "sound-prefix") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "sound-prefix") && !zstr(val)) {
 			sound_prefix = val;
-		} else if (!strcasecmp(var, "max-members") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "max-members") && !zstr(val)) {
 			errno = 0;			/* sanity first */
 			max_members = strtol(val, NULL, 0);	/* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
 			if (errno == ERANGE || errno == EINVAL || max_members < 0 || max_members == 1) {
@@ -5752,20 +5752,20 @@
 				max_members = 0;	/* set to 0 to disable max counts */
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "max-members %s is invalid, not setting a limit\n", val);
 			}
-		} else if (!strcasecmp(var, "max-members-sound") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "max-members-sound") && !zstr(val)) {
 			maxmember_sound = val;
-		} else if (!strcasecmp(var, "announce-count") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "announce-count") && !zstr(val)) {
 			errno = 0;			/* safety first */
 			announce_count = strtol(val, NULL, 0);
 			if (errno == ERANGE || errno == EINVAL) {
 				announce_count = 0;
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "announce-count is invalid, not anouncing member counts\n");
 			}
-		} else if (!strcasecmp(var, "suppress-events") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "suppress-events") && !zstr(val)) {
 			suppress_events = val;
-		} else if (!strcasecmp(var, "verbose-events") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "verbose-events") && !zstr(val)) {
 			verbose_events = val;
-		} else if (!strcasecmp(var, "auto-record") && !switch_strlen_zero(val)) {
+		} else if (!strcasecmp(var, "auto-record") && !zstr(val)) {
 			auto_record = val;
 		}
 	}
@@ -5773,17 +5773,17 @@
 	/* Set defaults and various paramaters */
 
 	/* Timer module to use */
-	if (switch_strlen_zero(timer_name)) {
+	if (zstr(timer_name)) {
 		timer_name = "soft";
 	}
 
 	/* Caller ID Name */
-	if (switch_strlen_zero(caller_id_name)) {
+	if (zstr(caller_id_name)) {
 		caller_id_name = (char *) global_app_name;
 	}
 
 	/* Caller ID Number */
-	if (switch_strlen_zero(caller_id_number)) {
+	if (zstr(caller_id_number)) {
 		caller_id_number = "0000000000";
 	}
 
@@ -5823,13 +5823,13 @@
 	conference->caller_id_number = switch_core_strdup(conference->pool, caller_id_number);
 
 
-	if (!switch_strlen_zero(perpetual_sound)) {
+	if (!zstr(perpetual_sound)) {
 		conference->perpetual_sound = switch_core_strdup(conference->pool, perpetual_sound);
 	}
 
 	conference->mflags = MFLAG_CAN_SPEAK | MFLAG_CAN_HEAR;
 	
-	if (!switch_strlen_zero(moh_sound) && switch_is_moh(moh_sound)) {
+	if (!zstr(moh_sound) && switch_is_moh(moh_sound)) {
 		conference->moh_sound = switch_core_strdup(conference->pool, moh_sound);
 	}
 
@@ -5845,75 +5845,75 @@
 		conference->sound_prefix = switch_core_strdup(conference->pool, sound_prefix);
 	}
 
-	if (!switch_strlen_zero(enter_sound)) {
+	if (!zstr(enter_sound)) {
 		conference->enter_sound = switch_core_strdup(conference->pool, enter_sound);
 	}
 
-	if (!switch_strlen_zero(exit_sound)) {
+	if (!zstr(exit_sound)) {
 		conference->exit_sound = switch_core_strdup(conference->pool, exit_sound);
 	}
 
-	if (!switch_strlen_zero(ack_sound)) {
+	if (!zstr(ack_sound)) {
 		conference->ack_sound = switch_core_strdup(conference->pool, ack_sound);
 	}
 
-	if (!switch_strlen_zero(nack_sound)) {
+	if (!zstr(nack_sound)) {
 		conference->nack_sound = switch_core_strdup(conference->pool, nack_sound);
 	}
 
-	if (!switch_strlen_zero(muted_sound)) {
+	if (!zstr(muted_sound)) {
 		conference->muted_sound = switch_core_strdup(conference->pool, muted_sound);
 	}
 
-	if (switch_strlen_zero(mute_detect_sound)) {
-		if (!switch_strlen_zero(muted_sound)) {
+	if (zstr(mute_detect_sound)) {
+		if (!zstr(muted_sound)) {
 			conference->mute_detect_sound = switch_core_strdup(conference->pool, muted_sound);
 		}
 	} else {
 		conference->mute_detect_sound = switch_core_strdup(conference->pool, mute_detect_sound);
 	}
 
-	if (!switch_strlen_zero(unmuted_sound)) {
+	if (!zstr(unmuted_sound)) {
 		conference->unmuted_sound = switch_core_strdup(conference->pool, unmuted_sound);
 	}
 
-	if (!switch_strlen_zero(kicked_sound)) {
+	if (!zstr(kicked_sound)) {
 		conference->kicked_sound = switch_core_strdup(conference->pool, kicked_sound);
 	}
 
-	if (!switch_strlen_zero(pin_sound)) {
+	if (!zstr(pin_sound)) {
 		conference->pin_sound = switch_core_strdup(conference->pool, pin_sound);
 	}
 
-	if (!switch_strlen_zero(bad_pin_sound)) {
+	if (!zstr(bad_pin_sound)) {
 		conference->bad_pin_sound = switch_core_strdup(conference->pool, bad_pin_sound);
 	}
 
-	if (!switch_strlen_zero(pin)) {
+	if (!zstr(pin)) {
 		conference->pin = switch_core_strdup(conference->pool, pin);
 	}
 
-	if (!switch_strlen_zero(alone_sound)) {
+	if (!zstr(alone_sound)) {
 		conference->alone_sound = switch_core_strdup(conference->pool, alone_sound);
 	}
 
-	if (!switch_strlen_zero(locked_sound)) {
+	if (!zstr(locked_sound)) {
 		conference->locked_sound = switch_core_strdup(conference->pool, locked_sound);
 	}
 
-	if (!switch_strlen_zero(is_locked_sound)) {
+	if (!zstr(is_locked_sound)) {
 		conference->is_locked_sound = switch_core_strdup(conference->pool, is_locked_sound);
 	}
 
-	if (!switch_strlen_zero(is_unlocked_sound)) {
+	if (!zstr(is_unlocked_sound)) {
 		conference->is_unlocked_sound = switch_core_strdup(conference->pool, is_unlocked_sound);
 	}
 
-	if (!switch_strlen_zero(energy_level)) {
+	if (!zstr(energy_level)) {
 		conference->energy_level = atoi(energy_level);
 	}
 
-	if (!switch_strlen_zero(maxmember_sound)) {
+	if (!zstr(maxmember_sound)) {
 		conference->maxmember_sound = switch_core_strdup(conference->pool, maxmember_sound);
 	}
 	/* its going to be 0 by default, set to a value otherwise so this should be safe */
@@ -5931,15 +5931,15 @@
 	conference->dtmf_parser = NULL;
 
 	conference->eflags = 0xFFFFFFFF;
-	if (!switch_strlen_zero(suppress_events)) {
+	if (!zstr(suppress_events)) {
 		clear_eflags(suppress_events, &conference->eflags);
 	}
 
-	if (!switch_strlen_zero(auto_record)) {
+	if (!zstr(auto_record)) {
 		conference->auto_record = switch_core_strdup(conference->pool, auto_record);
 	}
 
-	if (!switch_strlen_zero(verbose_events) && switch_true(verbose_events)) {
+	if (!zstr(verbose_events) && switch_true(verbose_events)) {
 		conference->verbose_events = 1;
 	}
 	

Modified: freeswitch/trunk/src/mod/applications/mod_curl/mod_curl.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_curl/mod_curl.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_curl/mod_curl.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -151,7 +151,7 @@
 	curl_easy_cleanup(curl_handle);
 	
 	if (	http_data->stream.data &&
-			!switch_strlen_zero((char *)http_data->stream.data) &&
+			!zstr((char *)http_data->stream.data) &&
 			strcmp(" ", http_data->stream.data) ) {
 		
 		http_data->http_response = switch_core_strdup(pool, http_data->stream.data);
@@ -185,7 +185,7 @@
 			*data = '\0';
 		}
 		
-		if switch_strlen_zero(header->data) {
+		if zstr(header->data) {
 			header = header->next;
 			continue;
 		}
@@ -336,7 +336,7 @@
 
 	switch_memory_pool_t *pool = NULL;
 	
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		switch_goto_status(SWITCH_STATUS_SUCCESS, usage);
 	}
 

Modified: freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -542,7 +542,7 @@
 					} else {
 						fullName = caller_name;
 					}
-					if (switch_strlen_zero(fullName)) {
+					if (zstr(fullName)) {
 						continue;
 					}
 					firstName = switch_core_session_strdup(session, fullName);
@@ -649,29 +649,29 @@
 		switch_safe_free(stream.data);
 	}
 
-	if (switch_strlen_zero_buf(buf)) {
+	if (zstr_buf(buf)) {
 		switch_snprintf(macro, sizeof(macro), "phrase:%s:%d", DIR_RESULT_ITEM, cbt->want+1);
 		switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key);
 	}
 
-	if (!switch_strlen_zero_buf(recorded_name) && switch_strlen_zero_buf(buf)) {
+	if (!zstr_buf(recorded_name) && zstr_buf(buf)) {
         switch_ivr_read(session, 0, 1, recorded_name, NULL, buf, sizeof(buf), 1, profile->terminator_key);
 
 	}
-	if (switch_strlen_zero_buf(recorded_name) && switch_strlen_zero_buf(buf)) {
+	if (zstr_buf(recorded_name) && zstr_buf(buf)) {
 		switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_SAY_NAME, cbt->fullname);
 		switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key);
 	}
-	if (cbt->exten_visible && switch_strlen_zero_buf(buf)) {
+	if (cbt->exten_visible && zstr_buf(buf)) {
 		switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_AT, cbt->extension);
 		switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key);
 	}
-	if (switch_strlen_zero_buf(buf)) {
+	if (zstr_buf(buf)) {
 		switch_snprintf(macro, sizeof(macro), "phrase:%s:%c,%c,%c,%c", DIR_RESULT_MENU, *profile->select_name_key, *profile->next_key, *profile->prev_key, *profile->new_search_key);
 		switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), profile->digit_timeout, profile->terminator_key);
 	}
 
-	if (!switch_strlen_zero_buf(buf)) {
+	if (!zstr_buf(buf)) {
 		if (buf[0] == *profile->select_name_key) {
 			switch_copy_string(cbt->transfer_to, cbt->extension, 255);
 		}
@@ -781,7 +781,7 @@
 		listing_cbt.move = ENTRY_MOVE_NEXT;
 		directory_execute_sql_callback(profile->mutex, sql, listing_callback, &listing_cbt);
 		status = listen_entry(session, profile, &listing_cbt);
-		if (!switch_strlen_zero(listing_cbt.transfer_to)) {
+		if (!zstr(listing_cbt.transfer_to)) {
 			switch_copy_string(params->transfer_to, listing_cbt.transfer_to, 255);
 			break;
 		}
@@ -833,7 +833,7 @@
 	int attempts = 3;
 	char macro[255];
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing profile name\n");
 		return;
 	}
@@ -871,7 +871,7 @@
 		s_param.try_again = 0;
 		gather_name_digit(session, profile, &s_param);
 
-		if (switch_strlen_zero(s_param.digits)) {
+		if (zstr(s_param.digits)) {
 			s_param.try_again = 1;
 			continue;
 		}
@@ -886,7 +886,7 @@
 		navigate_entrys(session, profile, &s_param);
 	}
 
-	if (!switch_strlen_zero(s_param.transfer_to)) {
+	if (!zstr(s_param.transfer_to)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Directory transfering call to : %s\n", s_param.transfer_to);
 		switch_ivr_session_transfer(session, s_param.transfer_to, "XML", domain_name);
 	}

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -55,11 +55,11 @@
 		abort();
 	}
 
-	if (switch_strlen_zero(target)) {
+	if (zstr(target)) {
 		target = caller_profile->destination_number;
 	}
 
-	if (!switch_strlen_zero(target) && (lbuf = switch_core_session_strdup(session, target))
+	if (!zstr(target) && (lbuf = switch_core_session_strdup(session, target))
 		&& (argc = switch_separate_string(lbuf, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) {
 	} else {
 		return NULL;
@@ -91,7 +91,7 @@
 	int argc;
 	char *lbuf = NULL;
 
-	if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+	if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
 		if (!strcasecmp(argv[0], "grammar") && argc >= 1) {
 			switch_ivr_detect_speech_load_grammar(session, argv[1], argv[2]);
@@ -154,7 +154,7 @@
 	int argc;
 	char *lbuf = NULL;
 
-	if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+	if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
 		switch_core_session_execute_exten(session, argv[0], argv[1], argv[2]);
 	} else {
@@ -176,7 +176,7 @@
 	int argc;
 	char *lbuf = NULL;
 
-	if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+	if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
 		switch_ivr_soft_hold(session, argv[0], argv[1], argv[2]);
 	} else {
@@ -205,7 +205,7 @@
 	int argc;
 	char *lbuf = NULL;
 
-	if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+	if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) == 4) {
 		int kval = atoi(argv[0]);
 		switch_bind_flag_t bind_flags = 0;
@@ -283,7 +283,7 @@
 	char *uuid;
 	switch_bool_t bleg = SWITCH_FALSE;
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
 			if (!strcasecmp(argv[0], "-bleg")) {
 				if (argv[1]) {
@@ -327,7 +327,7 @@
 #define eavesdrop_SYNTAX "[all | <uuid>]"
 SWITCH_STANDARD_APP(eavesdrop_function)
 {
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", eavesdrop_SYNTAX);
 	} else {
 		switch_channel_t *channel = switch_core_session_get_channel(session);
@@ -401,7 +401,7 @@
 #define threeway_SYNTAX "<uuid>"
 SWITCH_STANDARD_APP(three_way_function)
 {
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", threeway_SYNTAX);
 	} else {
 		switch_ivr_eavesdrop_session(session, data, NULL, ED_MUX_READ | ED_MUX_WRITE);
@@ -458,7 +458,7 @@
 	char *mydata;
 	switch_call_cause_t cause = SWITCH_CAUSE_CALL_REJECTED;
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) > 1) {
 			if (!switch_check_network_list_ip(argv[0], argv[1])) {
 				switch_channel_t *channel = switch_core_session_get_channel(session);
@@ -486,7 +486,7 @@
 	int bleg = 0, both = 0;
 
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
 			bleg = !strcasecmp(argv[0], "-bleg");
 			both = !strcasecmp(argv[0], "-both");
@@ -521,7 +521,7 @@
 	char *argv[4] = { 0 };
 	char *mydata;
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
 			time_t when;
 
@@ -544,7 +544,7 @@
 	char *argv[5] = { 0 };
 	char *mydata;
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
 			time_t when;
 			switch_call_cause_t cause = SWITCH_CAUSE_ALLOTTED_TIMEOUT;
@@ -577,7 +577,7 @@
 	char *argv[6] = { 0 };
 	char *mydata;
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
 			time_t when;
 			switch_media_flag_t flags = SMF_NONE;
@@ -611,7 +611,7 @@
 {
 	uint32_t len = 0;
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		len = 1000;
 	} else {
 		len = atoi(data);
@@ -630,7 +630,7 @@
 {
 	switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		cause = switch_channel_str2cause(data);
 	}
 
@@ -640,7 +640,7 @@
 SWITCH_STANDARD_APP(set_name_function)
 {
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		switch_channel_set_name(switch_core_session_get_channel(session), (char *) data);
 	}
 }
@@ -660,7 +660,7 @@
 	char *mydata = NULL;
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
-	if (switch_strlen_zero(data) || !(mydata = switch_core_session_strdup(session, data))) {
+	if (zstr(data) || !(mydata = switch_core_session_strdup(session, data))) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "INVALID ARGS!\n");
 		return;
 	}
@@ -729,7 +729,7 @@
 {
 	char *var, *val = NULL;
 	
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
 	} else {
 		switch_channel_t *channel = switch_core_session_get_channel(session);
@@ -740,7 +740,7 @@
 
 		if (val) {
 			*val++ = '\0';
-			if (switch_strlen_zero(val)) {
+			if (zstr(val)) {
 				val = NULL;
 			}
 		}
@@ -762,7 +762,7 @@
 {
 	char *var, *val = NULL;
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
 	} else {
 		var = strdup(data);
@@ -771,7 +771,7 @@
 
 		if (val) {
 			*val++ = '\0';
-			if (switch_strlen_zero(val)) {
+			if (zstr(val)) {
 				val = NULL;
 			}
 		}
@@ -786,7 +786,7 @@
 {
 	char *name, *val = NULL;
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
 	} else {
 		name = switch_core_session_strdup(session, data);
@@ -794,7 +794,7 @@
 
 		if (val) {
 			*val++ = '\0';
-			if (switch_strlen_zero(val)) {
+			if (zstr(val)) {
 				val = NULL;
 			}
 		}
@@ -810,7 +810,7 @@
 	char *new_exports = NULL, *new_exports_d = NULL, *var, *val = NULL, *var_name = NULL;
 	int local = 1;
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
 	} else {
 		exports = switch_channel_get_variable(channel, SWITCH_EXPORT_VARS_VARIABLE);
@@ -827,7 +827,7 @@
 
 		if (val) {
 			*val++ = '\0';
-			if (switch_strlen_zero(val)) {
+			if (zstr(val)) {
 				val = NULL;
 			}
 		}
@@ -853,7 +853,7 @@
 
 SWITCH_STANDARD_APP(unset_function)
 {
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "UNSET [%s]\n", (char *) data);
@@ -889,7 +889,7 @@
 	char *buf;
 	int level = SWITCH_LOG_INFO;
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		level = switch_log_str2level(data);
 	}
 
@@ -916,7 +916,7 @@
 	char *lbuf;
 
 	if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_APPLICATION) == SWITCH_STATUS_SUCCESS) {
-		if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+		if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 			&& (argc = switch_separate_string(lbuf, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) {
 			int x = 0;
 
@@ -966,7 +966,7 @@
 {
 	switch_caller_profile_t *caller_profile = switch_channel_get_caller_profile(switch_core_session_get_channel(session));
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No privacy mode specified.\n");
 	} else {
 		switch_set_flag(caller_profile, SWITCH_CPF_SCREEN);
@@ -996,7 +996,7 @@
 	int argc;
 	char *lbuf;
 
-	if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+	if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 		&& (argc = switch_separate_string(lbuf, '=', argv, (sizeof(argv) / sizeof(argv[0])))) > 1) {
 		switch_size_t retsize;
 		switch_time_exp_t tm;
@@ -1013,7 +1013,7 @@
 {
 	switch_time_t out;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		out = switch_micro_time_now();
 	} else {
 		out = switch_str_time(cmd);
@@ -1031,14 +1031,14 @@
 	char date[80] = "";
 	switch_time_t thetime;
 	char *p;
-	if (!switch_strlen_zero(cmd) && (p = strchr(cmd, '|'))) {
+	if (!zstr(cmd) && (p = strchr(cmd, '|'))) {
 		thetime = switch_time_make(atoi(cmd), 0);
 		cmd = p + 1;
 	} else {
 		thetime = switch_micro_time_now();
 	}
 	switch_time_exp_lt(&tm, thetime);
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
 	} else {
 		switch_strftime(date, &retsize, sizeof(date), cmd, &tm);
@@ -1058,7 +1058,7 @@
 	switch_event_types_t type = SWITCH_EVENT_PRESENCE_IN;
 	int need = 4;
 
-	if (!switch_strlen_zero(cmd) && (lbuf = strdup(cmd))
+	if (!zstr(cmd) && (lbuf = strdup(cmd))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) > 0) {
 
 		if (!strcasecmp(argv[0], "out")) {
@@ -1111,11 +1111,11 @@
 	char *lbuf = NULL, *argv[5];
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (lbuf = strdup(cmd))
+	if (!zstr(cmd) && (lbuf = strdup(cmd))
 		&& (argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])))) >= 4) {
 
 		if (switch_core_chat_send(argv[0], "dp", argv[1], argv[2], "", argv[3],
-								  !switch_strlen_zero(argv[4]) ? argv[4] : NULL , "") == SWITCH_STATUS_SUCCESS) {
+								  !zstr(argv[4]) ? argv[4] : NULL , "") == SWITCH_STATUS_SUCCESS) {
 			stream->write_function(stream, "Sent");
 		} else {
 			stream->write_function(stream, "Error! Message Not Sent");
@@ -1206,7 +1206,7 @@
 {
 	switch_bool_t do_read = SWITCH_TRUE;
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		if (!strcasecmp(data, "write")) {
 			do_read = SWITCH_FALSE;
 		}
@@ -1240,7 +1240,7 @@
 	time_t to = 0;
 	int hits = 1;
 
-	if (switch_strlen_zero(data) || !(mydata = switch_core_session_strdup(session, data))) {
+	if (zstr(data) || !(mydata = switch_core_session_strdup(session, data))) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "INVALID ARGS!\n");
 		return;
 	}
@@ -1362,7 +1362,7 @@
 {
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No timeout specified.\n");
 	} else {
 		uint32_t ms = atoi(data);
@@ -1397,7 +1397,7 @@
 	char *mydata = NULL;
 	switch_input_args_t args = { 0 };
 
-	if (switch_strlen_zero(data) || !(mydata = switch_core_session_strdup(session, data))) {
+	if (zstr(data) || !(mydata = switch_core_session_strdup(session, data))) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Params!\n");
 		return;
 	}
@@ -1610,7 +1610,7 @@
 	const char *var_name = NULL;
 	const char *valid_terminators = NULL;
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No arguments specified.\n");
@@ -1651,7 +1651,7 @@
 		timeout = 1000;
 	}
 
-	if (switch_strlen_zero(valid_terminators)) {
+	if (zstr(valid_terminators)) {
 		valid_terminators = "#";
 	}
 
@@ -1674,7 +1674,7 @@
 	const char *valid_terminators = NULL;
 	const char *digits_regex = NULL;
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No arguments specified.\n");
@@ -1727,7 +1727,7 @@
 		timeout = 1000;
 	}
 
-	if (switch_strlen_zero(valid_terminators)) {
+	if (zstr(valid_terminators)) {
 		valid_terminators = "#";
 	}
 
@@ -1744,7 +1744,7 @@
 	switch_input_args_t args = { 0 };
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
-	if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+	if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) == 4) {
 		
 		args.input_callback = on_dtmf;
@@ -1766,7 +1766,7 @@
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 	switch_status_t status;
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		const char *lang;
 		char *macro = mydata;
 		char *mdata = NULL;
@@ -1885,7 +1885,7 @@
 	int32_t loops = 0;
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
-	if (switch_strlen_zero(data) || !(tone_script = switch_core_session_strdup(session, data))) {
+	if (zstr(data) || !(tone_script = switch_core_session_strdup(session, data))) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Params!\n");
 		return;
 	}
@@ -1915,13 +1915,13 @@
 	char *lbuf = NULL;
 	char *flags = NULL;
 
-	if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+	if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
 		path = argv[0];
 		for (x = 1; x < argc; x++) {
 			if (strchr(argv[x], '+')) {
 				limit = atoi(argv[x]);
-			} else if (!switch_strlen_zero(argv[x])) {
+			} else if (!zstr(argv[x])) {
 				flags = argv[x];
 			}
 		}
@@ -1948,7 +1948,7 @@
 	const char *tmp;
 	int rate;
 
-	if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
+	if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No file specified.\n");
@@ -2013,7 +2013,7 @@
 	char *path_end;
 	uint32_t limit = 0;
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		return;
 	}
 
@@ -2095,7 +2095,7 @@
 	char *camp_data = NULL;
 	switch_status_t status;
 	
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		return;
 	}
 
@@ -2214,7 +2214,7 @@
 			switch_channel_clear_flag(caller_channel, CF_NOT_READY);
 		}
 		
-		if (do_xfer && !switch_strlen_zero(v_campon_fallback_exten)) {
+		if (do_xfer && !zstr(v_campon_fallback_exten)) {
 			switch_ivr_session_transfer(session, 
 										v_campon_fallback_exten, 
 										switch_channel_get_variable(caller_channel, "campon_fallback_dialplan"),
@@ -2468,7 +2468,7 @@
 	char stupid[128] = "";
 	const char *skip = NULL, *var = NULL;
 
-	if (switch_strlen_zero(outbound_profile->destination_number)) {
+	if (zstr(outbound_profile->destination_number)) {
 		goto done;
 	}
 
@@ -2699,7 +2699,7 @@
 	int argc;
 	char *lbuf = NULL;
 	
-	if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+	if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 3) {
 		thresh = atoi(argv[0]);
 		silence_hits = atoi(argv[1]);
@@ -2776,7 +2776,7 @@
 
 		if (proto) {
 			switch_core_chat_send(proto, "api", to, hint && strchr(hint, '/') ? hint : from, 
-								  !switch_strlen_zero(type) ? type : NULL, (char *) stream.data, NULL, NULL);
+								  !zstr(type) ? type : NULL, (char *) stream.data, NULL, NULL);
 		}
 
 		switch_safe_free(stream.data);

Modified: freeswitch/trunk/src/mod/applications/mod_easyroute/mod_easyroute.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_easyroute/mod_easyroute.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_easyroute/mod_easyroute.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -125,13 +125,13 @@
 	}
 	
 done:
-	if (switch_strlen_zero(globals.db_username)) {
+	if (zstr(globals.db_username)) {
 		set_global_db_username("root");
 	}
-	if (switch_strlen_zero(globals.db_password)) {
+	if (zstr(globals.db_password)) {
 		set_global_db_password("password");
 	}
-	if (switch_strlen_zero(globals.db_dsn)) {
+	if (zstr(globals.db_dsn)) {
 		set_global_db_dsn("easyroute");
 	}
 
@@ -208,25 +208,25 @@
 		char tmp_profile[129];
 		char tmp_gateway[129];
 
-		if (switch_strlen_zero(pdata.limit)) {
+		if (zstr(pdata.limit)) {
 			switch_set_string(results->limit, "9999" );
 		} else {
 			switch_set_string(results->limit, pdata.limit );
 		}
 
-		if (switch_strlen_zero(pdata.techprofile)){
+		if (zstr(pdata.techprofile)){
 			switch_set_string(tmp_profile, globals.default_techprofile);
 		} else {
 			switch_set_string(tmp_profile, pdata.techprofile);
 		}
 
-		if (switch_strlen_zero(pdata.gateway)){
+		if (zstr(pdata.gateway)){
 			switch_set_string(tmp_gateway, globals.default_gateway);
 		} else {
 			switch_set_string(tmp_gateway, pdata.gateway);
 		}
 
-		if (switch_strlen_zero(pdata.translated)){
+		if (zstr(pdata.translated)){
 			switch_set_string(results->translated, dn);
 		} else {
 			switch_set_string(results->translated, pdata.translated);
@@ -240,13 +240,13 @@
 		}
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,  "THE ROUTE [%s]\n", results->dialstring);
 
-		if (switch_strlen_zero(pdata.group)){
+		if (zstr(pdata.group)){
 			switch_set_string(results->group, "");
 		} else {
 			switch_set_string(results->group, pdata.group);
 		}
 
-		if (switch_strlen_zero(pdata.acctcode)){
+		if (zstr(pdata.acctcode)){
 			switch_set_string(results->acctcode, "");
 		} else {
 			switch_set_string(results->acctcode, pdata.acctcode);

Modified: freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_enum/mod_enum.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -471,7 +471,7 @@
 		root = mroot;
 	}
 
-	if (switch_strlen_zero(root)) {
+	if (zstr(root)) {
 		root = globals.root;
 	}
 
@@ -675,7 +675,7 @@
 	char *last_delim = "|";
 	int ok = 0;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%s", "none");
 		return SWITCH_STATUS_SUCCESS;
 	}

Modified: freeswitch/trunk/src/mod/applications/mod_esf/mod_esf.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_esf/mod_esf.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_esf/mod_esf.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -83,7 +83,7 @@
 
     switch_core_session_get_read_impl(session, &read_impl);
 
-	if (!switch_strlen_zero((char *) data)) {
+	if (!zstr((char *) data)) {
 		mydata = switch_core_session_strdup(session, data);
 		assert(mydata != NULL);
 
@@ -93,20 +93,20 @@
 			mcast_ip = switch_core_session_strdup(session, var);
 		}
 
-		if (!switch_strlen_zero(argv[0])) {
+		if (!zstr(argv[0])) {
 			mcast_ip = argv[0];
 		}
 
-		if (!switch_strlen_zero(argv[1])) {
+		if (!zstr(argv[1])) {
 			mcast_port_str = argv[1];
 			mcast_port = (switch_port_t) atoi(mcast_port_str);
 		}
 
-		if (!switch_strlen_zero(argv[2])) {
+		if (!zstr(argv[2])) {
 			mcast_control_port = (switch_port_t) atoi(argv[2]);
 		}
 		
-		if (!switch_strlen_zero(argv[3])) {
+		if (!zstr(argv[3])) {
 			mcast_ttl = atoi(argv[3]);
 			if (mcast_ttl < 1 || mcast_ttl > 255) {
 				mcast_ttl = 1;

Modified: freeswitch/trunk/src/mod/applications/mod_expr/mod_expr.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_expr/mod_expr.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_expr/mod_expr.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -54,7 +54,7 @@
 	size_t len;
 	int ec = 0;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto error;
 	}
 

Modified: freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -133,7 +133,7 @@
 		break;
 	}
 
-	if (!switch_strlen_zero(msg)) {
+	if (!zstr(msg)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
 	}
 }
@@ -511,7 +511,7 @@
 		}
 	}
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		pvt->filename = switch_core_session_strdup(session, data);
 		if (pvt->app_mode == FUNCTION_TX) {
 			if ((switch_file_exists(pvt->filename, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS)) {
@@ -706,11 +706,11 @@
 				const char *name = switch_xml_attr(x_list, "name");
 				const char *value = switch_xml_attr(x_list, "value");
 
-				if (switch_strlen_zero(name)) {
+				if (zstr(name)) {
 					continue;
 				}
 
-				if (switch_strlen_zero(value)) {
+				if (zstr(value)) {
 					continue;
 				}
 

Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -146,7 +146,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-#define check_string(s) if (!switch_strlen_zero(s) && !strcasecmp(s, "undef")) { s = NULL; }
+#define check_string(s) if (!zstr(s) && !strcasecmp(s, "undef")) { s = NULL; }
 
 static int node_consumer_wait_count(fifo_node_t *node)
 {
@@ -297,7 +297,7 @@
 		if (switch_odbc_handle_exec(globals.master_odbc, sql, &stmt) != SWITCH_ODBC_SUCCESS) {
 			
 			err_str = switch_odbc_handle_get_error(globals.master_odbc, stmt);
-			if (!switch_strlen_zero(err_str)) {
+			if (!zstr(err_str)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, switch_str_nil(err_str));
 			}
 			switch_safe_free(err_str);
@@ -752,7 +752,7 @@
 	int argc;
 	uint32_t priority = 0;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto fail;
 	}
 
@@ -819,7 +819,7 @@
 		return;
 	}
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No Args\n");
 		return;
 	}
@@ -1139,7 +1139,7 @@
 		fifo_strategy_t strat = STRAT_WAITING_LONGER;
 		char *url = NULL;
 
-		if (!switch_strlen_zero(strat_str)) {
+		if (!zstr(strat_str)) {
 			if (!strcasecmp(strat_str, "more_ppl")) {
 				strat = STRAT_MORE_PPL;
 			} else if (!strcasecmp(strat_str, "waiting_longer")) {
@@ -1489,7 +1489,7 @@
 				fifo_consumer_wrapup_sound = switch_channel_get_variable(channel, "fifo_consumer_wrapup_sound");
 				fifo_consumer_wrapup_key = switch_channel_get_variable(channel, "fifo_consumer_wrapup_key");
 				sfifo_consumer_wrapup_time = switch_channel_get_variable(channel, "fifo_consumer_wrapup_time");
-				if (!switch_strlen_zero(sfifo_consumer_wrapup_time)){
+				if (!zstr(sfifo_consumer_wrapup_time)){
 					fifo_consumer_wrapup_time = atoi(sfifo_consumer_wrapup_time);
 				} else {
 					fifo_consumer_wrapup_time = 5000;
@@ -1497,7 +1497,7 @@
 
 				memset(buf, 0, sizeof(buf));
 
-				if (fifo_consumer_wrapup_time || !switch_strlen_zero(fifo_consumer_wrapup_key)) {
+				if (fifo_consumer_wrapup_time || !zstr(fifo_consumer_wrapup_key)) {
 					switch_channel_set_variable(channel, "fifo_status", "WRAPUP");
 					if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
 						switch_channel_event_set_data(channel, event);
@@ -1507,7 +1507,7 @@
 					}
 				}
 
-				if (!switch_strlen_zero(fifo_consumer_wrapup_sound)) {
+				if (!zstr(fifo_consumer_wrapup_sound)) {
 					memset(&args, 0, sizeof(args));
 					args.buf = buf;
 					args.buflen = sizeof(buf);
@@ -1518,7 +1518,7 @@
 					wrapup_time_started = switch_micro_time_now();
 				}
 
-				if (!switch_strlen_zero(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) {
+				if (!zstr(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) {
 					while(switch_channel_ready(channel)) {
 						char terminator = 0;
 						
@@ -1537,7 +1537,7 @@
 						}
 
 					}
-				} else if (fifo_consumer_wrapup_time && (switch_strlen_zero(fifo_consumer_wrapup_key) || !strcmp(buf, fifo_consumer_wrapup_key))) {
+				} else if (fifo_consumer_wrapup_time && (zstr(fifo_consumer_wrapup_key) || !strcmp(buf, fifo_consumer_wrapup_key))) {
 					while(switch_channel_ready(channel)) {
 						wrapup_time_elapsed = (switch_micro_time_now() - wrapup_time_started) / 1000;
 						if (wrapup_time_elapsed > fifo_consumer_wrapup_time) {
@@ -1761,12 +1761,12 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		data = strdup(cmd);
 		switch_assert(data);
 	}
 
-	if (switch_strlen_zero(cmd) || (argc = switch_separate_string(data, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) < 1 || !argv[0]) {
+	if (zstr(cmd) || (argc = switch_separate_string(data, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) < 1 || !argv[0]) {
 		stream->write_function(stream, "%s\n", FIFO_API_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1897,7 +1897,7 @@
 			var = (char *) switch_xml_attr_soft(param, "name");
 			val = (char *) switch_xml_attr_soft(param, "value");
 
-			if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
+			if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
 				if (switch_odbc_available()) {
 					globals.odbc_dsn = switch_core_strdup(globals.pool, val);
 					if ((odbc_user = strchr(globals.odbc_dsn, ':'))) {
@@ -1915,7 +1915,7 @@
 		}
 	}
 
-	if (switch_strlen_zero(globals.odbc_dsn) || switch_strlen_zero(odbc_user) || switch_strlen_zero(odbc_pass)) {
+	if (zstr(globals.odbc_dsn) || zstr(odbc_user) || zstr(odbc_pass)) {
 		globals.dbname = "fifo";
 	}
 
@@ -2190,7 +2190,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-	if (switch_strlen_zero(cmd)){
+	if (zstr(cmd)){
 		stream->write_function(stream, "-USAGE: %s\n", FIFO_MEMBER_API_SYNTAX);
 		return SWITCH_STATUS_SUCCESS;
 	}

Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -174,7 +174,7 @@
 	char *dst_regex = NULL;
 	switch_channel_t *channel = NULL;
 	
-	if (!switch_strlen_zero(cid)) {
+	if (!zstr(cid)) {
 		len = strlen(cid);
 	} else {
 		goto done;
@@ -275,12 +275,12 @@
 		}
 	}	
 	codec = "";
-	if (!switch_strlen_zero(cur_route->codec)) {
+	if (!zstr(cur_route->codec)) {
 		codec = switch_core_sprintf(pool, ",absolute_codec_string=%s", cur_route->codec);
 	}
 	
 	cid = "";
-	if (!switch_strlen_zero(cur_route->cid)) {
+	if (!zstr(cur_route->cid)) {
 		cid = switch_core_sprintf(pool, ",origination_caller_id_number=%s", 
 								  do_cid(pool, cur_route->cid, caller_id, session));
 	}
@@ -292,7 +292,7 @@
 									  cur_route->carrier_name);
 	}
 	
-	if (switch_strlen_zero(cur_route->user_rate_str)) {
+	if (zstr(cur_route->user_rate_str)) {
 		user_rate = "";
 	} else {
 		user_rate = switch_core_sprintf(pool, ",lcr_user_rate=%s", cur_route->user_rate_str);
@@ -312,7 +312,7 @@
 {
 	profile_t *profile = NULL;
 	
-	if (switch_strlen_zero(profile_name)) {
+	if (zstr(profile_name)) {
 		profile = globals.default_profile;
 	} else if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error invalid profile %s\n", profile_name);
@@ -555,7 +555,7 @@
 		return SWITCH_STATUS_GENERR;
 	}
 
-	if (switch_strlen_zero(argv[LCR_GW_PREFIX_PLACE]) && switch_strlen_zero(argv[LCR_GW_SUFFIX_PLACE]) ) {
+	if (zstr(argv[LCR_GW_PREFIX_PLACE]) && zstr(argv[LCR_GW_SUFFIX_PLACE]) ) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
 								"There's no way to dial this Gateway: Carrier: \"%s\" Prefix: \"%s\", Suffix \"%s\"\n",
 								switch_str_nil(argv[LCR_CARRIER_PLACE]),
@@ -737,7 +737,7 @@
 	switch_assert(cb_struct->lookup_number != NULL);
 
 	digits_copy = string_digitsonly(cb_struct->pool, digits);
-	if (switch_strlen_zero(digits_copy)) {
+	if (zstr(digits_copy)) {
 		return SWITCH_STATUS_GENERR;
 	}
 	
@@ -862,7 +862,7 @@
 			char *val = NULL;
 			var = (char *) switch_xml_attr_soft(param, "name");
 			val = (char *) switch_xml_attr_soft(param, "value");
-			if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
+			if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "odbc_dsn is %s\n", val);
 				globals.odbc_dsn = switch_core_strdup(globals.pool, val);
 				if ((odbc_user = strchr(globals.odbc_dsn, ':'))) {
@@ -922,13 +922,13 @@
 				var = (char *) switch_xml_attr_soft(param, "name");
 				val = (char *) switch_xml_attr_soft(param, "value");
 				
-				if (!strcasecmp(var, "order_by")  && !switch_strlen_zero(val)) {
+				if (!strcasecmp(var, "order_by")  && !zstr(val)) {
 					thisorder = &order_by;
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "param val is %s\n", val);
 					if ((argc = switch_separate_string(val, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) {
 						for (x=0; x<argc; x++) {
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "arg #%d/%d is %s\n", x, argc, argv[x]);
-							if (!switch_strlen_zero(argv[x])) {
+							if (!zstr(argv[x])) {
 								if (!strcasecmp(argv[x], "quality")) {
 									thisorder->write_function(thisorder, "%s quality DESC", comma);
 								} else if (!strcasecmp(argv[x], "reliability")) {
@@ -951,40 +951,40 @@
 							thisorder->write_function(thisorder, "%s %s", comma, val);
 						}
 					}
-				} else if (!strcasecmp(var, "id") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "id") && !zstr(val)) {
 					id_s = val;
-				} else if (!strcasecmp(var, "custom_sql") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "custom_sql") && !zstr(val)) {
 					custom_sql = val;
-				} else if (!strcasecmp(var, "reorder_by_rate") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "reorder_by_rate") && !zstr(val)) {
 					reorder_by_rate = val;
-				} else if (!strcasecmp(var, "info_in_headers") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "info_in_headers") && !zstr(val)) {
 					info_in_headers = val;
-				} else if (!strcasecmp(var, "quote_in_list") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "quote_in_list") && !zstr(val)) {
 					quote_in_list = val;
 				}
 			}
 			
-			if (switch_strlen_zero(name)) {
+			if (zstr(name)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No name specified.\n");
 			} else {
 				profile = switch_core_alloc(globals.pool, sizeof(*profile));
 				memset(profile, 0, sizeof(profile_t));
 				profile->name = switch_core_strdup(globals.pool, name);
 				
-				if (!switch_strlen_zero((char *)order_by.data)) {
+				if (!zstr((char *)order_by.data)) {
 					profile->order_by = switch_core_strdup(globals.pool, (char *)order_by.data);
 				} else {
 					/* default to rate */
 					profile->order_by = ", ${lcr_rate_field}";
 				}
 
-				if (!switch_strlen_zero(id_s)) {
+				if (!zstr(id_s)) {
 					profile->id = (uint16_t)atoi(id_s);
 				}
 				
 				/* SWITCH_STANDARD_STREAM doesn't use pools.  but we only have to free sql_stream.data */
 				SWITCH_STANDARD_STREAM(sql_stream);
-				if (switch_strlen_zero(custom_sql)) {
+				if (zstr(custom_sql)) {
 					/* use default sql */
 					sql_stream.write_function(&sql_stream, 
 											  "SELECT l.digits, c.carrier_name, l.${lcr_rate_field}, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix, l.lead_strip, l.trail_strip, l.prefix, l.suffix "
@@ -1046,15 +1046,15 @@
 				}
 				profile->custom_sql = switch_core_strdup(globals.pool, (char *)custom_sql);
 				
-				if (!switch_strlen_zero(reorder_by_rate)) {
+				if (!zstr(reorder_by_rate)) {
 					profile->reorder_by_rate = switch_true(reorder_by_rate);
 				}
 				
-				if (!switch_strlen_zero(info_in_headers)) {
+				if (!zstr(info_in_headers)) {
 					profile->info_in_headers = switch_true(info_in_headers);
 				}
 				
-				if (!switch_strlen_zero(quote_in_list)) {
+				if (!zstr(quote_in_list)) {
 					profile->quote_in_list = switch_true(quote_in_list);
 				}
 				
@@ -1124,10 +1124,10 @@
 	intralata = switch_channel_get_variable(channel, "intralata");
 	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "intrastate channel var is [%s]\n", intrastate);
 	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "intralata channel var is [%s]\n", intralata);
-	if (!switch_strlen_zero(intralata) && !strcasecmp((char *)intralata, "true")) {
+	if (!zstr(intralata) && !strcasecmp((char *)intralata, "true")) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Select routes based on intralata rates\n");
 		routes.intralata = SWITCH_FALSE;
-	} else if (!switch_strlen_zero(intrastate) && !strcasecmp((char *)intrastate, "true")) {
+	} else if (!zstr(intrastate) && !strcasecmp((char *)intrastate, "true")) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Select routes based on intrastate rates\n");
 		routes.intrastate = SWITCH_TRUE;
 	} else {
@@ -1214,8 +1214,8 @@
 
 	intra = switch_channel_get_variable(channel, "intrastate");
 	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "intrastate channel var is [%s]\n", 
-					switch_strlen_zero(intra) ? "undef" : intra);
-	if (switch_strlen_zero(intra) || strcasecmp((char *)intra, "true")) {
+					zstr(intra) ? "undef" : intra);
+	if (zstr(intra) || strcasecmp((char *)intra, "true")) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Select routes based on interstate rates\n");
 		routes.intrastate = SWITCH_FALSE;
 	} else {
@@ -1308,7 +1308,7 @@
 	switch_bool_t as_xml = SWITCH_FALSE;
 	int rowcount=0;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto usage;
 	}
 
@@ -1354,7 +1354,7 @@
 				}
 			}
 		} 
-		if (switch_strlen_zero(cb_struct.cid)) {
+		if (zstr(cb_struct.cid)) {
 			cb_struct.cid = "18005551212";
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING
 							  , "Using default CID [%s]\n", cb_struct.cid
@@ -1480,7 +1480,7 @@
 	void *val;
 	profile_t *profile;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto usage;
 	}
 
@@ -1497,7 +1497,7 @@
 				profile = (profile_t *) val;
 				
 				stream->write_function(stream, "Name:\t\t%s\n", profile->name);
-				if (switch_strlen_zero(profile->custom_sql)) {
+				if (zstr(profile->custom_sql)) {
 					stream->write_function(stream, " ID:\t\t%d\n", profile->id);
 					stream->write_function(stream, " order by:\t%s\n", profile->order_by);
 				} else {

Modified: freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -102,7 +102,7 @@
 		if (switch_odbc_handle_exec(globals.master_odbc, sql, &stmt) != SWITCH_ODBC_SUCCESS) {
 			char *err_str;
 			err_str = switch_odbc_handle_get_error(globals.master_odbc, stmt);
-			if (!switch_strlen_zero(err_str)) {
+			if (!zstr(err_str)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, switch_str_nil(err_str));
 			}
 			switch_safe_free(err_str);
@@ -199,7 +199,7 @@
 	}
 	
 
-	if (switch_strlen_zero(globals.odbc_dsn) || switch_strlen_zero(odbc_user) || switch_strlen_zero(odbc_pass)) {
+	if (zstr(globals.odbc_dsn) || zstr(odbc_user) || zstr(odbc_pass)) {
 		globals.dbname = "call_limit";
 	}
 
@@ -447,7 +447,7 @@
 
 	switch_mutex_lock(globals.mutex);
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		mydata = strdup(cmd);
 		switch_assert(mydata);
 		argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0])));
@@ -518,7 +518,7 @@
 	char *mydata = NULL;
 	char *sql = NULL;
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = switch_core_session_strdup(session, data);
 		argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -567,7 +567,7 @@
 	
 	switch_mutex_lock(globals.db_hash_mutex);
 	
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = strdup(data);
 		switch_assert(mydata);
 		argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0])));
@@ -621,7 +621,7 @@
 
 	switch_mutex_lock(globals.db_hash_mutex);
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		mydata = strdup(cmd);
 		switch_assert(mydata);
 		argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0])));
@@ -683,7 +683,7 @@
 
 	switch_mutex_lock(globals.mutex);
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		mydata = strdup(cmd);
 		argc = switch_separate_string(mydata, ':', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -766,7 +766,7 @@
 	char *mydata = NULL;
 	char *sql;
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = switch_core_session_strdup(session, data);
 		argc = switch_separate_string(mydata, ':', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -865,7 +865,7 @@
 	int max = 0;
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = switch_core_session_strdup(session, data);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -931,7 +931,7 @@
 	int max = -1;
 
 	/* Parse application data  */
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = switch_core_session_strdup(session, data);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -958,7 +958,7 @@
 	app = argv[3];
 	app_arg = argv[4];
 
-	if (switch_strlen_zero(app)) {
+	if (zstr(app)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing application\n");
 		return;
 	}
@@ -982,7 +982,7 @@
 	callback_t cbt = { 0 };
 
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		mydata = strdup(cmd);
 		switch_assert(mydata);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
@@ -1158,7 +1158,7 @@
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
 	/* Parse application data  */
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = switch_core_session_strdup(session, data);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1223,7 +1223,7 @@
 	int interval = 0;
 
 	/* Parse application data  */
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = switch_core_session_strdup(session, data);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1258,7 +1258,7 @@
 	app = argv[3];
 	app_arg = argv[4];
 
-	if (switch_strlen_zero(app)) {
+	if (zstr(app)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing application\n");
 		return;
 	}
@@ -1282,7 +1282,7 @@
 
 	switch_mutex_lock(globals.limit_hash_mutex);
 	
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		mydata = strdup(cmd);
 		switch_assert(mydata);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
@@ -1495,7 +1495,7 @@
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
 	/* Parse application data  */
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = switch_core_session_strdup(session, data);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1556,7 +1556,7 @@
 	char *szinterval = NULL;
 
 	/* Parse application data  */
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = switch_core_session_strdup(session, data);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -1588,7 +1588,7 @@
 	app = argv[3];
 	app_arg = argv[4];
 
-	if (switch_strlen_zero(app)) {
+	if (zstr(app)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing application\n");
 		return;
 	}
@@ -1619,7 +1619,7 @@
 		goto end;
 	}
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		mydata = strdup(cmd);
 		switch_assert(mydata);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));

Modified: freeswitch/trunk/src/mod/applications/mod_memcache/mod_memcache.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_memcache/mod_memcache.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_memcache/mod_memcache.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -160,7 +160,7 @@
 	memcached_stat_st *stat = NULL;
 	memcached_server_st *server_list;
 	
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto usage;
 	}
 	

Modified: freeswitch/trunk/src/mod/applications/mod_nibblebill/mod_nibblebill.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_nibblebill/mod_nibblebill.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_nibblebill/mod_nibblebill.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -189,22 +189,22 @@
 	
 /* Set defaults for any variables still not set */
 setdefaults:
-	if (switch_strlen_zero(globals.db_username)) {
+	if (zstr(globals.db_username)) {
 		set_global_db_username("bandwidth.com");
 	}
-	if (switch_strlen_zero(globals.db_password)) {
+	if (zstr(globals.db_password)) {
 		set_global_db_password("dev");
 	}
-	if (switch_strlen_zero(globals.db_dsn)) {
+	if (zstr(globals.db_dsn)) {
 		set_global_db_dsn("bandwidth.com");
 	}
-	if (switch_strlen_zero(globals.percall_action)) {
+	if (zstr(globals.percall_action)) {
 		set_global_percall_action("hangup");
 	}
-	if (switch_strlen_zero(globals.lowbal_action)) {
+	if (zstr(globals.lowbal_action)) {
 		set_global_lowbal_action("play ding");
 	}
-	if (switch_strlen_zero(globals.nobal_action)) {
+	if (zstr(globals.nobal_action)) {
 		set_global_nobal_action("hangup");
 	}
 
@@ -722,7 +722,7 @@
 	char *lbuf = NULL;
 	char *argv[3] = { 0 };
 
-	if (!switch_strlen_zero(data) && (lbuf = strdup(data))
+	if (!zstr(data) && (lbuf = strdup(data))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
 		if (!strcasecmp(argv[0], "adjust") && argc == 2) {
 			nibblebill_adjust(session, (float)atof(argv[1]));
@@ -751,9 +751,9 @@
 	char *mycmd = NULL, *argv[3] = { 0 };
 	int argc = 0;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
-		if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) {
+		if ((argc == 2 || argc == 3) && !zstr(argv[0])) {
 			char *uuid = argv[0];
 			if ((psession = switch_core_session_locate(uuid))) {
 				switch_channel_t *channel;

Modified: freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -234,7 +234,7 @@
 
 	switch_channel_answer(channel);
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		if ((mydata = switch_core_session_strdup(session, data))) {
 			argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]));
 
@@ -394,7 +394,7 @@
 
 		err = switch_xml_error(xml);
 
-		if (!switch_strlen_zero(err)) {
+		if (!zstr(err)) {
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Error [%s]\n", err);
 			goto finished;
 		}

Modified: freeswitch/trunk/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp	2009-10-23 16:03:42 UTC (rev 15211)
@@ -255,7 +255,7 @@
 	int x;
 
 	if ((bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_soundtouch_"))) {
-		if (!switch_strlen_zero(data) && !strcasecmp(data, "stop")) {
+		if (!zstr(data) && !strcasecmp(data, "stop")) {
 			switch_channel_set_private(channel, "_soundtouch_", NULL);
 			switch_core_media_bug_remove(session, &bug);
 		} else {

Modified: freeswitch/trunk/src/mod/applications/mod_spy/mod_spy.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_spy/mod_spy.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_spy/mod_spy.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -188,7 +188,7 @@
 	char* argv[2] = {0};
 	char* params = NULL;
 
-	if (!switch_strlen_zero(data) && (params = switch_core_session_strdup(session,data))) {
+	if (!zstr(data) && (params = switch_core_session_strdup(session,data))) {
 		if ((argc = switch_separate_string(params, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
 
 			switch_channel_t *channel = switch_core_session_get_channel(session);

Modified: freeswitch/trunk/src/mod/applications/mod_stress/mod_stress.cpp (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_stress/mod_stress.cpp	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_stress/mod_stress.cpp	2009-10-23 16:03:42 UTC (rev 15211)
@@ -206,7 +206,7 @@
 	int x = 0;
 
 	if ((bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_stress_"))) {
-		if (!switch_strlen_zero(data) && !strcasecmp(data, "stop")) {
+		if (!zstr(data) && !strcasecmp(data, "stop")) {
 			switch_channel_set_private(channel, "_stress_", NULL);
 			switch_core_media_bug_remove(session, &bug);
 		} else {

Modified: freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -115,7 +115,7 @@
 	char dtmf_buf[128] = "";
 	int is_auto = 0;
 
-	if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
+	if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
 		&& (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
 		char *lot_name = argv[0];
 		char *ext = argv[1];
@@ -311,7 +311,7 @@
 		name = (char *) var;
 		lot = (valet_lot_t *) val;
 		
-		if (!switch_strlen_zero(cmd) && strcasecmp(cmd, name)) continue;
+		if (!zstr(cmd) && strcasecmp(cmd, name)) continue;
 		
 		stream->write_function(stream, "  <lot name=\"%s\">\n", name);
 

Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -624,7 +624,7 @@
     int i;
 
     /* No command? Display usage */
-    if (switch_strlen_zero(cmd)) {
+    if (zstr(cmd)) {
         stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX);
         return SWITCH_STATUS_SUCCESS;
     }

Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (15210 => 15211)


--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -669,7 +669,7 @@
 		switch_thread_rwlock_create(&profile->rwlock, pool);
 		profile->name = switch_core_strdup(pool, profile_name);
 
-		if (!switch_strlen_zero(profile->odbc_dsn)) {
+		if (!zstr(profile->odbc_dsn)) {
 			if ((profile->odbc_user = strchr(profile->odbc_dsn, ':'))) {
 				*(profile->odbc_user++) = '\0';
 				if ((profile->odbc_pass = strchr(profile->odbc_user, ':'))) {
@@ -1571,7 +1571,7 @@
 				char *sql = switch_mprintf("update voicemail_msgs set flags='delete' where uuid='%s'", cbt->uuid);
 				vm_execute_sql(profile, sql, profile->mutex);
 				switch_safe_free(sql);
-				if (!strcmp(input, profile->email_key) && !switch_strlen_zero(cbt->email)) {
+				if (!strcmp(input, profile->email_key) && !zstr(cbt->email)) {
 					switch_event_t *event;
 					char *from;
 					char *headers, *header_string;
@@ -1631,13 +1631,13 @@
 					switch_channel_set_variable(channel, "voicemail_message_len", duration_str);
 					switch_channel_set_variable(channel, "voicemail_email", cbt->email);
 
-					if (switch_strlen_zero(profile->email_headers)) {
+					if (zstr(profile->email_headers)) {
 						from = switch_core_session_sprintf(session, "%s@%s", cbt->user, cbt->domain);
 					} else {
 						from = switch_channel_expand_variables(channel, profile->email_from);
 					}
 
-					if (switch_strlen_zero(profile->email_headers)) {
+					if (zstr(profile->email_headers)) {
 						headers = switch_core_session_sprintf(session,
 															  "From: FreeSWITCH mod_voicemail <%s@%s>\nSubject: Voicemail from %s %s\nX-Priority: %d",
 															  cbt->user, cbt->domain, cbt->cid_name, cbt->cid_number, priority);
@@ -1818,7 +1818,7 @@
 					switch_snprintf(msg_count, sizeof(msg_count), "%d:urgent-new", total_new_urgent_messages);
 					TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, &folder_args));
 					informed++;
-					if (!switch_strlen_zero_buf(global_buf)) {
+					if (!zstr_buf(global_buf)) {
 						vm_check_state = VM_CHECK_MENU;
 						continue;
 					}
@@ -1827,7 +1827,7 @@
 					switch_snprintf(msg_count, sizeof(msg_count), "%d:new", total_new_messages);
 					TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, &folder_args));
 					informed++;
-					if (!switch_strlen_zero_buf(global_buf)) {
+					if (!zstr_buf(global_buf)) {
 						vm_check_state = VM_CHECK_MENU;
 						continue;
 					}
@@ -2047,7 +2047,7 @@
 				char input[10] = "";
 				char key_buf[80] = "";
 				play_msg_type = MSG_NONE;
-				if (!switch_strlen_zero_buf(global_buf)) {
+				if (!zstr_buf(global_buf)) {
 					switch_set_string(input, global_buf);
 					*global_buf = '\0';
 					status = SWITCH_STATUS_SUCCESS;
@@ -2157,8 +2157,8 @@
 					} else if (!auth && !thepass && !strcasecmp(var, "password")) {
 						thepass = switch_core_session_strdup(session, val);
 					} else if (!auth && !strcasecmp(var, "vm-password")) {
-						if (!switch_strlen_zero(val) && !strcasecmp(val, "user-choose")) {
-							if (switch_strlen_zero(cbt.password)) {
+						if (!zstr(val) && !strcasecmp(val, "user-choose")) {
+							if (zstr(cbt.password)) {
 								auth = 1;
 							} else {
 								thepass = switch_core_session_strdup(session, val);
@@ -2202,12 +2202,12 @@
 					thehash = vmhash;
 				}
 				
-				if (!auth && !thepass && !switch_strlen_zero(cbt.password)) {
+				if (!auth && !thepass && !zstr(cbt.password)) {
 					thepass = cbt.password;
 				}
 
 				if (!auth) {
-					if (!switch_strlen_zero(cbt.password) && !strcmp(cbt.password, mypass)) {
+					if (!zstr(cbt.password) && !strcmp(cbt.password, mypass)) {
 						auth++;
 					} else if (!thepass) {
 						auth++;
@@ -2234,9 +2234,9 @@
 				
 				if (auth) {
 					if (!dir_path) {
-						if (!switch_strlen_zero(vm_storage_dir)) {
+						if (!zstr(vm_storage_dir)) {
 							dir_path = switch_core_session_sprintf(session, "%s%s%s", vm_storage_dir, SWITCH_PATH_SEPARATOR, myid);
-						} else if ( !switch_strlen_zero(profile->storage_dir) ) {
+						} else if ( !zstr(profile->storage_dir) ) {
 							dir_path = switch_core_session_sprintf(session, "%s%s%s%s%s", profile->storage_dir, SWITCH_PATH_SEPARATOR, domain_name, SWITCH_PATH_SEPARATOR, myid);
 						} else {
 							dir_path = switch_core_session_sprintf(session, "%s%svoicemail%s%s%s%s%s%s", SWITCH_GLOBAL_dirs.storage_dir,
@@ -2389,9 +2389,9 @@
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deliver VM to %s@%s\n", myid, domain_name);
 
-	if (!switch_strlen_zero(vm_storage_dir)) {
+	if (!zstr(vm_storage_dir)) {
 		dir_path = switch_mprintf("%s%s%s", vm_storage_dir, SWITCH_PATH_SEPARATOR, myid);
-	} else if (!switch_strlen_zero(profile->storage_dir)) {
+	} else if (!zstr(profile->storage_dir)) {
 		dir_path = switch_mprintf("%s%s%s%s%s", profile->storage_dir, SWITCH_PATH_SEPARATOR, domain_name, SWITCH_PATH_SEPARATOR, myid);
 	} else {
 		dir_path = switch_mprintf("%s%svoicemail%s%s%s%s%s%s", SWITCH_GLOBAL_dirs.storage_dir,
@@ -2450,7 +2450,7 @@
 		update_mwi(profile, myid, domain_name, myfolder);
 	}
 
-	if (send_mail && !switch_strlen_zero(vm_email) && switch_file_exists(file_path, pool) == SWITCH_STATUS_SUCCESS) {
+	if (send_mail && !zstr(vm_email) && switch_file_exists(file_path, pool) == SWITCH_STATUS_SUCCESS) {
 		switch_event_t *event;
 		char *from;
 		char *body;
@@ -2472,7 +2472,7 @@
 		message_count(profile, myid, domain_name, myfolder, &total_new_messages, &total_saved_messages,
 					  &total_new_urgent_messages, &total_saved_urgent_messages);
 
-		if (switch_strlen_zero(vm_timezone) || (switch_strftime_tz(vm_timezone, profile->date_fmt, date, sizeof(date), 0) != SWITCH_STATUS_SUCCESS)) {
+		if (zstr(vm_timezone) || (switch_strftime_tz(vm_timezone, profile->date_fmt, date, sizeof(date), 0) != SWITCH_STATUS_SUCCESS)) {
 			switch_time_exp_lt(&tm, switch_micro_time_now());
 			switch_strftime(date, &retsize, sizeof(date), profile->date_fmt, &tm);
 		}
@@ -2510,7 +2510,7 @@
 
 		switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_message_len", duration_str);
 
-		if (switch_strlen_zero(profile->email_from)) {
+		if (zstr(profile->email_from)) {
 			from = switch_core_sprintf(pool, "%s@%s", myid, domain_name);
 		} else {
 			from = switch_event_expand_headers(params, profile->email_from);
@@ -2518,7 +2518,7 @@
 
 
 		if (send_main) {
-			if (switch_strlen_zero(profile->email_headers)) {
+			if (zstr(profile->email_headers)) {
 				headers = switch_mprintf(
 										 "From: FreeSWITCH mod_voicemail <%s@%s>\n"
 										 "Subject: Voicemail from %s %s\nX-Priority: %d",
@@ -2570,7 +2570,7 @@
 
 
 		if (send_notify) {
-			if (switch_strlen_zero(profile->notify_email_headers)) {
+			if (zstr(profile->notify_email_headers)) {
 				headers = switch_mprintf(
 										 "From: FreeSWITCH mod_voicemail <%s@%s>\n"
 										 "Subject: Voicemail from %s %s\nX-Priority: %d",
@@ -2648,7 +2648,7 @@
 	char *box, *path, *cid_num, *cid_name;
 	switch_memory_pool_t *pool = NULL;
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		status = SWITCH_STATUS_FALSE;
 		goto end;
 	}
@@ -2906,17 +2906,17 @@
 				}
 			}
 
-			if (send_main && switch_strlen_zero(vm_email) && !switch_strlen_zero(email_addr)) {
+			if (send_main && zstr(vm_email) && !zstr(email_addr)) {
 				vm_email = switch_core_session_strdup(session, email_addr);
-				if (switch_strlen_zero(vm_email)) {
+				if (zstr(vm_email)) {
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "No email address, not going to send email.\n");
 					send_main = 0;
 				}
 			}
 
-			if (send_notify && switch_strlen_zero(vm_notify_email)) {
+			if (send_notify && zstr(vm_notify_email)) {
 				vm_notify_email = vm_email;
-				if (switch_strlen_zero(vm_notify_email)) {
+				if (zstr(vm_notify_email)) {
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "No notify email address, not going to notify.\n");
 					send_notify = 0;
 				}
@@ -2944,9 +2944,9 @@
 		}
 	}
 
-	if (!switch_strlen_zero(vm_storage_dir)) {
+	if (!zstr(vm_storage_dir)) {
 		dir_path = switch_core_session_sprintf(session, "%s%s%s", vm_storage_dir, SWITCH_PATH_SEPARATOR, id);
-	} else if (!switch_strlen_zero(profile->storage_dir)) {
+	} else if (!zstr(profile->storage_dir)) {
 		dir_path = switch_core_session_sprintf(session, "%s%s%s%s%s", profile->storage_dir, SWITCH_PATH_SEPARATOR, domain_name, SWITCH_PATH_SEPARATOR, id);
 	} else {
 		dir_path = switch_core_session_sprintf(session, "%s%svoicemail%s%s%s%s%s%s", SWITCH_GLOBAL_dirs.storage_dir,
@@ -2987,11 +2987,11 @@
 
 		switch_ivr_sleep(session, 100, SWITCH_TRUE, NULL);
 
-		if (!switch_strlen_zero(greet_path)) {
+		if (!zstr(greet_path)) {
 			memset(buf, 0, sizeof(buf));
 			TRY_CODE(switch_ivr_play_file(session, NULL, greet_path, &args));
 		} else {
-			if (!switch_strlen_zero(cbt.name_path)) {
+			if (!zstr(cbt.name_path)) {
 				memset(buf, 0, sizeof(buf));
 				TRY_CODE(switch_ivr_play_file(session, NULL, cbt.name_path, &args));
 			}
@@ -3010,12 +3010,12 @@
 greet_key_press:
             if (switch_stristr(buf, profile->login_keys)) {
                 voicemail_check_main(session, profile, domain_name, id, 0);
-            } else if (!strcasecmp(buf, profile->operator_key) && !switch_strlen_zero(profile->operator_key)) {
+            } else if (!strcasecmp(buf, profile->operator_key) && !zstr(profile->operator_key)) {
                 int argc;
                 char *argv[4];
                 char *mycmd;
 
-                if (!switch_strlen_zero(profile->operator_ext) && (mycmd = switch_core_session_strdup(session, profile->operator_ext))) {
+                if (!zstr(profile->operator_ext) && (mycmd = switch_core_session_strdup(session, profile->operator_ext))) {
                     argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
                     if (argc >= 1 && argc <= 4) {
                         switch_ivr_session_transfer(session, argv[0], argv[1], argv[2]);
@@ -3024,12 +3024,12 @@
                         goto end;
                     }
                 }
-            } else if (!strcasecmp(buf, profile->vmain_key) && !switch_strlen_zero(profile->vmain_key)) {
+            } else if (!strcasecmp(buf, profile->vmain_key) && !zstr(profile->vmain_key)) {
                 int argc;
                 char *argv[4];
                 char *mycmd;
 
-                if (!switch_strlen_zero(profile->vmain_ext) && (mycmd = switch_core_session_strdup(session, profile->vmain_ext))) {
+                if (!zstr(profile->vmain_ext) && (mycmd = switch_core_session_strdup(session, profile->vmain_ext))) {
                     argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
                     if (argc >= 1 && argc <= 4) {
                         switch_ivr_session_transfer(session, argv[0], argv[1], argv[2]);
@@ -3177,7 +3177,7 @@
 	int x = 0, check = 0, auth = 0;
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		mydata = switch_core_session_strdup(session, data);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
@@ -3210,19 +3210,19 @@
 		auth = 1;
 	}
 
-	if (switch_strlen_zero(profile_name)) {
+	if (zstr(profile_name)) {
 		profile_name = switch_channel_get_variable(channel, "voicemail_profile_name");
 	}
 
-	if (switch_strlen_zero(domain_name)) {
+	if (zstr(domain_name)) {
 		domain_name = switch_channel_get_variable(channel, "voicemail_domain_name");
 	}
 
-	if (switch_strlen_zero(id)) {
+	if (zstr(id)) {
 		id = switch_channel_get_variable(channel, "voicemail_id");
 	}
 
-	if (switch_strlen_zero(profile_name) || switch_strlen_zero(domain_name)) {
+	if (zstr(profile_name) || zstr(domain_name)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error Usage: %s\n", VM_USAGE);
 		return;
 	}
@@ -3254,7 +3254,7 @@
 	vm_profile_t *profile;
 	char *id, *domain, *p, *profilename = NULL;
 	
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%d", 0);	
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -3271,7 +3271,7 @@
 		id += 4;
 	}
 
-	if (switch_strlen_zero(id)) {
+	if (zstr(id)) {
 		stream->write_function(stream, "%d", 0);
 		goto done;
 	}
@@ -3283,7 +3283,7 @@
 			how = p;
 		}
 
-		if (!switch_strlen_zero(profilename)) {
+		if (!zstr(profilename)) {
 			if ((profile = get_profile(profilename))) {
 				message_count(profile, id, domain, "inbox", &total_new_messages, &total_saved_messages,
 							  &total_new_urgent_messages, &total_saved_urgent_messages);
@@ -3334,7 +3334,7 @@
 	char sql[256];
 	prefs_callback_t cbt = {{0}};
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%d", 0);
 		goto done;
 	}
@@ -3351,7 +3351,7 @@
 		id += 4;
 	}
 
-	if (switch_strlen_zero(id)) {
+	if (zstr(id)) {
 		stream->write_function(stream, "%d", 0);
 		goto done;
 	}
@@ -3363,7 +3363,7 @@
 			how = p;
 		}
 
-		if (!switch_strlen_zero(profilename) && !(profile = get_profile(profilename))) {
+		if (!zstr(profilename) && !(profile = get_profile(profilename))) {
 			stream->write_function(stream, "-ERR No such profile\n");
 			goto done;
 		}
@@ -3958,7 +3958,7 @@
 		path_info = switch_event_get_header(stream->param_event, "http-path-info");
 	}
 
-	if (!switch_strlen_zero(cmd)) {
+	if (!zstr(cmd)) {
 		mydata = strdup(cmd);
 		switch_assert(mydata);
 		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));

Modified: freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c (15210 => 15211)


--- freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -146,7 +146,7 @@
 		voice_name = NULL;
 	}
 
-	if (switch_strlen_zero(voice_name)) {
+	if (zstr(voice_name)) {
 		/* Find the first voice on the system */
 		if ((cepstral->voice = swift_port_find_first_voice(cepstral->port, NULL, NULL)) == NULL) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to find any voices!\n");
@@ -215,18 +215,18 @@
 
 	cepstral->tts_stream = NULL;
 
-	if (switch_strlen_zero(text)) {
+	if (zstr(text)) {
 		return SWITCH_STATUS_FALSE;
 	}
 	if (!strncasecmp(text, fp, len)) {
 		text += len;
-		if (switch_strlen_zero(text)) {
+		if (zstr(text)) {
 			return SWITCH_STATUS_FALSE;
 		}
 		swift_port_speak_file(cepstral->port, text, NULL, &cepstral->tts_stream, NULL);
 	} else {
 		char *to_say;
-		if (switch_strlen_zero(text)) {
+		if (zstr(text)) {
 			return SWITCH_STATUS_FALSE;
 		}
 

Modified: freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c (15210 => 15211)


--- freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -282,11 +282,11 @@
 
 			switch_mutex_lock(ps->flag_mutex); 
 			if ((hyp = ps_get_hyp(ps->ps, &ps->score, &ps->uttid))) {
-				if (!switch_strlen_zero(hyp)) {
+				if (!zstr(hyp)) {
 					ps_end_utt(ps->ps);
 					switch_clear_flag(ps, PSFLAG_READY);
 					if ((hyp = ps_get_hyp(ps->ps, &ps->score, &ps->uttid))) {
-						if (switch_strlen_zero(hyp)) {
+						if (zstr(hyp)) {
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Lost the text, never mind....\n");   
 							ps_start_utt(ps->ps, NULL);
 							switch_set_flag(ps, PSFLAG_READY);

Modified: freeswitch/trunk/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c (15210 => 15211)


--- freeswitch/trunk/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -75,7 +75,7 @@
 		switch_xml_free(xml);
 	}
 
-	if (switch_strlen_zero(globals.command)) {
+	if (zstr(globals.command)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No command set, please edit %s\n", cf);   
 	}
 

Modified: freeswitch/trunk/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c (15210 => 15211)


--- freeswitch/trunk/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -490,7 +490,7 @@
 {
 	int result = 0;
 
-	if (!switch_strlen_zero(text)) {
+	if (!zstr(text)) {
 		size_t textlen, matchlen;
 
 		/* find first non-space character */
@@ -524,7 +524,7 @@
 	char *lname = "";
 	*audio_queue = NULL;
 
-	if (switch_strlen_zero(name)) {
+	if (zstr(name)) {
 		lname = "";
 	} else {
 		lname = switch_core_strdup(pool, name);
@@ -704,7 +704,7 @@
 {
 	if (queue) {
 		char *name = queue->name;
-		if (switch_strlen_zero(name)) {
+		if (zstr(name)) {
 			name = "";
 		}
 		if (queue->buffer) {
@@ -779,7 +779,7 @@
 	}
 	switch_core_hash_init(&schan->params, pool);
 	schan->data = NULL;
-	if (switch_strlen_zero(name)) {
+	if (zstr(name)) {
 		schan->name = "";
 	} else {
 		schan->name = switch_core_strdup(pool, name);
@@ -1017,7 +1017,7 @@
 		switch_hash_this(hi, &key, NULL, &val);
 		param_name = (char *)key;
 		param_val = (char *)val;
-		if (!switch_strlen_zero(param_name) && !switch_strlen_zero(param_val)) {
+		if (!zstr(param_name) && !zstr(param_val)) {
 			unimrcp_param_id_t *id = (unimrcp_param_id_t *)switch_core_hash_find(schannel->application->param_id_map, param_name);
 			if (id) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) %s: %s\n", schannel->name, param_name, param_val);
@@ -1272,11 +1272,11 @@
 static switch_status_t speech_channel_set_param(speech_channel_t *schannel, const char *param, const char *val)
 {
 	switch_mutex_lock(schannel->mutex);
-	if (!switch_strlen_zero(param) && val != NULL) {
+	if (!zstr(param) && val != NULL) {
 		/* check if this is a FreeSWITCH param that needs to be translated to an MRCP param: e.g. voice ==> voice-name */
 		char *mrcp_param = (char *)switch_core_hash_find(schannel->application->fs_param_map, param);
 		char *lcparam = NULL;
-		if (switch_strlen_zero(mrcp_param)) {
+		if (zstr(mrcp_param)) {
 			lcparam = switch_lc_strdup(param);
 			mrcp_param = lcparam;
 		}
@@ -1422,7 +1422,7 @@
 	sh->private_info = schannel;
 
 	/* try to open an MRCP channel */
-	if (switch_strlen_zero(profile_name)) {
+	if (zstr(profile_name)) {
 		profile_name = globals.unimrcp_default_synth_profile;
 	}
 	profile = (profile_t *)switch_core_hash_find(globals.profiles, profile_name);
@@ -1437,7 +1437,7 @@
 	}
 
 	/* Set session TTS params */
-	if (!switch_strlen_zero(voice_name)) {
+	if (!zstr(voice_name)) {
 		speech_channel_set_param(schannel, "Voice-Name", voice_name);
 	}
 
@@ -1476,7 +1476,7 @@
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	speech_channel_t *schannel = (speech_channel_t *)sh->private_info;
 	
-	if (switch_strlen_zero(text)) {
+	if (zstr(text)) {
 		status = SWITCH_STATUS_FALSE;
 	} else {
 		status = synth_channel_speak(schannel, text);
@@ -1900,10 +1900,10 @@
 
 	/* input timers are started by default unless the start-input-timers=false param is set */
 	start_input_timers = (char *)switch_core_hash_find(schannel->params, "start-input-timers");
-	r->timers_started = switch_strlen_zero(start_input_timers) || strcasecmp(start_input_timers, "false");
+	r->timers_started = zstr(start_input_timers) || strcasecmp(start_input_timers, "false");
 	
 	/* get the cached grammar */
-	if (switch_strlen_zero(name)) {
+	if (zstr(name)) {
 		grammar = r->last_grammar;
 	} else {
 		grammar = (grammar_t *)switch_core_hash_find(r->grammars, name);
@@ -1935,7 +1935,7 @@
 
 	/* set Content-Type */
 	mime_type = grammar_type_to_mime(grammar->type, schannel->profile);
-	if (switch_strlen_zero(mime_type)) {
+	if (zstr(mime_type)) {
 		status = SWITCH_STATUS_FALSE;
 		goto done;
 	}
@@ -2029,7 +2029,7 @@
 			goto done;
 		}
 		mime_type = grammar_type_to_mime(type, schannel->profile);
-		if (switch_strlen_zero(mime_type)) {
+		if (zstr(mime_type)) {
 			status = SWITCH_STATUS_FALSE;
 			goto done;
 		}
@@ -2084,7 +2084,7 @@
 {
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
-	if (switch_strlen_zero(grammar_name)) {
+	if (zstr(grammar_name)) {
 		status = SWITCH_STATUS_FALSE;
 	} else {
 		recognizer_data_t *r = (recognizer_data_t *)schannel->data;
@@ -2106,7 +2106,7 @@
 	recognizer_data_t *r;
 	switch_mutex_lock(schannel->mutex);
 	r = (recognizer_data_t *)schannel->data;
-	if (!switch_strlen_zero(r->result)) {
+	if (!zstr(r->result)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) SUCCESS, have result\n", schannel->name);
 	} else if (r->start_of_input) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) SUCCESS, start of input\n", schannel->name);
@@ -2180,12 +2180,12 @@
 	recognizer_data_t *r;
 	switch_mutex_lock(schannel->mutex);
 	r = (recognizer_data_t *)schannel->data;
-	if (!switch_strlen_zero(r->result)) {
+	if (!zstr(r->result)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) result is already set\n", schannel->name);
 		status = SWITCH_STATUS_FALSE;
 		goto done;
 	}
-	if (switch_strlen_zero(result)) {
+	if (zstr(result)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) result is NULL\n", schannel->name);
 		status = SWITCH_STATUS_FALSE;
 		goto done;
@@ -2211,7 +2211,7 @@
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	recognizer_data_t *r = (recognizer_data_t *)schannel->data;
 	switch_mutex_lock(schannel->mutex);
-	if (!switch_strlen_zero(r->result)) {
+	if (!zstr(r->result)) {
 		*result = strdup(r->result);
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) result:\n\n%s\n", schannel->name, *result);
 		r->result = NULL;
@@ -2248,7 +2248,7 @@
 		switch_hash_this(hi, &key, NULL, &val);
 		param_name = (char *)key;
 		param_val = (char *)val;
-		if (!switch_strlen_zero(param_name) && !switch_strlen_zero(param_val)) {
+		if (!zstr(param_name) && !zstr(param_val)) {
 			unimrcp_param_id_t *id = (unimrcp_param_id_t *)switch_core_hash_find(schannel->application->param_id_map, param_name);
 			if (id) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) \"%s\": \"%s\"\n", schannel->name, param_name, param_val);
@@ -2572,7 +2572,7 @@
 	char *filename = NULL;
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) grammar = %s, name = %s\n", schannel->name, grammar, name);
 
-	if (switch_strlen_zero(grammar) || switch_strlen_zero(name)) {
+	if (zstr(grammar) || zstr(name)) {
 		status = SWITCH_STATUS_FALSE;
 		goto done;
 	}
@@ -2673,7 +2673,7 @@
 {
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	speech_channel_t *schannel = (speech_channel_t *)ah->private_info;
-	if (switch_strlen_zero(name) || speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS ||
+	if (zstr(name) || speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS ||
 		recog_channel_unload_grammar(schannel, name) != SWITCH_STATUS_SUCCESS) {
 		status = SWITCH_STATUS_FALSE;
 	}
@@ -3316,13 +3316,13 @@
 	}
 
 	/* set up MRCPv2 connection agent that will be shared with all profiles */
-	if (!switch_strlen_zero(globals.unimrcp_max_connection_count)) {
+	if (!zstr(globals.unimrcp_max_connection_count)) {
 		max_connection_count = atoi(globals.unimrcp_max_connection_count);
 	}
 	if (max_connection_count <= 0) {
 		max_connection_count = 100;
 	}
-	if (!switch_strlen_zero(globals.unimrcp_offer_new_connection)) {
+	if (!zstr(globals.unimrcp_offer_new_connection)) {
 		offer_new_connection = strcasecmp("true", globals.unimrcp_offer_new_connection);
 	}
 	connection_agent = mrcp_client_connection_agent_create(max_connection_count, offer_new_connection, pool);
@@ -3354,7 +3354,7 @@
 			/* get profile attributes */
 			const char *name = apr_pstrdup(pool, switch_xml_attr(profile, "name"));
 			const char *version = switch_xml_attr(profile, "version");
-			if (switch_strlen_zero(name) || switch_strlen_zero(version)) {
+			if (zstr(name) || zstr(version)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "<profile> missing name or version attribute\n");
 				client = NULL;
 				goto done;
@@ -3381,7 +3381,7 @@
 				for (param = switch_xml_child(profile, "param"); param; param = switch_xml_next(param)) {
 					const char *param_name = switch_xml_attr(param, "name");
 					const char *param_value = switch_xml_attr(param, "value");
-					if (switch_strlen_zero(param_name)) {
+					if (zstr(param_name)) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing param name\n");
 						client = NULL;
 						goto done;
@@ -3409,7 +3409,7 @@
 				for (param = switch_xml_child(profile, "param"); param; param = switch_xml_next(param)) {
 					const char *param_name = switch_xml_attr(param, "name");
 					const char *param_value = switch_xml_attr(param, "value");
-					if (switch_strlen_zero(param_name)) {
+					if (zstr(param_name)) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing param name\n");
 						client = NULL;
 						goto done;
@@ -3468,11 +3468,11 @@
 
 	/* get MRCP module configuration */
 	mod_unimrcp_do_config();
-	if (switch_strlen_zero(globals.unimrcp_default_synth_profile)) {
+	if (zstr(globals.unimrcp_default_synth_profile)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing default-tts-profile\n");
 		return SWITCH_STATUS_FALSE;
 	}
-	if (switch_strlen_zero(globals.unimrcp_default_recog_profile)) {
+	if (zstr(globals.unimrcp_default_recog_profile)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing default-asr-profile\n");
 		return SWITCH_STATUS_FALSE;
 	}
@@ -3575,7 +3575,7 @@
 	char log_message[4096] = { 0 }; /* same size as MAX_LOG_ENTRY_SIZE in UniMRCP apt_log.c */
 	size_t msglen;
 
-	if (switch_strlen_zero(format)) {
+	if (zstr(format)) {
 		return TRUE;
 	}
 

Modified: freeswitch/trunk/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c (15210 => 15211)


--- freeswitch/trunk/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -141,7 +141,7 @@
 		caller_profile = switch_channel_get_caller_profile(channel);
 	}
 
-	if (!caller_profile || switch_strlen_zero(caller_profile->destination_number)) {
+	if (!caller_profile || zstr(caller_profile->destination_number)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Obtaining Profile!\n");
 		return NULL;
 	}
@@ -271,7 +271,7 @@
 				switch_regex_safe_free(re);
 
 				if (!extension) {
-					if (switch_strlen_zero(field_data)) {
+					if (zstr(field_data)) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "No extension!\n");
 						break;
 					}
@@ -313,7 +313,7 @@
 	} else {
 		profile = switch_core_get_variable("sip_profile");
 	}
-	if (switch_strlen_zero(profile)) {
+	if (zstr(profile)) {
 		profile = "default";
 	}
 

Modified: freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c (15210 => 15211)


--- freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -295,7 +295,7 @@
 				const char *inline_ = switch_xml_attr_soft(xaction, "inline");
 				int xinline = switch_true(inline_);
 
-				if (!switch_strlen_zero(xaction->txt)) {
+				if (!zstr(xaction->txt)) {
 					data = xaction->txt;
 				} else {
 					data = (char *) switch_xml_attr_soft(xaction, "data");
@@ -393,7 +393,7 @@
 
 	/* get our handle to the "dialplan" section of the config */
 
-	if (!switch_strlen_zero(alt_path)) {
+	if (!zstr(alt_path)) {
 		switch_xml_t conf = NULL, tag = NULL;
 		if (!(alt_root = switch_xml_parse_file_simple(alt_path))) {
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Open of [%s] failed\n", alt_path);

Modified: freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -366,7 +366,7 @@
 
 	switch_mutex_lock(globals.pvt_lock);
 
-	if (switch_strlen_zero(tech_pvt->call_id)) {
+	if (zstr(tech_pvt->call_id)) {
 		snprintf(tech_pvt->call_id, sizeof(tech_pvt->call_id), "%d", ++globals.call_id);
 		switch_core_hash_insert(globals.call_hash, tech_pvt->call_id, tech_pvt);
 		switch_core_session_set_read_codec(tech_pvt->session, &globals.read_codec);
@@ -785,7 +785,7 @@
 
 		if (outbound_profile) {
 			char name[128];
-			const char *id = !switch_strlen_zero(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
+			const char *id = !zstr(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
 			snprintf(name, sizeof(name), "alsa/%s", id);
 
 			switch_channel_set_name(channel, name);
@@ -1186,7 +1186,7 @@
 	char *dtmf_str = argv[0];
 	switch_dtmf_t dtmf = { 0, switch_core_default_dtmf_duration(0) };
 
-	if (switch_strlen_zero(dtmf_str)) {
+	if (zstr(dtmf_str)) {
 		stream->write_function(stream, "No DTMF Supplied!\n");
 	} else {
 		switch_mutex_lock(globals.pvt_lock);
@@ -1212,7 +1212,7 @@
 	uint8_t one_call = 0;
 
 	switch_mutex_lock(globals.pvt_lock);
-	if (switch_strlen_zero(callid)) {
+	if (zstr(callid)) {
 		if (globals.call_list) {
 			if (globals.call_list->next) {
 				tech_pvt = globals.call_list->next;
@@ -1258,7 +1258,7 @@
 	char *callid = argv[0];
 
 	switch_mutex_lock(globals.pvt_lock);
-	if (switch_strlen_zero(callid)) {
+	if (zstr(callid)) {
 		tech_pvt = globals.call_list;
 	} else {
 		tech_pvt = switch_core_hash_find(globals.call_hash, callid);
@@ -1285,7 +1285,7 @@
 
 	switch_mutex_lock(globals.pvt_lock);
 
-	if (!switch_strlen_zero(callid)) {
+	if (!zstr(callid)) {
 		if ((tp = switch_core_hash_find(globals.call_hash, callid))) {
 			if (switch_test_flag(tp, TFLAG_ANSWER)) {
 				stream->write_function(stream, "CALL ALREADY ANSWERED\n");
@@ -1458,23 +1458,23 @@
 			return SWITCH_STATUS_MEMERR;
 		}
 
-		if (!switch_strlen_zero(argv[1])) {
+		if (!zstr(argv[1])) {
 			dialplan = argv[1];
 		}
 
-		if (!switch_strlen_zero(argv[2])) {
+		if (!zstr(argv[2])) {
 			cid_num = argv[2];
 		}
 
-		if (!switch_strlen_zero(argv[3])) {
+		if (!zstr(argv[3])) {
 			cid_name = argv[3];
 		}
 
-		if (!switch_strlen_zero(argv[4])) {
+		if (!zstr(argv[4])) {
 			tech_pvt->sample_rate = atoi(argv[4]);
 		}
 
-		if (!switch_strlen_zero(argv[5])) {
+		if (!zstr(argv[5])) {
 			tech_pvt->codec_ms = atoi(argv[5]);
 		}
 
@@ -1576,13 +1576,13 @@
 			}
 		}
 
-		if (switch_strlen_zero(cmd)) {
+		if (zstr(cmd)) {
 			goto done;
 		}
 
 	} else {
 
-		if (switch_strlen_zero(cmd)) {
+		if (zstr(cmd)) {
 			stream->write_function(stream, "%s", usage_string);
 			goto done;
 		}

Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -344,7 +344,7 @@
 	char *status = argv[4];
 	//char *proto = argv[5];
 
-	if (switch_strlen_zero(type)) {
+	if (zstr(type)) {
 		type = NULL;
 	} else if (!strcasecmp(type, "unavailable")) {
 		status = NULL;
@@ -550,7 +550,7 @@
 		status = NULL;
 	}
 
-	if (switch_strlen_zero(event_type)) {
+	if (zstr(event_type)) {
 		event_type = "presence";
 	}
 
@@ -1993,7 +1993,7 @@
 		profile->password = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "avatar")) {
 		profile->avatar = switch_core_strdup(module_pool, val);
-	} else if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
 		if (switch_odbc_available()) {
 			profile->odbc_dsn = switch_core_strdup(module_pool, val);
 			if ((profile->odbc_user = strchr(profile->odbc_dsn, ':'))) {
@@ -2007,17 +2007,17 @@
 		}
 	} else if (!strcasecmp(var, "use-rtp-timer") && switch_true(val)) {
 		switch_set_flag(profile, TFLAG_TIMER);
-	} else if (!strcasecmp(var, "dialplan") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "dialplan") && !zstr(val)) {
 		profile->dialplan = switch_core_strdup(module_pool, val);
 #ifdef AUTO_REPLY				// gotta fix looping on this
 	} else if (!strcasecmp(var, "auto-reply")) {
 		profile->auto_reply = switch_core_strdup(module_pool, val);
 #endif
-	} else if (!strcasecmp(var, "name") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "name") && !zstr(val)) {
 		profile->name = switch_core_strdup(module_pool, val);
-	} else if (!strcasecmp(var, "message") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "message") && !zstr(val)) {
 		profile->message = switch_core_strdup(module_pool, val);
-	} else if (!strcasecmp(var, "local-network-acl") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "local-network-acl") && !zstr(val)) {
 		profile->local_network = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "rtp-ip")) {
 		profile->ip = switch_core_strdup(module_pool, strcasecmp(switch_str_nil(val), "auto") ? switch_str_nil(val) : globals.guess_ip);
@@ -2030,14 +2030,14 @@
 			ip = globals.guess_ip;
 		} else {
 			globals.auto_nat = 0;
-			ip = switch_strlen_zero(val) ? globals.guess_ip : val;
+			ip = zstr(val) ? globals.guess_ip : val;
 		}
 		profile->extip = switch_core_strdup(module_pool, ip);
-	} else if (!strcasecmp(var, "server") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "server") && !zstr(val)) {
 		profile->server = switch_core_strdup(module_pool, val);
-	} else if (!strcasecmp(var, "rtp-timer-name") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "rtp-timer-name") && !zstr(val)) {
 		profile->timer_name = switch_core_strdup(module_pool, val);
-	} else if (!strcasecmp(var, "lanaddr") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "lanaddr") && !zstr(val)) {
 		profile->lanaddr = switch_core_strdup(module_pool, val);
 	} else if (!strcasecmp(var, "candidate-acl")) {
 		if (profile->acl_count < MAX_ACL) {
@@ -2055,11 +2055,11 @@
 		} else if (val && !strcasecmp(val, "md5")) {
 			profile->user_flags |= LDL_FLAG_SASL_MD5;
 		}
-	} else if (!strcasecmp(var, "exten") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "exten") && !zstr(val)) {
 		profile->exten = switch_core_strdup(module_pool, val);
-	} else if (!strcasecmp(var, "context") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "context") && !zstr(val)) {
 		profile->context = switch_core_strdup(module_pool, val);
-	} else if (!strcasecmp(var, "auto-login") && !switch_strlen_zero(val)) {
+	} else if (!strcasecmp(var, "auto-login") && !zstr(val)) {
 		if (switch_true(val)) {
 			switch_set_flag(profile, TFLAG_AUTO);
 		}
@@ -2162,7 +2162,7 @@
 
 	if (session) return status;
 
-	if (switch_strlen_zero(cmd) || !(myarg = strdup(cmd))) {
+	if (zstr(cmd) || !(myarg = strdup(cmd))) {
 		stream->write_function(stream, "USAGE: %s\n", DINGALING_SYNTAX);
 		return SWITCH_STATUS_FALSE;
 	}
@@ -2214,7 +2214,7 @@
 		goto done;
 	}
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "USAGE: %s\n", LOGIN_SYNTAX);
 		status = SWITCH_STATUS_SUCCESS;
 		goto done;
@@ -2224,7 +2224,7 @@
 
 	argc = switch_separate_string(myarg, ';', argv, (sizeof(argv) / sizeof(argv[0])));
 
-	if (switch_strlen_zero(cmd) || argc != 1) {
+	if (zstr(cmd) || argc != 1) {
 		stream->write_function(stream, "USAGE: %s\n", LOGIN_SYNTAX);
 		status = SWITCH_STATUS_SUCCESS;
 		goto done;

Modified: freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -839,20 +839,20 @@
 					*dialplan++ = '\0';
 				}
 
-				if (!switch_strlen_zero(context)) {
+				if (!zstr(context)) {
 					caller_profile->context = switch_core_strdup(caller_profile->pool, context);
 				}
 
-				if (!switch_strlen_zero(dialplan)) {
+				if (!zstr(dialplan)) {
 					caller_profile->dialplan = switch_core_strdup(caller_profile->pool, dialplan);
 				}
 			}
 			
-			if (switch_strlen_zero(caller_profile->context)) {
+			if (zstr(caller_profile->context)) {
 				caller_profile->context = switch_core_strdup(caller_profile->pool, "default");
 			}
 
-			if (switch_strlen_zero(caller_profile->dialplan)) {
+			if (zstr(caller_profile->dialplan)) {
 				caller_profile->dialplan = switch_core_strdup(caller_profile->pool, "xml");
 			}
 

Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -749,7 +749,7 @@
 
 		if (outbound_profile) {
 			char name[128];
-			const char *id = !switch_strlen_zero(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
+			const char *id = !zstr(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
 			switch_snprintf(name, sizeof(name), "portaudio/%s", id);
 
 			switch_channel_set_name(channel, name);
@@ -1051,7 +1051,7 @@
 		int match = 0;
 		pdi = Pa_GetDeviceInfo(i);
 
-		if (switch_strlen_zero(name)) {
+		if (zstr(name)) {
 			match = 1;
 		} else if (pdi && pdi->name && strstr(pdi->name, name)) {
 			match = 1;
@@ -1476,7 +1476,7 @@
 	char *dtmf_str = argv[0];
 	switch_dtmf_t dtmf = { 0, switch_core_default_dtmf_duration(0) };
 
-	if (switch_strlen_zero(dtmf_str)) {
+	if (zstr(dtmf_str)) {
 		stream->write_function(stream, "No DTMF Supplied!\n");
 	} else {
 		switch_mutex_lock(globals.pvt_lock);
@@ -1503,7 +1503,7 @@
 	
 
 	switch_mutex_lock(globals.pvt_lock);
-	if (switch_strlen_zero(callid)) {
+	if (zstr(callid)) {
 		if (globals.call_list) {
 			if (globals.call_list->next) {
 				tech_pvt = globals.call_list->next;
@@ -1548,7 +1548,7 @@
 	char *callid = argv[0];
 
 	switch_mutex_lock(globals.pvt_lock);
-	if (switch_strlen_zero(callid)) {
+	if (zstr(callid)) {
 		tech_pvt = globals.call_list;
 	} else {
 		tech_pvt = switch_core_hash_find(globals.call_hash, callid);
@@ -1573,7 +1573,7 @@
 
 	switch_mutex_lock(globals.pvt_lock);
 
-	if (!switch_strlen_zero(callid)) {
+	if (!zstr(callid)) {
 		if ((tp = switch_core_hash_find(globals.call_hash, callid))) {
 			if (switch_test_flag(tp, TFLAG_ANSWER)) {
 				stream->write_function(stream, "CALL ALREADY ANSWERED\n");
@@ -1716,7 +1716,7 @@
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	char *dest = NULL;
 
-	if (switch_strlen_zero(argv[0])) {
+	if (zstr(argv[0])) {
 		stream->write_function(stream, "FAIL:Usage: call <dest>\n");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -1745,23 +1745,23 @@
 			return SWITCH_STATUS_MEMERR;
 		}
 
-		if (!switch_strlen_zero(argv[1])) {
+		if (!zstr(argv[1])) {
 			dialplan = argv[1];
 		}
 
-		if (!switch_strlen_zero(argv[2])) {
+		if (!zstr(argv[2])) {
 			cid_num = argv[2];
 		}
 
-		if (!switch_strlen_zero(argv[3])) {
+		if (!zstr(argv[3])) {
 			cid_name = argv[3];
 		}
 
-		if (!switch_strlen_zero(argv[4])) {
+		if (!zstr(argv[4])) {
 			tech_pvt->sample_rate = atoi(argv[4]);
 		}
 
-		if (!switch_strlen_zero(argv[5])) {
+		if (!zstr(argv[5])) {
 			tech_pvt->codec_ms = atoi(argv[5]);
 		}
 
@@ -1862,13 +1862,13 @@
 			}
 		}
 
-		if (switch_strlen_zero(cmd)) {
+		if (zstr(cmd)) {
 			goto done;
 		}
 
 	} else {
 
-		if (switch_strlen_zero(cmd)) {
+		if (zstr(cmd)) {
 			stream->write_function(stream, "%s", usage_string);
 			goto done;
 		}

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -866,7 +866,7 @@
 		switch_core_session_add_stream(*new_session, NULL);
 
 
-		if (!switch_strlen_zero(outbound_profile->destination_number)) {
+		if (!zstr(outbound_profile->destination_number)) {
 			int i;
 			char *slash;
 
@@ -1767,7 +1767,7 @@
 	switch_core_session_t *session = NULL;
 	switch_channel_t *channel = NULL;
 
-	if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
+	if (!zstr(tech_pvt->session_uuid_str)) {
 		session = switch_core_session_locate(tech_pvt->session_uuid_str);
 	} else {
 		ERRORA("No session???\n", SKYPIAX_P_LOG);
@@ -1797,7 +1797,7 @@
 	switch_core_session_t *session = NULL;
 	switch_channel_t *channel = NULL;
 
-	if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
+	if (!zstr(tech_pvt->session_uuid_str)) {
 		session = switch_core_session_locate(tech_pvt->session_uuid_str);
 	} else {
 		ERRORA("No session???\n\n\n", SKYPIAX_P_LOG);
@@ -1831,7 +1831,7 @@
 	switch_core_session_t *session = NULL;
 	switch_channel_t *channel = NULL;
 
-	if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
+	if (!zstr(tech_pvt->session_uuid_str)) {
 		session = switch_core_session_locate(tech_pvt->session_uuid_str);
 	} else {
 		ERRORA("No session???\n", SKYPIAX_P_LOG);
@@ -1917,7 +1917,7 @@
 	else
 		stream->write_function(stream, "sk console is NOT yet assigned\n");
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
@@ -2031,7 +2031,7 @@
 	int argc = 0;
 	private_t *tech_pvt = NULL;
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 
@@ -2280,7 +2280,7 @@
 
 	DEBUGA_SKYPE("received CHATMESSAGE on interface %s\n", SKYPIAX_P_LOG, tech_pvt->name);
 
-	if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
+	if (!zstr(tech_pvt->session_uuid_str)) {
 		session = switch_core_session_locate(tech_pvt->session_uuid_str);
 	}
 	if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
@@ -2348,7 +2348,7 @@
 	int found = 0;
 	//char skype_msg[1024];
 
-	if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 	}
 

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -88,7 +88,7 @@
 	if (sofia_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
 		const char *var;
 
-		if ((var = switch_channel_get_variable(channel, SOFIA_SECURE_MEDIA_VARIABLE)) && !switch_strlen_zero(var)) {
+		if ((var = switch_channel_get_variable(channel, SOFIA_SECURE_MEDIA_VARIABLE)) && !zstr(var)) {
 			if (switch_true(var) || !strcasecmp(var, SWITCH_RTP_CRYPTO_KEY_32)) {
 				sofia_set_flag_locked(tech_pvt, TFLAG_SECURE);
 				sofia_glue_build_crypto(tech_pvt, 1, AES_CM_128_HMAC_SHA1_32, SWITCH_RTP_CRYPTO_SEND);
@@ -185,17 +185,17 @@
 		callee_name = switch_channel_get_variable(tech_pvt->channel, "callee_id_name");
 	}
 
-	if (switch_strlen_zero((callee_number = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_number")))) {
-		if (switch_strlen_zero((callee_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number")))) {
+	if (zstr((callee_number = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_number")))) {
+		if (zstr((callee_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number")))) {
 			callee_number = tech_pvt->caller_profile->destination_number;
 		}
 	}
 
-	if (switch_strlen_zero(callee_name) && !switch_strlen_zero(callee_number)) {
+	if (zstr(callee_name) && !zstr(callee_number)) {
 		callee_name = callee_number;
 	}
 
-	if (!switch_strlen_zero(callee_name) && !switch_strlen_zero(callee_number)) {
+	if (!zstr(callee_name) && !zstr(callee_number)) {
 		pai = switch_core_session_sprintf(tech_pvt->session, "P-Asserted-Identity: \"%s\" <%s>\nX-FS-Display-Name: %s\nX-FS-Display-Number: %s\n", 
 										  callee_name, callee_number, callee_name, callee_number);
 	}
@@ -312,7 +312,7 @@
 		ps_cause = switch_channel_get_variable(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE);
 	}
 
-	if (!switch_strlen_zero(ps_cause) && (!strncasecmp(ps_cause, "sip:", 4) || !strncasecmp(ps_cause, "sips:", 5))) {
+	if (!zstr(ps_cause) && (!strncasecmp(ps_cause, "sip:", 4) || !strncasecmp(ps_cause, "sips:", 5))) {
 		int new_cause = atoi(sofia_glue_strip_proto(ps_cause));
 		if (new_cause) {
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Overriding SIP cause %d with %d from the other leg\n",
@@ -389,8 +389,8 @@
 			if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
 				nua_bye(tech_pvt->nh, 
 						SIPTAG_REASON_STR(reason),
-						TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
-						TAG_IF(!switch_strlen_zero(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
+						TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+						TAG_IF(!zstr(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
 						TAG_END());
 			}
 		} else {
@@ -402,7 +402,7 @@
 				if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
 					nua_cancel(tech_pvt->nh, 
 							   SIPTAG_REASON_STR(reason), 
-							   TAG_IF(!switch_strlen_zero(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
+							   TAG_IF(!zstr(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
 							   TAG_END());
 				}
 			} else {
@@ -413,7 +413,7 @@
 				if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
 					nua_respond(tech_pvt->nh, sip_cause, sip_status_phrase(sip_cause), 
 								SIPTAG_REASON_STR(reason), 
-								TAG_IF(!switch_strlen_zero(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
+								TAG_IF(!zstr(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
 								TAG_END());
 				}
 			}
@@ -488,7 +488,7 @@
 							SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 							SOATAG_REUSE_REJECTED(1),
 							SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), 
-							TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+							TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
 							SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
 							TAG_END());
 
@@ -577,7 +577,7 @@
 					SIPTAG_CALL_INFO_STR(switch_channel_get_variable(tech_pvt->channel, SOFIA_SIP_HEADER_PREFIX "call_info")),
 					SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 					SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), 
-					TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+					TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
 					SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
 					TAG_END());
 		switch_safe_free(extra_headers);
@@ -1276,7 +1276,7 @@
 			char *argv[2] = { 0 };
 			int argc;
 			
-			if (switch_strlen_zero(name) && !switch_strlen_zero(msg->string_arg)) {
+			if (zstr(name) && !zstr(msg->string_arg)) {
 				arg = strdup(msg->string_arg);
 				switch_assert(arg);
 
@@ -1286,37 +1286,37 @@
 
 			}
 			
-			if (!switch_strlen_zero(name)) {
+			if (!zstr(name)) {
 				char message[256] = "";
 				const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
 				switch_event_t *event;
 
-				if (switch_strlen_zero(number)) {
+				if (zstr(number)) {
 					number = tech_pvt->caller_profile->destination_number;
 				}
 
 				if (!sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY)) {
-					if (switch_strlen_zero(tech_pvt->last_sent_callee_id_name) || strcmp(tech_pvt->last_sent_callee_id_name, name) ||
-						switch_strlen_zero(tech_pvt->last_sent_callee_id_number) || strcmp(tech_pvt->last_sent_callee_id_number, number)) {
+					if (zstr(tech_pvt->last_sent_callee_id_name) || strcmp(tech_pvt->last_sent_callee_id_name, name) ||
+						zstr(tech_pvt->last_sent_callee_id_number) || strcmp(tech_pvt->last_sent_callee_id_number, number)) {
 						
 						if (switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote)) {
 							snprintf(message, sizeof(message), "X-FS-Display-Name: %s\nX-FS-Display-Number: %s\n", name, number);
 
 							nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/update_display"),
-									 TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
-									 TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+									 TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
+									 TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
 									 TAG_END());
 						} else if (ua && switch_stristr("snom", ua)) {
 							snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", name, number);
 							nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
-									 TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+									 TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
 									 SIPTAG_PAYLOAD_STR(message), TAG_END());
 						} else if ((ua && (switch_stristr("polycom", ua)))) {
 							snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", name, number);
 							sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
 							nua_update(tech_pvt->nh,
-									   TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
-									   TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+									   TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
+									   TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
 									   TAG_END());
 						}
 
@@ -1348,20 +1348,20 @@
 		{
 			sofia_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
 			sofia_glue_do_invite(session);
-			if (!switch_strlen_zero(msg->string_arg)) {
+			if (!zstr(msg->string_arg)) {
 				char message[256] = "";
 				const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
 
 				if (ua && switch_stristr("snom", ua)) {
 					snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", msg->string_arg, tech_pvt->caller_profile->destination_number);
 					nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
-							 TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+							 TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
 							 SIPTAG_PAYLOAD_STR(message), TAG_END());
 				} else if (ua && switch_stristr("polycom", ua)) {
 					snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", msg->string_arg, tech_pvt->caller_profile->destination_number);
 					nua_update(tech_pvt->nh,
-							   TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
-							   TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+							   TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
+							   TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
 							   TAG_END());
 				}
 			}
@@ -1375,7 +1375,7 @@
 		}
 		break;
 	case SWITCH_MESSAGE_INDICATE_REDIRECT:
-		if (!switch_strlen_zero(msg->string_arg)) {
+		if (!zstr(msg->string_arg)) {
 			if (!switch_channel_test_flag(channel, CF_ANSWERED) && !sofia_test_flag(tech_pvt, TFLAG_BYE)) {
 				char *dest = (char *) msg->string_arg;
 
@@ -1423,7 +1423,7 @@
 			if (code) {
 				reason = msg->string_arg;
 			} else {
-				if (!switch_strlen_zero(msg->string_arg)) {
+				if (!zstr(msg->string_arg)) {
 					if ((code = atoi(msg->string_arg))) {
 						if ((reason = strchr(msg->string_arg, ' '))) {
 							reason++;
@@ -1442,9 +1442,9 @@
 				}
 			}
 			
-			if (switch_strlen_zero(reason) && code != 407 && code != 302) {
+			if (zstr(reason) && code != 407 && code != 302) {
 				reason = sip_status_phrase(code);
-				if (switch_strlen_zero(reason)) {
+				if (zstr(reason)) {
 					reason = "Because";
 				}
 			}
@@ -1455,7 +1455,7 @@
 				const char *to_uri = switch_channel_get_variable(channel, "sip_to_uri");
 				const char *to_host = reason;
 
-				if (switch_strlen_zero(to_host)) {
+				if (zstr(to_host)) {
 					to_host = switch_channel_get_variable(channel, "sip_to_host");
 				}
 				switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Challenging call %s\n", to_uri);
@@ -1479,12 +1479,12 @@
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Overlap Dial with %d %s\n", code, reason);
 					nua_respond(tech_pvt->nh, code, su_strdup(nua_handle_home(tech_pvt->nh), reason), TAG_IF(to_uri, SIPTAG_CONTACT_STR(to_uri)),
 								SIPTAG_SUPPORTED_STR(NULL), SIPTAG_ACCEPT_STR(NULL),
-								TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
-								TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END());
+								TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+								TAG_IF(!zstr(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END());
 					
 					sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
 				}
-			} else if (code == 302 && !switch_strlen_zero(msg->string_arg)) {
+			} else if (code == 302 && !zstr(msg->string_arg)) {
 				char *p;
 
 				if ((p = strchr(msg->string_arg, ' '))) {
@@ -1498,7 +1498,7 @@
 			} else {
 				if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Responding with %d [%s]\n", code, reason);
-					if (!switch_strlen_zero(((char *) msg->pointer_arg))) {
+					if (!zstr(((char *) msg->pointer_arg))) {
 						sofia_glue_tech_set_local_sdp(tech_pvt, (char *) msg->pointer_arg, SWITCH_TRUE);
 						
 						if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
@@ -1509,11 +1509,11 @@
 									SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 									SOATAG_REUSE_REJECTED(1),
 									SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), 
-									TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+									TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
 									TAG_END());
 					} else {
 						nua_respond(tech_pvt->nh, code, su_strdup(nua_handle_home(tech_pvt->nh), reason), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), 
-									TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+									TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
 									TAG_END());
 					}
 				}
@@ -1528,7 +1528,7 @@
 			nua_respond(tech_pvt->nh, SIP_180_RINGING,
 						SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
 						SIPTAG_HEADER_STR(generate_pai_str(session)), 
-						TAG_IF(!switch_strlen_zero(extra_header), SIPTAG_HEADER_STR(extra_header)),
+						TAG_IF(!zstr(extra_header), SIPTAG_HEADER_STR(extra_header)),
 						SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
 						TAG_END());
 			switch_safe_free(extra_header);
@@ -1614,7 +1614,7 @@
 								SOATAG_ORDERED_USER(1),
 								SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
 								SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), 
-								TAG_IF(!switch_strlen_zero(extra_header), SIPTAG_HEADER_STR(extra_header)),
+								TAG_IF(!zstr(extra_header), SIPTAG_HEADER_STR(extra_header)),
 								SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
 								TAG_END());
 					switch_safe_free(extra_header);
@@ -1795,7 +1795,7 @@
 				stream->write_function(stream, "Scheme  \t%s\n", switch_str_nil(gp->register_scheme));
 				stream->write_function(stream, "Realm   \t%s\n", switch_str_nil(gp->register_realm));
 				stream->write_function(stream, "Username\t%s\n", switch_str_nil(gp->register_username));
-				stream->write_function(stream, "Password\t%s\n", switch_strlen_zero(gp->register_password) ? "no" : "yes");
+				stream->write_function(stream, "Password\t%s\n", zstr(gp->register_password) ? "no" : "yes");
 				stream->write_function(stream, "From    \t%s\n", switch_str_nil(gp->register_from));
 				stream->write_function(stream, "Contact \t%s\n", switch_str_nil(gp->register_contact));
 				stream->write_function(stream, "Exten   \t%s\n", switch_str_nil(gp->extension));
@@ -1832,7 +1832,7 @@
 					stream->write_function(stream, "Dialplan         \t%s\n", switch_str_nil(profile->dialplan));
 					stream->write_function(stream, "Context          \t%s\n", switch_str_nil(profile->context));
 					stream->write_function(stream, "Challenge Realm  \t%s\n", 
-										   switch_strlen_zero(profile->challenge_realm) ? "auto_to" : profile->challenge_realm);
+										   zstr(profile->challenge_realm) ? "auto_to" : profile->challenge_realm);
 					stream->write_function(stream, "RTP-IP           \t%s\n", switch_str_nil(profile->rtpip));
 					if (profile->extrtpip) {
 					stream->write_function(stream, "Ext-RTP-IP       \t%s\n", profile->extrtpip);
@@ -1848,8 +1848,8 @@
 					stream->write_function(stream, "TLS-URL          \t%s\n", switch_str_nil(profile->tls_url));
 					stream->write_function(stream, "TLS-BIND-URL     \t%s\n", switch_str_nil(profile->tls_bindurl));
 					}
-					stream->write_function(stream, "HOLD-MUSIC       \t%s\n", switch_strlen_zero(profile->hold_music) ? "N/A" : profile->hold_music);
-					stream->write_function(stream, "OUTBOUND-PROXY   \t%s\n", switch_strlen_zero(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy);
+					stream->write_function(stream, "HOLD-MUSIC       \t%s\n", zstr(profile->hold_music) ? "N/A" : profile->hold_music);
+					stream->write_function(stream, "OUTBOUND-PROXY   \t%s\n", zstr(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy);
 					stream->write_function(stream, "CODECS           \t%s\n", switch_str_nil(profile->codec_string));
 					stream->write_function(stream, "TEL-EVENT        \t%d\n", profile->te);
 					if (profile->dtmf_type == DTMF_2833) {
@@ -1906,9 +1906,9 @@
 						host = dup;
 					}
 
-					if (switch_strlen_zero(user) ) {
+					if (zstr(user) ) {
 						sqlextra = switch_mprintf("(sip_host='%q')", host);
-					} else if (switch_strlen_zero(host)) {
+					} else if (zstr(host)) {
 						sqlextra = switch_mprintf("(sip_user='%q')", user);
 					} else {
 						sqlextra = switch_mprintf("(sip_user='%q' and sip_host='%q')", user, host);
@@ -2019,7 +2019,7 @@
 				stream->write_function(stream, "    <scheme>%s</scheme>\n", switch_str_nil(gp->register_scheme));
 				stream->write_function(stream, "    <realm>%s</realm>\n", switch_str_nil(gp->register_realm));
 				stream->write_function(stream, "    <username>%s</username>\n", switch_str_nil(gp->register_username));
-				stream->write_function(stream, "    <password>%s</password>\n", switch_strlen_zero(gp->register_password) ? "no" : "yes");
+				stream->write_function(stream, "    <password>%s</password>\n", zstr(gp->register_password) ? "no" : "yes");
 				stream->write_function(stream, "    <from>%s</from>\n", switch_amp_encode(switch_str_nil(gp->register_from),xmlbuf,buflen));
 				stream->write_function(stream, "    <contact>%s</contact>\n", switch_amp_encode(switch_str_nil(gp->register_contact),xmlbuf,buflen));
 				stream->write_function(stream, "    <exten>%s</exten>\n", switch_amp_encode(switch_str_nil(gp->extension),xmlbuf,buflen));
@@ -2059,7 +2059,7 @@
 					stream->write_function(stream, "    <dialplan>%s</dialplan>\n", switch_str_nil(profile->dialplan));
 					stream->write_function(stream, "    <context>%s</context>\n", switch_str_nil(profile->context));
 					stream->write_function(stream, "    <challenge-realm>%s</challenge-realm>\n", 
-										   switch_strlen_zero(profile->challenge_realm) ? "auto_to" : profile->challenge_realm);
+										   zstr(profile->challenge_realm) ? "auto_to" : profile->challenge_realm);
 					stream->write_function(stream, "    <rtp-ip>%s</rtp-ip>\n", switch_str_nil(profile->rtpip));
 					stream->write_function(stream, "    <ext-rtp-ip>%s</ext-rtp-ip>\n", profile->extrtpip);
 					stream->write_function(stream, "    <sip-ip>%s</sip-ip>\n", switch_str_nil(profile->sipip));
@@ -2068,8 +2068,8 @@
 					stream->write_function(stream, "    <bind-url>%s</bind-url>\n", switch_str_nil(profile->bindurl));
 					stream->write_function(stream, "    <tls-url>%s</tls-url>\n", switch_str_nil(profile->tls_url));
 					stream->write_function(stream, "    <tls-bind-url>%s</tls-bind-url>\n", switch_str_nil(profile->tls_bindurl));
-					stream->write_function(stream, "    <hold-music>%s</hold-music>\n", switch_strlen_zero(profile->hold_music) ? "N/A" : profile->hold_music);
-					stream->write_function(stream, "    <outbound-proxy>%s</outbound-proxy>\n", switch_strlen_zero(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy);
+					stream->write_function(stream, "    <hold-music>%s</hold-music>\n", zstr(profile->hold_music) ? "N/A" : profile->hold_music);
+					stream->write_function(stream, "    <outbound-proxy>%s</outbound-proxy>\n", zstr(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy);
 					stream->write_function(stream, "    <codecs>%s</codecs>\n", switch_str_nil(profile->codec_string));
 					stream->write_function(stream, "    <tel-event>%d</tel-event>\n", profile->te);
 					stream->write_function(stream, "    <dtmf-mode>rfc2833</dtmf-mode>\n");
@@ -2127,9 +2127,9 @@
 						host = dup;
 					}
 
-					if (switch_strlen_zero(user)) {
+					if (zstr(user)) {
 						sqlextra = switch_mprintf("(sip_host='%q')", host);
-					} else if (switch_strlen_zero(host)) {
+					} else if (zstr(host)) {
 						sqlextra = switch_mprintf("(sip_user='%q')", user);
 					} else {
 						sqlextra = switch_mprintf("(sip_user='%q' and sip_host='%q')", user, host);
@@ -2244,7 +2244,7 @@
 		return SWITCH_STATUS_SUCCESS;
 	}
 	
-	if (switch_strlen_zero(profile_name) || !(profile = sofia_glue_find_profile(profile_name))) {
+	if (zstr(profile_name) || !(profile = sofia_glue_find_profile(profile_name))) {
 		stream->write_function(stream, "Invalid Profile [%s]", switch_str_nil(profile_name));
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -2344,7 +2344,7 @@
 		char *gname = argv[2];
 		sofia_gateway_t *gateway_ptr;
 
-		if (switch_strlen_zero(gname)) {
+		if (zstr(gname)) {
 			stream->write_function(stream, "No gateway name provided!\n");
 			goto done;
 		}
@@ -2371,7 +2371,7 @@
 		char *gname = argv[2];
 		sofia_gateway_t *gateway_ptr;
 
-		if (switch_strlen_zero(gname)) {
+		if (zstr(gname)) {
 			stream->write_function(stream, "No gateway name provided!\n");
 			goto done;
 		}
@@ -2447,7 +2447,7 @@
 	struct cb_helper *cb = (struct cb_helper *) pArg;
 	char *contact;
 
-	if (!switch_strlen_zero(argv[0]) && (contact = sofia_glue_get_url_from_contact(argv[0], 1)) ) {
+	if (!zstr(argv[0]) && (contact = sofia_glue_get_url_from_contact(argv[0], 1)) ) {
 		cb->stream->write_function(cb->stream, "%ssofia/%s/sip:%s,", argv[2], argv[1], sofia_glue_strip_proto(contact));
 		free(contact);
 	}
@@ -2545,11 +2545,11 @@
 			sofia_glue_execute_sql_callback(profile, SWITCH_FALSE, profile->ireg_mutex, sql, contact_callback, &cb);
 			switch_safe_free(sql);
 			reply = (char *) mystream.data;
-			if (!switch_strlen_zero(reply) && end_of(reply) == ',') {
+			if (!zstr(reply) && end_of(reply) == ',') {
 				end_of(reply) = '\0';
 			}
 
-			if (switch_strlen_zero(reply)) {
+			if (zstr(reply)) {
 				reply = "error/user_not_registered";
 			}
 
@@ -2583,7 +2583,7 @@
 	char *gwname, *param, *varname;
 	const char *val = NULL;
 	
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-ERR Parameter missing\n");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -2599,7 +2599,7 @@
 	param = argv[1];
 	varname = argv[2];
 	
-	if (switch_strlen_zero(gwname) || switch_strlen_zero(param) || switch_strlen_zero(varname)) {
+	if (zstr(gwname) || zstr(param) || zstr(varname)) {
 		goto end;
 	}
 	
@@ -2647,7 +2647,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%s", usage_string);
 		goto done;
 	}
@@ -2880,11 +2880,11 @@
 		
 		gateway_ptr->ob_calls++;
 		
-		if (!switch_strlen_zero(gateway_ptr->from_domain) && !switch_channel_get_variable(nchannel, "sip_invite_domain")) {
+		if (!zstr(gateway_ptr->from_domain) && !switch_channel_get_variable(nchannel, "sip_invite_domain")) {
 			switch_channel_set_variable(nchannel, "sip_invite_domain", gateway_ptr->from_domain);
 		}
 
-		if (!switch_strlen_zero(gateway_ptr->outbound_sticky_proxy) && !switch_channel_get_variable(nchannel, "sip_route_uri")) {
+		if (!zstr(gateway_ptr->outbound_sticky_proxy) && !switch_channel_get_variable(nchannel, "sip_route_uri")) {
 			switch_channel_set_variable(nchannel, "sip_route_uri", gateway_ptr->outbound_sticky_proxy);
 		}
 		
@@ -3115,7 +3115,7 @@
 			   NUTAG_NEWSUB(1),
 			   SIPTAG_EVENT_STR(es), 
 			   SIPTAG_CONTENT_TYPE_STR(ct), 
-			   TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
+			   TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
 			   TAG_END());
 
 				
@@ -3193,7 +3193,7 @@
 							   NUTAG_WITH_THIS(profile->nua),
 							   SIPTAG_EVENT_STR(es), 
 							   TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)),
-							   TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
+							   TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
 							   TAG_END());
 				
 					sofia_glue_release_profile(profile);
@@ -3212,7 +3212,7 @@
 								   NUTAG_NEWSUB(1),
 								   SIPTAG_EVENT_STR(es), 
 								   SIPTAG_CONTENT_TYPE_STR(ct), 
-								   TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
+								   TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
 								   TAG_END());
 					}
 					switch_core_session_rwunlock(session);
@@ -3296,7 +3296,7 @@
 				nua_message(nh,
 							NUTAG_NEWSUB(1),
  							SIPTAG_CONTENT_TYPE_STR(ct), 
-							TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
+							TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
 							TAG_END());
 
 				
@@ -3392,7 +3392,7 @@
 					 TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)),
 					 TAG_IF(alert_info, SIPTAG_ALERT_INFO_STR(alert_info)),
 					 TAG_IF(call_info, SIPTAG_CALL_INFO_STR(call_info)),
-					 TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
+					 TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
 					 TAG_END());
 
 			if (call_id && nh) {

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	2009-10-23 16:03:42 UTC (rev 15211)
@@ -818,7 +818,7 @@
 
 #define check_decode(_var, _session) do {								\
 		assert(_session);												\
-		if (!switch_strlen_zero(_var)) {								\
+		if (!zstr(_var)) {								\
 			int d = 0;													\
 			char *p;													\
 			if (strchr(_var, '%')) {									\

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -327,7 +327,7 @@
 	
 	switch_channel_hangup(channel, cause);
 	nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), 
-		TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
+		TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
 		
 	switch_safe_free(extra_headers);
 
@@ -338,9 +338,9 @@
 #endif
 
 
-	if (sip->sip_user_agent && !switch_strlen_zero(sip->sip_user_agent->g_string)) {
+	if (sip->sip_user_agent && !zstr(sip->sip_user_agent->g_string)) {
 		switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string);
-	} else if (sip->sip_server && !switch_strlen_zero(sip->sip_server->g_string)) {
+	} else if (sip->sip_server && !zstr(sip->sip_server->g_string)) {
 		switch_channel_set_variable(channel, "sip_user_agent", sip->sip_server->g_string);
 	}
 
@@ -384,19 +384,19 @@
 	switch_caller_profile_t *caller_profile = switch_channel_get_caller_profile(channel);
 
 
-	if (switch_strlen_zero(name)) {
+	if (zstr(name)) {
 		name = caller_profile->callee_id_name;
 	}
 
-	if (switch_strlen_zero(number)) {
+	if (zstr(number)) {
 		number = caller_profile->callee_id_number;
 	}
 
-	if (switch_strlen_zero(name)) {
+	if (zstr(name)) {
 		name = number;
 	}
 	
-	if (switch_strlen_zero(number)) {
+	if (zstr(number)) {
 		number = caller_profile->destination_number;
 	}
 
@@ -449,7 +449,7 @@
 			if (passerted->paid_url && passerted->paid_url->url_user) {
 				number = passerted->paid_url->url_user;
 			}
-			if (!switch_strlen_zero(passerted->paid_display)) {
+			if (!zstr(passerted->paid_display)) {
 				dup = strdup(passerted->paid_display);
 				if (*dup == '"') {
 					name = dup + 1;
@@ -539,7 +539,7 @@
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile %s is locked\n", gateway->profile->name);
 				return;
 			}
-		} else if (!switch_strlen_zero(sofia_private->uuid)) {
+		} else if (!zstr(sofia_private->uuid)) {
 			if ((session = switch_core_session_locate(sofia_private->uuid))) {
 				tech_pvt = switch_core_session_get_private(session);
 				channel = switch_core_session_get_channel(session);
@@ -553,7 +553,7 @@
 
 				if (status >= 180 && !*sofia_private->auth_gateway_name) {
 					const char *gwname = switch_channel_get_variable(channel, "sip_use_gateway");
-					if (!switch_strlen_zero(gwname)) {
+					if (!zstr(gwname)) {
 						switch_set_string(sofia_private->auth_gateway_name, gwname);
 					}
 				}
@@ -1381,7 +1381,7 @@
 		char *name = (char *) switch_xml_attr_soft(gateway_tag, "name");
 		sofia_gateway_t *gateway;
 
-		if (switch_strlen_zero(name)) {
+		if (zstr(name)) {
 			name = "anonymous";
 		}
 
@@ -1545,33 +1545,33 @@
 				parse_gateway_subscriptions(profile, gateway, gw_subs_tag);
 			}
 			
-			if (switch_strlen_zero(realm)) {
-				if (switch_strlen_zero(proxy)) {
+			if (zstr(realm)) {
+				if (zstr(proxy)) {
 					realm = name;
 				} else {
 					realm = proxy;
 				}
 			}
 
-			if (switch_strlen_zero(username)) {
+			if (zstr(username)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: username param is REQUIRED!\n");
 				goto skip;
 			}
 
-			if (switch_strlen_zero(password)) {
+			if (zstr(password)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: password param is REQUIRED!\n");
 				goto skip;
 			}
 
-			if (switch_strlen_zero(from_user)) {
+			if (zstr(from_user)) {
 				from_user = username;
 			}
 
-			if (switch_strlen_zero(extension)) {
+			if (zstr(extension)) {
 				extension = username;
 			}
 
-			if (switch_strlen_zero(proxy)) {
+			if (zstr(proxy)) {
 				proxy = realm;
 			}
 
@@ -1580,11 +1580,11 @@
 				gateway->status = SOFIA_GATEWAY_UP;
 			}
 
-			if (switch_strlen_zero(auth_username)) {
+			if (zstr(auth_username)) {
 				auth_username = username;
 			}
 			
-			if (!switch_strlen_zero(register_proxy)) {
+			if (!zstr(register_proxy)) {
 				if (strncasecmp(register_proxy, "sip:", 4) && strncasecmp(register_proxy, "sips:", 5)) {
 					gateway->register_sticky_proxy = switch_core_sprintf(gateway->pool, "sip:%s", register_proxy);
 				} else {
@@ -1592,7 +1592,7 @@
 				}
 			}
 
-			if (!switch_strlen_zero(outbound_proxy)) {
+			if (!zstr(outbound_proxy)) {
 				if (strncasecmp(outbound_proxy, "sip:", 4) && strncasecmp(outbound_proxy, "sips:", 5)) {
 					gateway->outbound_sticky_proxy = switch_core_sprintf(gateway->pool, "sip:%s", outbound_proxy);
 				} else {
@@ -1631,13 +1631,13 @@
 				params = switch_core_sprintf(gateway->pool, ";transport=%s;gw=%s", register_transport, gateway->name);
 			}
 
-			if (!switch_strlen_zero(from_domain)) {
+			if (!zstr(from_domain)) {
 				gateway->from_domain = switch_core_strdup(gateway->pool, from_domain);
 			}
 
 			gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s", proxy);
 			gateway->register_from = switch_core_sprintf(gateway->pool, "<sip:%s@%s;transport=%s>", 
-														 from_user, !switch_strlen_zero(from_domain) ? from_domain : proxy, register_transport);
+														 from_user, !zstr(from_domain) ? from_domain : proxy, register_transport);
 
 			sipip = contact_host ? contact_host : profile->extsipip ?  profile->extsipip : profile->sipip;
 
@@ -2157,7 +2157,7 @@
 					const char *parse = switch_xml_attr_soft(domain_tag, "parse");
 					const char *alias = switch_xml_attr_soft(domain_tag, "alias");
 
-					if (!switch_strlen_zero(dname)) {
+					if (!zstr(dname)) {
 						if (!strcasecmp(dname, "all")) {
 							switch_xml_t xml_root, x_domains;
 							if (switch_xml_locate("directory", NULL, NULL, NULL, &xml_root, &x_domains, xml_params, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
@@ -2180,7 +2180,7 @@
 			if ((aliases_tag = switch_xml_child(xprofile, "aliases"))) {
 				for (alias_tag = switch_xml_child(aliases_tag, "alias"); alias_tag; alias_tag = alias_tag->next) {
 					char *aname = (char *) switch_xml_attr_soft(alias_tag, "name");
-					if (!switch_strlen_zero(aname)) {
+					if (!zstr(aname)) {
 						
 						if (sofia_glue_add_profile(switch_core_strdup(profile->pool, aname), profile) == SWITCH_STATUS_SUCCESS) {
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Alias [%s] for profile [%s]\n", aname, profile->name);
@@ -2236,7 +2236,7 @@
 		su_log_redirect(stun_log, logger, NULL);
 	}
 
-	if (!switch_strlen_zero(profile_name) && (profile = sofia_glue_find_profile(profile_name))) {
+	if (!zstr(profile_name) && (profile = sofia_glue_find_profile(profile_name))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Profile [%s] Already exists.\n", switch_str_nil(profile_name));
 		status = SWITCH_STATUS_FALSE;
 		sofia_glue_release_profile(profile);
@@ -2342,7 +2342,7 @@
 						profile->debug = atoi(val);
 					} else if (!strcasecmp(var, "sip-trace") && switch_true(val)) {
 						sofia_set_flag(profile, TFLAG_TPORT_LOG);
-					} else if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
+					} else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
 						if (switch_odbc_available()) {
 							profile->odbc_dsn = switch_core_strdup(profile->pool, val);
 							if ((profile->odbc_user = strchr(profile->odbc_dsn, ':'))) {
@@ -2467,7 +2467,7 @@
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid option %s for VAD\n", val);
 						}
 					} else if (!strcasecmp(var, "ext-rtp-ip")) {
-						if (!switch_strlen_zero(val)) {
+						if (!zstr(val)) {
 							char *ip = mod_sofia_globals.guess_ip;
 							
 							if (!strcmp(val, "0.0.0.0")) {
@@ -2501,7 +2501,7 @@
 						}
 						profile->sipip = switch_core_strdup(profile->pool, ip);
 					} else if (!strcasecmp(var, "ext-sip-ip")) {
-						if (!switch_strlen_zero(val)) {
+						if (!zstr(val)) {
 							char *ip = mod_sofia_globals.guess_ip;
 							char stun_ip[50] = "";
 							char *myip = stun_ip;
@@ -3007,7 +3007,7 @@
 						const char *parse = switch_xml_attr_soft(domain_tag, "parse");
 						const char *alias = switch_xml_attr_soft(domain_tag, "alias");
 
-						if (!switch_strlen_zero(dname)) {
+						if (!zstr(dname)) {
 							if (!strcasecmp(dname, "all")) {
 								switch_xml_t xml_root, x_domains;
 								if (switch_xml_locate("directory", NULL, NULL, NULL, &xml_root, &x_domains, xml_params, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
@@ -3030,7 +3030,7 @@
 				if ((aliases_tag = switch_xml_child(xprofile, "aliases"))) {
 					for (alias_tag = switch_xml_child(aliases_tag, "alias"); alias_tag; alias_tag = alias_tag->next) {
 						char *aname = (char *) switch_xml_attr_soft(alias_tag, "name");
-						if (!switch_strlen_zero(aname)) {
+						if (!zstr(aname)) {
 
 							if (sofia_glue_add_profile(switch_core_strdup(profile->pool, aname), profile) == SWITCH_STATUS_SUCCESS) {
 								switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Alias [%s] for profile [%s]\n", aname, profile->name);
@@ -3083,7 +3083,7 @@
 {
 	sofia_gateway_t *gateway = NULL;
 
-	if (sofia_private && !switch_strlen_zero(sofia_private->gateway_name)) {
+	if (sofia_private && !zstr(sofia_private->gateway_name)) {
 		gateway = sofia_reg_find_gateway(sofia_private->gateway_name);
 		sofia_private->destroy_me = 1;
 	}
@@ -3526,7 +3526,7 @@
 			sdp_parser_t *parser;
 			sdp_session_t *sdp;
 			
-			if (!switch_strlen_zero(tech_pvt->remote_sdp_str) && !strcmp(tech_pvt->remote_sdp_str, r_sdp)) {
+			if (!zstr(tech_pvt->remote_sdp_str) && !strcmp(tech_pvt->remote_sdp_str, r_sdp)) {
 				switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Duplicate SDP\n%s\n", r_sdp);
 				is_dup_sdp = 1;
 			} else {
@@ -4369,7 +4369,7 @@
 									sofia_set_flag_locked(b_tech_pvt, TFLAG_BYE);
 									nua_bye(b_tech_pvt->nh, 
 											SIPTAG_REASON_STR("Q.850;cause=16;text=\"normal_clearing\""),
-											TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+											TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
 											TAG_END());
 								}
 							} else {
@@ -4429,11 +4429,11 @@
 									const char *idest = switch_channel_get_variable(hup_channel, "inline_destination");
 									ext = switch_channel_get_variable(hup_channel, "destination_number");
 
-									if (!switch_strlen_zero(full_ref_by)) {
+									if (!zstr(full_ref_by)) {
 										switch_channel_set_variable(t_channel, SOFIA_SIP_HEADER_PREFIX "Referred-By", full_ref_by);
 									}
 
-									if (!switch_strlen_zero(full_ref_to)) {
+									if (!zstr(full_ref_to)) {
 										switch_channel_set_variable(t_channel, SOFIA_REFER_TO_VARIABLE, full_ref_to);
 									}
 									
@@ -4477,7 +4477,7 @@
 								port = refer_to->r_url->url_port;
 							}
 
-							if (switch_strlen_zero(port)) {
+							if (zstr(port)) {
 								port = "5060";
 							}
 							
@@ -4517,11 +4517,11 @@
 
 							switch_channel_set_variable(channel, SOFIA_REPLACES_HEADER, rep);
 
-							if (!switch_strlen_zero(full_ref_by)) {
+							if (!zstr(full_ref_by)) {
 								switch_channel_set_variable(channel, SOFIA_SIP_HEADER_PREFIX "Referred-By", full_ref_by);
 							}
 
-							if (!switch_strlen_zero(full_ref_to)) {
+							if (!zstr(full_ref_to)) {
 								switch_channel_set_variable(channel, SOFIA_REFER_TO_VARIABLE, full_ref_to);
 							}
 
@@ -4564,10 +4564,10 @@
 			if ((b_session = switch_core_session_locate(br))) {
 				switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
 				switch_channel_set_variable(channel, "transfer_fallback_extension", from->a_user);
-				if (!switch_strlen_zero(full_ref_by)) {
+				if (!zstr(full_ref_by)) {
 					switch_channel_set_variable(b_channel, SOFIA_SIP_HEADER_PREFIX "Referred-By", full_ref_by);
 				}
-				if (!switch_strlen_zero(full_ref_to)) {
+				if (!zstr(full_ref_to)) {
 					switch_channel_set_variable(b_channel, SOFIA_REFER_TO_VARIABLE, full_ref_to);
 				}
 
@@ -4688,7 +4688,7 @@
 		}
 
 		if ((clientcode_header = sofia_glue_get_unknown_header(sip, "x-clientcode"))) {
-			if (!switch_strlen_zero(clientcode_header)) {
+			if (!zstr(clientcode_header)) {
 				switch_channel_set_variable(channel, "call_clientcode", clientcode_header);
 				switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Setting CMC to %s\n", clientcode_header);
 				nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
@@ -4697,7 +4697,7 @@
 		}
 
 		if ((rec_header = sofia_glue_get_unknown_header(sip, "record"))) {
-			if (switch_strlen_zero(profile->record_template)) {
+			if (zstr(profile->record_template)) {
 				switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Record attempted but no template defined.\n");
 				nua_respond(nh, 488, "Recording not enabled", NUTAG_WITH_THIS(nua), TAG_END());
 			} else {
@@ -4810,16 +4810,16 @@
 		user = url->url_user;
 		host = url->url_host;
 		port = url->url_port;
-		if (!switch_strlen_zero(url->url_params)) {
+		if (!zstr(url->url_params)) {
 			switch_channel_set_variable(channel, params_var, url->url_params);
 		}
 	}
 
-	if (switch_strlen_zero(user)) {
+	if (zstr(user)) {
 		user = "nobody";
 	}
 
-	if (switch_strlen_zero(host)) {
+	if (zstr(host)) {
 		host = "nowhere";
 	}
 
@@ -4926,7 +4926,7 @@
 			contact_host = sip->sip_contact->m_url->url_host;
 		}
 
-		if (!switch_strlen_zero(contact_host)) {
+		if (!zstr(contact_host)) {
 			for (x = 0; x < profile->nat_acl_count; x++) {
 				last_acl = profile->nat_acl[x];
 				if (!(ok = switch_check_network_list_ip(contact_host, last_acl))) {
@@ -4992,7 +4992,7 @@
 										  "found auth ip [%s] header of [%s]\n",
 										  un->un_name, un->un_value
 										  );
-						if (!switch_strlen_zero(un->un_value)) {
+						if (!zstr(un->un_value)) {
 							for (x = 0; x < profile->acl_count; x++) {
 								last_acl = profile->acl[x];
 								if ((ok = switch_check_network_list_ip_token(un->un_value, last_acl, &token))) {
@@ -5139,7 +5139,7 @@
 		from_host = sip->sip_from->a_url->url_host;
 		channel_name = url_set_chanvars(session, sip->sip_from->a_url, sip_from);
 
-		if (!switch_strlen_zero(from_user)) {
+		if (!zstr(from_user)) {
 			if (*from_user == '+') {
 				switch_channel_set_variable(channel, "sip_from_user_stripped", (const char *) (from_user + 1));
 			} else {
@@ -5156,10 +5156,10 @@
 		switch_channel_set_variable(channel, "sofia_profile_name", profile->name);
 		switch_channel_set_variable(channel, "sofia_profile_domain_name", profile->domain_name);
 
-		if (!switch_strlen_zero(sip->sip_from->a_display)) {
+		if (!zstr(sip->sip_from->a_display)) {
 			displayname = sip->sip_from->a_display;
 		} else {
-			displayname = switch_strlen_zero(from_user) ? "unknown" : from_user;
+			displayname = zstr(from_user) ? "unknown" : from_user;
 		}
 	}
 
@@ -5167,12 +5167,12 @@
 		if (rpid->rpid_url && rpid->rpid_url->url_user) {
 			char *full_rpid_header = sip_header_as_string(nh->nh_home, (void *) rpid); 
 			from_user = rpid->rpid_url->url_user;
-			if (!switch_strlen_zero(full_rpid_header)) {
+			if (!zstr(full_rpid_header)) {
 				switch_channel_set_variable(channel, "sip_Remote-Party-ID", full_rpid_header);
 			}
 
 		}
-		if (!switch_strlen_zero(rpid->rpid_display)) {
+		if (!zstr(rpid->rpid_display)) {
 			displayname = rpid->rpid_display;
 		}
 		switch_channel_set_variable(channel, "sip_cid_type", "rpid");
@@ -5182,11 +5182,11 @@
 		if (passerted->paid_url && passerted->paid_url->url_user) {
 			char *full_paid_header = sip_header_as_string(nh->nh_home, (void *) passerted);
 			from_user = passerted->paid_url->url_user;
-			if (!switch_strlen_zero(full_paid_header)) {
+			if (!zstr(full_paid_header)) {
 				switch_channel_set_variable(channel, "sip_P-Asserted-Identity", from_user);
 			}
 		}
-		if (!switch_strlen_zero(passerted->paid_display)) {
+		if (!zstr(passerted->paid_display)) {
 			displayname = passerted->paid_display;
 		}
 		switch_channel_set_variable(channel, "sip_cid_type", "pid");
@@ -5196,12 +5196,12 @@
 		if (ppreferred->ppid_url && ppreferred->ppid_url->url_user) {
 			char *full_ppid_header = sip_header_as_string(nh->nh_home, (void *) ppreferred);
 			from_user = ppreferred->ppid_url->url_user;
-			if (!switch_strlen_zero(full_ppid_header)) {
+			if (!zstr(full_ppid_header)) {
 				switch_channel_set_variable(channel, "sip_P-Preferred-Identity", full_ppid_header);
 			}
 			
 		}
-		if (!switch_strlen_zero(ppreferred->ppid_display)) {
+		if (!zstr(ppreferred->ppid_display)) {
 			displayname = ppreferred->ppid_display;
 		}
 		switch_channel_set_variable(channel, "sip_cid_type", "pid");
@@ -5346,7 +5346,7 @@
 
 		check_decode(referred_by_user, session);
 
-		if (!switch_strlen_zero(referred_by_user)) {
+		if (!zstr(referred_by_user)) {
 			if (*referred_by_user == '+') {
 				switch_channel_set_variable(channel, "sip_referred_by_user_stripped", (const char *) (referred_by_user + 1));
 			} else {
@@ -5383,7 +5383,7 @@
 		switch_channel_set_variable(channel, "sip_subject", sip->sip_subject->g_string);
 	}
 
-	if (sip->sip_user_agent && !switch_strlen_zero(sip->sip_user_agent->g_string)) {
+	if (sip->sip_user_agent && !zstr(sip->sip_user_agent->g_string)) {
 		switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string);
 	}
 
@@ -5590,7 +5590,7 @@
 
 		if ((privacy = sip_privacy(sip))) {
 			char *full_priv_header = sip_header_as_string(nh->nh_home, (void *) privacy); 
-			if (!switch_strlen_zero(full_priv_header)) {
+			if (!zstr(full_priv_header)) {
 				switch_channel_set_variable(channel, "sip_Privacy", full_priv_header);
 			}
 			if (msg_params_find(privacy->priv_values, "id")) {
@@ -5603,7 +5603,7 @@
 			if (!strncasecmp(un->un_name, "Diversion", 9)) {
 				/* Basic Diversion Support for Diversion Indication in SIP */
 				/* draft-levy-sip-diversion-08 */
-				if (!switch_strlen_zero(un->un_value)) {
+				if (!zstr(un->un_value)) {
 					char *tmp_name;
 					if ((tmp_name = switch_mprintf("%s%s", SOFIA_SIP_HEADER_PREFIX, un->un_name))) {
 						switch_channel_set_variable(channel, tmp_name, un->un_value);
@@ -5615,7 +5615,7 @@
 			} else if (!strcasecmp(un->un_name, "X-FS-Support")) {
 				tech_pvt->x_freeswitch_support_remote = switch_core_session_strdup(session, un->un_value);
 			} else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) {
-				if (!switch_strlen_zero(un->un_value)) {
+				if (!zstr(un->un_value)) {
 					char new_name[512] = "";
 					int reps  = 0;
 					for(;;) {
@@ -5768,24 +5768,24 @@
 			switch_caller_profile_t *acp = a_tech_pvt->caller_profile;
 			
 			if (ua && switch_stristr("snom", ua)) {
-				if (switch_strlen_zero(acp->caller_id_name)) {
+				if (zstr(acp->caller_id_name)) {
 					snprintf(message, sizeof(message), "From:\r\nTo: %s\r\n", acp->caller_id_number);
 				} else {
 					snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", acp->caller_id_name, acp->caller_id_number);
 				}
 				nua_info(b_tech_pvt->nh,
 						 SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
-						 TAG_IF(!switch_strlen_zero(b_tech_pvt->user_via), SIPTAG_VIA_STR(b_tech_pvt->user_via)),
+						 TAG_IF(!zstr(b_tech_pvt->user_via), SIPTAG_VIA_STR(b_tech_pvt->user_via)),
 						 SIPTAG_PAYLOAD_STR(message), TAG_END());
 			} else if (ua && switch_stristr("polycom", ua)) {
-				if (switch_strlen_zero(acp->caller_id_name)) {
+				if (zstr(acp->caller_id_name)) {
 					snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", acp->caller_id_number, acp->caller_id_number);
 				} else {
 					snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", acp->caller_id_name, acp->caller_id_number);
 				}
 				nua_update(b_tech_pvt->nh,
-						   TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
-						   TAG_IF(!switch_strlen_zero(b_tech_pvt->user_via), SIPTAG_VIA_STR(b_tech_pvt->user_via)),
+						   TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
+						   TAG_IF(!zstr(b_tech_pvt->user_via), SIPTAG_VIA_STR(b_tech_pvt->user_via)),
 						   TAG_END());
 			}
 

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -178,7 +178,7 @@
 					tech_pvt->owner_id, tech_pvt->session_id, family, ip, username, family, ip, 
 					srbuf,
 					port,
-					(!switch_strlen_zero(tech_pvt->local_crypto_key) 
+					(!zstr(tech_pvt->local_crypto_key) 
 					&& sofia_test_flag(tech_pvt,TFLAG_SECURE)) ? "S" : "");
 
 	if (tech_pvt->rm_encoding) {
@@ -276,7 +276,7 @@
 		switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=%s\n", sr);
 	} 
 
-	if (!switch_strlen_zero(tech_pvt->local_crypto_key) && sofia_test_flag(tech_pvt, TFLAG_SECURE)) {
+	if (!zstr(tech_pvt->local_crypto_key) && sofia_test_flag(tech_pvt, TFLAG_SECURE)) {
 		switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=crypto:%s\n", tech_pvt->local_crypto_key);
 		//switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=encryption:optional\n");
 #if 0
@@ -571,7 +571,7 @@
 			}
 		}
 
-		if (switch_strlen_zero(stun_ip)) {
+		if (zstr(stun_ip)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "STUN Failed! NO STUN SERVER\n");
 			goto out;
 		}
@@ -632,7 +632,7 @@
 	sip_unknown_t *un;
 	for (un = sip->sip_unknown; un; un = un->un_next) {
 		if (!strcasecmp(un->un_name, name)) {
-			if (!switch_strlen_zero(un->un_value)) {
+			if (!zstr(un->un_value)) {
 				return un->un_value;
 			}
 		}
@@ -670,7 +670,7 @@
 	sdp_port = tech_pvt->local_sdp_audio_port;
 
 	if (!(use_ip = switch_channel_get_variable(tech_pvt->channel, "rtp_adv_audio_ip")) 
-		&& !switch_strlen_zero(tech_pvt->profile->extrtpip)) {
+		&& !zstr(tech_pvt->profile->extrtpip)) {
 			use_ip = tech_pvt->profile->extrtpip;
 	}
 
@@ -738,7 +738,7 @@
 	sdp_port = tech_pvt->local_sdp_video_port;
 
 	if (!(use_ip = switch_channel_get_variable(tech_pvt->channel, "rtp_adv_video_ip")) 
-		&& !switch_strlen_zero(tech_pvt->profile->extrtpip)) {
+		&& !zstr(tech_pvt->profile->extrtpip)) {
 			use_ip = tech_pvt->profile->extrtpip;
 	}
 
@@ -1005,7 +1005,7 @@
 	int x;
 	const char *val;
 	
-	if (switch_strlen_zero(tech_pvt->remote_sdp_str)) {
+	if (zstr(tech_pvt->remote_sdp_str)) {
 		return SWITCH_STATUS_FALSE;
 	}
 
@@ -1137,7 +1137,7 @@
 	char *new_sdp;
 	int bad = 0;
 
-	if (switch_strlen_zero(tech_pvt->local_sdp_str)) {
+	if (zstr(tech_pvt->local_sdp_str)) {
 		return;
 	}
 
@@ -1148,7 +1148,7 @@
 	    return;
 	}
 	
-	if (switch_strlen_zero(tech_pvt->adv_sdp_audio_ip) || !tech_pvt->adv_sdp_audio_port) {
+	if (zstr(tech_pvt->adv_sdp_audio_ip) || !tech_pvt->adv_sdp_audio_port) {
 	    if (sofia_glue_tech_choose_port(tech_pvt, 1) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "%s I/O Error\n", switch_channel_get_name(tech_pvt->channel));
 			return;
@@ -1360,7 +1360,7 @@
         switch_channel_variable_last(channel);
     }
 
-    if (!switch_strlen_zero((char*)stream.data)) {
+    if (!zstr((char*)stream.data)) {
         extra_headers = stream.data;
     } else {
 		switch_safe_free(stream.data);
@@ -1380,7 +1380,7 @@
 
 	for (un = sip->sip_unknown; un; un = un->un_next) {
 		if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) {
-			if (!switch_strlen_zero(un->un_value)) {
+			if (!zstr(un->un_value)) {
 				switch_snprintf(name, sizeof(name), "%s%s", prefix, un->un_name);
 				switch_channel_set_variable(channel, name, un->un_value);
 			}
@@ -1448,7 +1448,7 @@
 										format,
 										cid_name,
 										cid_num,
-										!switch_strlen_zero(cid_num) ? "@" : "",
+										!zstr(cid_num) ? "@" : "",
 										sipip);
 	}
 
@@ -1482,7 +1482,7 @@
 		const char *from_var = switch_channel_get_variable(tech_pvt->channel, "sip_from_uri");
 		const char *from_display = switch_channel_get_variable(tech_pvt->channel, "sip_from_display");
 		
-		if (switch_strlen_zero(tech_pvt->dest)) {
+		if (zstr(tech_pvt->dest)) {
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "URL Error!\n");
 			return SWITCH_STATUS_FALSE;
 		}
@@ -1501,15 +1501,15 @@
 			} else {
 				use_from_str = switch_core_session_sprintf(tech_pvt->session, "sip:%s", from_var);
 			}
-		} else if (!switch_strlen_zero(tech_pvt->gateway_from_str)) {
+		} else if (!zstr(tech_pvt->gateway_from_str)) {
 			use_from_str = tech_pvt->gateway_from_str;
 		} else {
 			use_from_str = tech_pvt->from_str;
 		}
 
-		if (!switch_strlen_zero(tech_pvt->gateway_from_str)) {
+		if (!zstr(tech_pvt->gateway_from_str)) {
 			rpid_domain = switch_core_session_strdup(session, tech_pvt->gateway_from_str);
-		} else if (!switch_strlen_zero(tech_pvt->from_str)) {
+		} else if (!zstr(tech_pvt->from_str)) {
 			rpid_domain = switch_core_session_strdup(session, tech_pvt->from_str);
 		} 
 
@@ -1529,7 +1529,7 @@
 		 * Ignore transport chanvar and uri parameter for gateway connections
 		 * since all of them have been already taken care of in mod_sofia.c:sofia_outgoing_channel()
 		 */
-		if (tech_pvt->transport == SOFIA_TRANSPORT_UNKNOWN && switch_strlen_zero(tech_pvt->gateway_name)) {
+		if (tech_pvt->transport == SOFIA_TRANSPORT_UNKNOWN && zstr(tech_pvt->gateway_name)) {
 			if ((p = (char *) switch_stristr("port=", url))) {
 				p += 5;
 				tech_pvt->transport = sofia_glue_str2transport(p);
@@ -1553,7 +1553,7 @@
 			return SWITCH_STATUS_FALSE;
 		}
 
-		if (switch_strlen_zero(tech_pvt->invite_contact)) {
+		if (zstr(tech_pvt->invite_contact)) {
 			const char * contact;
 			if ((contact = switch_channel_get_variable(channel, "sip_contact_user"))) {
 				char *ip_addr;
@@ -1740,7 +1740,7 @@
 		sofia_glue_tech_patch_sdp(tech_pvt);
 	}
 
-	if (!switch_strlen_zero(tech_pvt->dest)) {
+	if (!zstr(tech_pvt->dest)) {
 		dst = sofia_glue_get_destination(tech_pvt->dest);
 
 		if (dst->route_uri) {
@@ -1766,17 +1766,17 @@
 			   NUTAG_AUTOANSWER(0),
 			   NUTAG_SESSION_TIMER(session_timeout),
 			   TAG_IF(tech_pvt->redirected, NUTAG_URL(tech_pvt->redirected)),
-			   TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
-			   TAG_IF(!switch_strlen_zero(tech_pvt->rpid), SIPTAG_REMOTE_PARTY_ID_STR(tech_pvt->rpid)),
-			   TAG_IF(!switch_strlen_zero(tech_pvt->preferred_id), SIPTAG_P_PREFERRED_IDENTITY_STR(tech_pvt->preferred_id)),
-			   TAG_IF(!switch_strlen_zero(tech_pvt->asserted_id), SIPTAG_P_ASSERTED_IDENTITY_STR(tech_pvt->asserted_id)),
-			   TAG_IF(!switch_strlen_zero(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->privacy)),
-			   TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)),
-			   TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+			   TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+			   TAG_IF(!zstr(tech_pvt->rpid), SIPTAG_REMOTE_PARTY_ID_STR(tech_pvt->rpid)),
+			   TAG_IF(!zstr(tech_pvt->preferred_id), SIPTAG_P_PREFERRED_IDENTITY_STR(tech_pvt->preferred_id)),
+			   TAG_IF(!zstr(tech_pvt->asserted_id), SIPTAG_P_ASSERTED_IDENTITY_STR(tech_pvt->asserted_id)),
+			   TAG_IF(!zstr(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->privacy)),
+			   TAG_IF(!zstr(alert_info), SIPTAG_HEADER_STR(alert_info)),
+			   TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
 			   SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
-			   TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
-			   TAG_IF(!switch_strlen_zero(route_uri), NUTAG_PROXY(route_uri)),
-			   TAG_IF(!switch_strlen_zero(route), SIPTAG_ROUTE_STR(route)),
+			   TAG_IF(!zstr(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
+			   TAG_IF(!zstr(route_uri), NUTAG_PROXY(route_uri)),
+			   TAG_IF(!zstr(route), SIPTAG_ROUTE_STR(route)),
 			   SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
 			   SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 			   SOATAG_REUSE_REJECTED(1),
@@ -1828,7 +1828,7 @@
 
 		nua_invite(tech_pvt->nh2,
 				   SIPTAG_CONTACT_STR(contact_url),
-				   TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+				   TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
 				   SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
 				   SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
 				   SOATAG_REUSE_REJECTED(1),
@@ -2606,7 +2606,7 @@
 	char *codec_order[SWITCH_MAX_CODECS];
 	const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS] = { 0 };
 
-	if (!switch_strlen_zero(codec_string)) {
+	if (!zstr(codec_string)) {
 		char *tmp_codec_string;
 		if ((tmp_codec_string = strdup(codec_string))) {
 			num_codecs = switch_separate_string(tmp_codec_string, ',', codec_order, SWITCH_MAX_CODECS);
@@ -2622,7 +2622,7 @@
 	}
 
 	for (attr = sdp->sdp_attributes; attr; attr = attr->a_next) {
-		if (switch_strlen_zero(attr->a_name)) {
+		if (zstr(attr->a_name)) {
 			continue;
 		}
 
@@ -2638,7 +2638,7 @@
 			switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",t38");
 		} else if (m->m_type == sdp_media_audio && m->m_port) {
 			for (attr = m->m_attributes; attr; attr = attr->a_next) {
-				if (switch_strlen_zero(attr->a_name)) {
+				if (zstr(attr->a_name)) {
 					continue;
 				}
 				if (!strcasecmp(attr->a_name, "ptime") && attr->a_value) {
@@ -2744,7 +2744,7 @@
 	switch_assert(tech_pvt != NULL);
 	switch_assert(r_sdp != NULL);
 
-	if (switch_strlen_zero(r_sdp)) {
+	if (zstr(r_sdp)) {
 		return SWITCH_STATUS_FALSE;
 	}
 
@@ -2903,7 +2903,7 @@
 	}
 
 	for (attr = sdp->sdp_attributes; attr; attr = attr->a_next) {
-		if (switch_strlen_zero(attr->a_name)) {
+		if (zstr(attr->a_name)) {
 			continue;
 		}
 
@@ -2975,7 +2975,7 @@
 					ptime = atoi(attr->a_value);
 				} else if (!strcasecmp(attr->a_name, "maxptime") && attr->a_value) {
 					maxptime = atoi(attr->a_value);
-				} else if (!got_crypto && !strcasecmp(attr->a_name, "crypto") && !switch_strlen_zero(attr->a_value)) {
+				} else if (!got_crypto && !strcasecmp(attr->a_name, "crypto") && !zstr(attr->a_value)) {
 					int crypto_tag;
 
 					if (m->m_proto != sdp_proto_srtp) {
@@ -3030,7 +3030,7 @@
 						tech_pvt->crypto_tag = crypto_tag;
 						got_crypto++;
 
-						if (switch_strlen_zero(tech_pvt->local_crypto_key)) {
+						if (zstr(tech_pvt->local_crypto_key)) {
 							if (switch_stristr(SWITCH_RTP_CRYPTO_KEY_32, crypto)) {
 								switch_channel_set_variable(tech_pvt->channel, SOFIA_HAS_CRYPTO_VARIABLE, SWITCH_RTP_CRYPTO_KEY_32);
 								sofia_glue_build_crypto(tech_pvt, atoi(crypto), AES_CM_128_HMAC_SHA1_32, SWITCH_RTP_CRYPTO_SEND);
@@ -3075,7 +3075,7 @@
 				}
 				
 				for (map = m->m_rtpmaps; map; map = map->rm_next) {
-					if (switch_strlen_zero(map->rm_encoding) && map->rm_pt < 96) {
+					if (zstr(map->rm_encoding) && map->rm_pt < 96) {
 						match = (map->rm_pt == tech_pvt->pt) ? 1 : 0;
 					} else {
 						match = strcasecmp(switch_str_nil(map->rm_encoding), tech_pvt->iananame) ? 0 : 1;
@@ -3160,7 +3160,7 @@
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Audio Codec Compare [%s:%d:%u:%d]/[%s:%d:%u:%d]\n",
 									  rm_encoding, map->rm_pt, (int) map->rm_rate, ptime,
 									  imp->iananame, imp->ianacode, codec_rate, imp->microseconds_per_packet / 1000);
-					if (switch_strlen_zero(map->rm_encoding) && map->rm_pt < 96) {
+					if (zstr(map->rm_encoding) && map->rm_pt < 96) {
 						match = (map->rm_pt == imp->ianacode) ? 1 : 0;
 					} else {
 						match = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;
@@ -3226,7 +3226,7 @@
 					tech_pvt->iananame = switch_core_session_strdup(session, (char *) mimp->iananame);
 					tech_pvt->pt = (switch_payload_t) map->rm_pt;
 					tech_pvt->rm_rate = map->rm_rate;
-					if (!strcasecmp((char *) mimp->iananame, "ilbc") && switch_strlen_zero((char*)map->rm_fmtp)) {
+					if (!strcasecmp((char *) mimp->iananame, "ilbc") && zstr((char*)map->rm_fmtp)) {
 						/* default to 30 when no mode is defined for ilbc ONLY */
 						tech_pvt->codec_ms = 30;
 					} else {
@@ -3994,7 +3994,7 @@
 		if (switch_odbc_handle_exec(profile->master_odbc, sql, &stmt) != SWITCH_ODBC_SUCCESS) {
 			char *err_str;
 			err_str = switch_odbc_handle_get_error(profile->master_odbc, stmt);
-			if (!switch_strlen_zero(err_str)) {
+			if (!zstr(err_str)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, err_str);
 			}
 			switch_safe_free(err_str);
@@ -4225,7 +4225,7 @@
 	char *eoc = NULL;
 	char *p = NULL;
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		return NULL;
 	}
 

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -68,7 +68,7 @@
 		goto end;
 	}
 
-	if (!switch_strlen_zero(type)) {
+	if (!zstr(type)) {
 		ct = type;
 	}
 
@@ -96,9 +96,9 @@
 		goto end;
 	}
 
-	if (switch_strlen_zero(host)) {
+	if (zstr(host)) {
 		host = profile->domain_name;
-		if (switch_strlen_zero(host)) {
+		if (zstr(host)) {
 			host = prof;
 		}
 	}
@@ -123,9 +123,9 @@
 			*p++ = '\0';
 		}
 
-		if (switch_strlen_zero(p)) {
+		if (zstr(p)) {
 			p = profile->domain_name;
-			if (switch_strlen_zero(p)) {
+			if (zstr(p)) {
 				p = host;
 			}
 		}
@@ -463,11 +463,11 @@
 		return;
 	}
 
-	if (switch_strlen_zero(event_type)) {
+	if (zstr(event_type)) {
 		event_type = "presence";
 	}
 
-	if (switch_strlen_zero(alt_event_type)) {
+	if (zstr(alt_event_type)) {
 		alt_event_type = "presence";
 	}
 
@@ -625,7 +625,7 @@
 			
 			switch_safe_free(sql);
 
-			if (!switch_strlen_zero((char *) helper.stream.data)) {
+			if (!zstr((char *) helper.stream.data)) {
 				char *this_sql = (char *) helper.stream.data;
 				char *next = NULL;
 				char *last = NULL;
@@ -638,7 +638,7 @@
 						}
 					}
 
-					if (!switch_strlen_zero(this_sql) && (!last || strcmp(last, this_sql))) {
+					if (!zstr(this_sql) && (!last || strcmp(last, this_sql))) {
 						sofia_glue_execute_sql(profile, &this_sql, SWITCH_FALSE);
 						last = this_sql;
 					}
@@ -839,13 +839,13 @@
 			switch_url_decode(to_buf);
 			to_user = to_buf;
 		}
-		if (argc > 10 && !switch_strlen_zero(argv[9]) && !switch_strlen_zero(argv[10])) {
+		if (argc > 10 && !zstr(argv[9]) && !zstr(argv[10])) {
 			status = argv[9];
 			rpid = argv[10];
 		}
 	}
 
-	if (switch_strlen_zero(proto)) {
+	if (zstr(proto)) {
 		proto = NULL;
 	}
 
@@ -863,11 +863,11 @@
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", 0);
 
-		if (!switch_strlen_zero(to_user)) {
+		if (!zstr(to_user)) {
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to-user", to_user);
 		}
 		
-		if (switch_strlen_zero(state)) {
+		if (zstr(state)) {
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", SOFIA_CHAT_PROTO);
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP");
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "resubscribe");
@@ -1004,7 +1004,7 @@
 	int kill_handle = 0;
 	char expires_str[10] = "";
 
-	if (argc > 18 && !switch_strlen_zero(argv[17]) && !switch_strlen_zero(argv[18])) {
+	if (argc > 18 && !zstr(argv[17]) && !zstr(argv[18])) {
 		status = argv[17];
 		rpid = argv[18];
 	}
@@ -1012,11 +1012,11 @@
 	in = helper->event && helper->event->event_id == SWITCH_EVENT_PRESENCE_IN;
 
 
-	if (switch_strlen_zero(rpid)) {
+	if (zstr(rpid)) {
 		rpid = "unknown";
 	}
 
-	if (switch_strlen_zero(status)) {
+	if (zstr(status)) {
 		if (!strcasecmp(rpid, "busy")) {
 			status = "Busy";
 		} else if (!strcasecmp(rpid, "unavailable")) {
@@ -1135,9 +1135,9 @@
 
 			if (!strcasecmp(state, "cs_hangup")) {
 				astate = "terminated";
-			} else if (switch_strlen_zero(astate)) {
+			} else if (zstr(astate)) {
 				astate = switch_str_nil(switch_event_get_header(helper->event, "answer-state"));
-				if (switch_strlen_zero(astate)) {
+				if (zstr(astate)) {
 					if (is_dialog) {
 						astate = dft_state;
 					} else {
@@ -1171,7 +1171,7 @@
 				clean_from_user = switch_mprintf("%s", from_id ? from_id : from_user);
 
 				if (is_dialog) {
-					if (!switch_strlen_zero(clean_to_user) && !switch_strlen_zero(clean_from_user)) {
+					if (!zstr(clean_to_user) && !zstr(clean_from_user)) {
 						stream.write_function(&stream, "<local>\n<identity display=\"%s\">sip:%s@%s</identity>\n", clean_to_user, clean_to_user, host);
 						stream.write_function(&stream, "<target uri=\"sip:%s@%s\">\n", clean_to_user, host);
 						stream.write_function(&stream, "<param pname=\"+sip.rendering\" pvalue=\"%s\"/>\n",
@@ -1183,7 +1183,7 @@
 						stream.write_function(&stream, "</remote>\n");
 					} else if (!strcasecmp(proto, "park")) {
 						stream.write_function(&stream, "<local>\n<identity display=\"parking\">sip:parking@%s;fifo=%s</identity>\n",
-											  host, !switch_strlen_zero(clean_to_user) ? clean_to_user : "unknown");
+											  host, !zstr(clean_to_user) ? clean_to_user : "unknown");
 						stream.write_function(&stream, "<target uri=\"sip:parking@%s\">\n", host);
 						stream.write_function(&stream, "<param pname=\"+sip.rendering\" pvalue=\"no\"/>\n</target>\n</local>\n");
 						stream.write_function(&stream, "<remote>\n<identity display=\"parking\">sip:%s</identity>\n", uuid);
@@ -1191,7 +1191,7 @@
 						stream.write_function(&stream, "</remote>\n");
 					} else if (!strcasecmp(proto, "conf")) {
 						stream.write_function(&stream, "<local>\n<identity display=\"conference\">sip:conference@%s;conference=%s</identity>\n",
-											  host, !switch_strlen_zero(clean_to_user) ? clean_to_user : "unknown");
+											  host, !zstr(clean_to_user) ? clean_to_user : "unknown");
 						stream.write_function(&stream, "<target uri=\"sip:conference@%s\">\n", host);
 						stream.write_function(&stream, "<param pname=\"+sip.rendering\" pvalue=\"yes\"/>\n</target>\n</local>\n");
 						stream.write_function(&stream, "<remote>\n<identity display=\"conference\">sip:%s@%s</identity>\n", uuid, host);
@@ -1214,7 +1214,7 @@
 			ct = "application/dialog-info+xml";
 		}
 
-		if (!switch_strlen_zero(astate) && !switch_strlen_zero(uuid) && helper && helper->stream.data && strcmp(helper->last_uuid, uuid)) {
+		if (!zstr(astate) && !zstr(uuid) && helper && helper->stream.data && strcmp(helper->last_uuid, uuid)) {
 			helper->stream.write_function(&helper->stream, "update sip_dialogs set state='%s' where uuid='%s';", astate, uuid);
 
 			switch_copy_string(helper->last_uuid, uuid, sizeof(helper->last_uuid));
@@ -1231,15 +1231,15 @@
 					rpid = "on-the-phone";
 				} else if (!strcmp(astate, "confirmed")) {
 					char *dest = switch_event_get_header(helper->event, "Caller-Destination-Number");
-					if (switch_strlen_zero(from_id) && !switch_strlen_zero(dest)) {
+					if (zstr(from_id) && !zstr(dest)) {
 						from_id = dest;
 					}
 
-					if (switch_strlen_zero(from_id)) {
+					if (zstr(from_id)) {
 						from_id = p_to_user;
 					}
 					
-					if (switch_strlen_zero(from_id)) {
+					if (zstr(from_id)) {
 						switch_snprintf(status_line, sizeof(status_line), "On The Phone %s", status);
 					} else {
 						switch_snprintf(status_line, sizeof(status_line), "Talk %s", switch_str_nil(from_id));
@@ -1450,10 +1450,10 @@
 
 		display = contact->m_display;
 
-		if (switch_strlen_zero(display)) {
+		if (zstr(display)) {
 			if (from) {
 				display = from->a_display;
-				if (switch_strlen_zero(display)) {
+				if (zstr(display)) {
 					display = "\"user\"";
 				}
 			}
@@ -1481,7 +1481,7 @@
 			int ok = 1;
 			char *last_acl = NULL;
 
-			if (!switch_strlen_zero(contact_host)) {
+			if (!zstr(contact_host)) {
 				for (x = 0; x < profile->nat_acl_count; x++) {
 					last_acl = profile->nat_acl[x];
 					if (!(ok = switch_check_network_list_ip(contact_host, last_acl))) {
@@ -1922,12 +1922,12 @@
 				}
 
 				if (!strcasecmp(status_txt, "open")) {
-					if (switch_strlen_zero(note_txt)) {
+					if (zstr(note_txt)) {
 						note_txt = "Available";
 					}
 					in = 1;
 				} else if (!strcasecmp(status_txt, "closed")) {
-					if (switch_strlen_zero(note_txt)) {
+					if (zstr(note_txt)) {
 						note_txt = "Unavailable";
 					}
 				}

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (15210 => 15211)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -508,7 +508,7 @@
 		host = "none";
 	}
 
-	if (switch_strlen_zero(user)) {
+	if (zstr(user)) {
 		sqlextra = switch_mprintf(" or (sip_host='%q')", host);
 	} else {
 		sqlextra = switch_mprintf(" or (sip_user='%q' and sip_host='%q')", user, host);
@@ -822,10 +822,10 @@
 			}
 		}
 
-		if (switch_strlen_zero(display)) {
+		if (zstr(display)) {
 			if (to) {
 				display = to->a_display;
-				if (switch_strlen_zero(display)) {
+				if (zstr(display)) {
 					display = "\"user\"";
 				}
 			}
@@ -991,7 +991,7 @@
 	if (!authorization || stale) {
 		const char *realm = profile->challenge_realm;
 
-		if (switch_strlen_zero(realm) || !strcasecmp(realm, "auto_to")) {
+		if (zstr(realm) || !strcasecmp(realm, "auto_to")) {
 			realm = to_host;
 		} else if (!strcasecmp(realm, "auto_from")) {
 			realm = from_host;
@@ -1320,7 +1320,7 @@
 			contact_host = sip->sip_contact->m_url->url_host;
 		}
 
-		if (!switch_strlen_zero(contact_host)) {
+		if (!zstr(contact_host)) {
 			for (x = 0; x < profile->nat_acl_count; x++) {
 				last_acl = profile->nat_acl[x];
 				if (!(ok = switch_check_network_list_ip(contact_host, last_acl))) {
@@ -1649,14 +1649,14 @@
 
 	/* Optional check that auth name == SIP username */
 	if ((regtype == REG_REGISTER) && sofia_test_pflag(profile, PFLAG_CHECKUSER)) {
-		if (switch_strlen_zero(username) || switch_strlen_zero(to_user) || strcasecmp(to_user, username)) {
+		if (zstr(username) || zstr(to_user) || strcasecmp(to_user, username)) {
 			/* Names don't match, so fail */
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SIP username %s does not match auth username\n", switch_str_nil(to_user));
 			goto end;
 		}
 	}
 
-	if (switch_strlen_zero(np)) {
+	if (zstr(np)) {
 		first = 1;
 		sql = switch_mprintf("select nonce from sip_authentication where nonce='%q'", nonce);
 		switch_assert(sql != NULL);
@@ -1726,13 +1726,13 @@
 	}
 
 
-	if (!switch_strlen_zero(profile->reg_domain)) {
+	if (!zstr(profile->reg_domain)) {
 		domain_name = profile->reg_domain;
 	} else {
 		domain_name = realm;
 	}
 
-	if (switch_xml_locate_user("id", switch_strlen_zero(username) ? "nobody" : username, 
+	if (switch_xml_locate_user("id", zstr(username) ? "nobody" : username, 
 							   domain_name, ip, &xml, &domain, &user, &group, params) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n"
 						  "You must define a domain called '%s' in your directory and add a user with the id=\"%s\" attribute\n"
@@ -1751,7 +1751,7 @@
 	}
 	
 	if (!(number_alias = (char *) switch_xml_attr(user, "number-alias"))) {
-		number_alias = switch_strlen_zero(username) ? "nobody" : username;
+		number_alias = zstr(username) ? "nobody" : username;
 	}
 
 	dparams = switch_xml_child(domain, "params");
@@ -1854,7 +1854,7 @@
 		}
 	}
 
-	if (switch_strlen_zero(passwd) && switch_strlen_zero(a1_hash)) {
+	if (zstr(passwd) && zstr(a1_hash)) {
 		ret = AUTH_OK;
 		goto skip_auth;
 	}
@@ -1973,7 +1973,7 @@
 						const char *val = switch_xml_attr_soft(param, "value");
 						sofia_gateway_t *gateway_ptr = NULL;
 
-						if (!switch_strlen_zero(var) && !switch_strlen_zero(val) && (xparams_type[j] == 1 || !strncasecmp(var, "sip-",4) || !strcasecmp(var, "register-gateway")) ) {
+						if (!zstr(var) && !zstr(val) && (xparams_type[j] == 1 || !strncasecmp(var, "sip-",4) || !strcasecmp(var, "register-gateway")) ) {
 							if (!switch_event_get_header(*v_event, var)) {
 								if (profile->debug) {
 									switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "event_add_header -> '%s' = '%s'\n",var, val);
@@ -1989,7 +1989,7 @@
 									if ((gateways_tag = switch_xml_child(user, "gateways"))) {
 										for (gateway_tag = switch_xml_child(gateways_tag, "gateway"); gateway_tag; gateway_tag = gateway_tag->next) {
 											char *name = (char *) switch_xml_attr_soft(gateway_tag, "name");
-											if (switch_strlen_zero(name)) {
+											if (zstr(name)) {
 												name = "anonymous";
 											}
 

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c (15210 => 15211)


--- freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -372,7 +372,7 @@
 	}
 
 
-	if (switch_strlen_zero(globals.default_template)) {
+	if (zstr(globals.default_template)) {
 		globals.default_template = switch_core_strdup(pool, "default");
 	}
 

Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c (15210 => 15211)


--- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/ei_helpers.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -347,7 +347,7 @@
 #endif
 		memcpy(thishostname, nodehost->h_name, EI_MAXHOSTNAMELEN);
 	
-	if (switch_strlen_zero_buf(thishostname)) {
+	if (zstr_buf(thishostname)) {
 		gethostname(thishostname, EI_MAXHOSTNAMELEN);
 	}
 

Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c (15210 => 15211)


--- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -465,7 +465,7 @@
 	}
 	else {
 		switch_core_session_t *session;
-		if (!switch_strlen_zero_buf(uuid) && (session = switch_core_session_locate(uuid))) {
+		if (!zstr_buf(uuid) && (session = switch_core_session_locate(uuid))) {
 			switch_event_t *event;	  
 			if (switch_event_create(&event, SWITCH_EVENT_SEND_MESSAGE) == SWITCH_STATUS_SUCCESS) {
 				
@@ -577,7 +577,7 @@
 		ei_x_encode_atom(rbuf, "badarg");
 	} else {
 		switch_core_session_t *session;
-		if (!switch_strlen_zero_buf(uuid_str)) {
+		if (!zstr_buf(uuid_str)) {
 			if ((session = switch_core_session_locate(uuid_str))) {
 				/* create a new session list element and attach it to this listener */
 				if ((arity==2 && attach_call_to_pid(listener, &msg->from, session)) ||

Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c (15210 => 15211)


--- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -451,7 +451,7 @@
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "got data %s after %d milliseconds!\n", xmlstr, i*10);
 
-	if (switch_strlen_zero(xmlstr)) {
+	if (zstr(xmlstr)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
 	} else if (!(xml = switch_xml_parse_str_dynamic(xmlstr, SWITCH_FALSE))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n");
@@ -848,7 +848,7 @@
 static switch_bool_t check_inbound_acl(listener_t* listener)
 {
 	/* check acl to see if inbound connection is allowed */
-	if (prefs.acl_count && !switch_strlen_zero(listener->remote_ip)) {
+	if (prefs.acl_count && !zstr(listener->remote_ip)) {
 		uint32_t x = 0;
 		for (x = 0; x < prefs.acl_count; x++) {
 			if (!switch_check_network_list_ip(listener->remote_ip, prefs.acl[x])) {
@@ -904,7 +904,7 @@
 	switch_assert(listener != NULL);
 
 	if (check_inbound_acl(listener)) {
-		if (switch_strlen_zero(listener->remote_ip)) {
+		if (zstr(listener->remote_ip)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Open\n");
 		} else {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Open from %s\n", listener->remote_ip);/*, listener->remote_port);*/
@@ -1027,11 +1027,11 @@
 		switch_xml_free(xml);
 	}
 
-	if (switch_strlen_zero(prefs.ip)) {
+	if (zstr(prefs.ip)) {
 		set_pref_ip("0.0.0.0");
 	}
 
-	if (switch_strlen_zero(prefs.cookie)) {
+	if (zstr(prefs.cookie)) {
 		set_pref_cookie("ClueCon");
 	}
 
@@ -1319,7 +1319,7 @@
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Parse Error - need registered name and node!\n");
 		return;
 	}
-	if (switch_strlen_zero(argv[0])) {
+	if (zstr(argv[0])) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing registered name or module:function!\n");
 		return;
 	}
@@ -1339,7 +1339,7 @@
 
 
 	node = argv[1];
-	if (switch_strlen_zero(node)) {
+	if (zstr(node)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing node name!\n");
 		return;
 	}
@@ -1451,7 +1451,7 @@
 		"erlang sessions <node_name>\n"
 		"--------------------------------------------------------------------------------\n";
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%s", usage_string);
 		goto done;
 	}

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (15210 => 15211)


--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -356,7 +356,7 @@
 
 	host = argv[0];
 
-	if (switch_strlen_zero(host)) {
+	if (zstr(host)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing Host!\n");
 		return;
 	}
@@ -617,7 +617,7 @@
             goto end;
 		}
 
-		if (switch_strlen_zero(action)) {
+		if (zstr(action)) {
 			stream->write_function(stream, "<data><reply type=\"error\">Invalid Syntax</reply></data>\n");
             goto end;
 		}
@@ -628,7 +628,7 @@
 		}
 
 		if (!strcasecmp(action, "delete")) {
-			if (switch_strlen_zero(header_val)) {
+			if (zstr(header_val)) {
 				stream->write_function(stream, "<data><reply type=\"error\">Invalid Syntax</reply></data>\n");
 				goto filter_end;
 			}
@@ -641,7 +641,7 @@
 			}
 			stream->write_function(stream, "<data>\n <reply type=\"success\">filter deleted.</reply>\n<api-command>\n");
 		} else if (!strcasecmp(action, "add")) {
-			if (switch_strlen_zero(header_name) || switch_strlen_zero(header_val)) {
+			if (zstr(header_name) || zstr(header_val)) {
 				stream->write_function(stream, "<data><reply type=\"error\">Invalid Syntax</reply></data>\n");
 				goto filter_end;
 			}
@@ -715,7 +715,7 @@
 		uint8_t custom = 0;
 		char *edup;
 		
-		if (switch_strlen_zero(events) && switch_strlen_zero(loglevel)) {
+		if (zstr(events) && zstr(loglevel)) {
 			stream->write_function(stream, "<data><reply type=\"error\">Missing parameter!</reply></data>\n");
 			goto end;
 		}
@@ -1068,7 +1068,7 @@
 						char *var, *val;
 						var = cur;
 						strip_cr(var);
-						if (!switch_strlen_zero(var)) {
+						if (!zstr(var)) {
 							if ((val = strchr(var, ':'))) {
 								*val++ = '\0';
 								while (*val == ' ') {
@@ -1583,7 +1583,7 @@
 			}
 		}
 
-		if (switch_strlen_zero(onoff)) {
+		if (zstr(onoff)) {
 			switch_snprintf(reply, reply_len, "-ERR missing value.");
 			goto done;
 		}
@@ -1623,7 +1623,7 @@
 			}
 		}
 		
-		if (switch_strlen_zero(uuid)) {
+		if (zstr(uuid)) {
 			uuid = switch_event_get_header(*event, "session-id");
 		}
 
@@ -1631,7 +1631,7 @@
 			uuid = NULL;
 		}
 
-		if (switch_strlen_zero(uuid) && listener->session) {
+		if (zstr(uuid) && listener->session) {
 			if (async) {
 				if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) {
 					switch_snprintf(reply, reply_len, "+OK");
@@ -1643,7 +1643,7 @@
 				switch_snprintf(reply, reply_len, "+OK");
 			}
 		} else {
-			if (!switch_strlen_zero(uuid) && (session = switch_core_session_locate(uuid))) {
+			if (!zstr(uuid) && (session = switch_core_session_locate(uuid))) {
 				if ((status = switch_core_session_queue_private_event(session, event)) == SWITCH_STATUS_SUCCESS) {
 					switch_snprintf(reply, reply_len, "+OK");
 				} else {
@@ -1789,12 +1789,12 @@
 		level_s = cmd + 3;
 
 		//see if we got an argument
-		if (!switch_strlen_zero(level_s)) {
+		if (!zstr(level_s)) {
 			//if so move to the argument
 			level_s++;
 		}
 		//see if we lined up on an argument or not
-		if (!switch_strlen_zero(level_s)) {
+		if (!zstr(level_s)) {
 			ltype = switch_log_str2level(level_s);
 		}
 
@@ -1961,7 +1961,7 @@
 
  done:
 
-	if (switch_strlen_zero(reply)) {
+	if (zstr(reply)) {
 		switch_snprintf(reply, reply_len, "-ERR command not found");
 	}
 
@@ -2003,7 +2003,7 @@
 	switch_socket_opt_set(listener->sock, SWITCH_SO_TCP_NODELAY, TRUE);
 	switch_socket_opt_set(listener->sock, SWITCH_SO_NONBLOCK, TRUE);
 
-	if (prefs.acl_count && listener->sa && !switch_strlen_zero(listener->remote_ip)) {
+	if (prefs.acl_count && listener->sa && !zstr(listener->remote_ip)) {
 		uint32_t x = 0;
 
 		for (x = 0; x < prefs.acl_count; x++) {
@@ -2024,7 +2024,7 @@
 	}
 	
 	if (globals.debug > 0) {
-		if (switch_strlen_zero(listener->remote_ip)) {
+		if (zstr(listener->remote_ip)) {
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Connection Open\n");
 		} else {
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Connection Open from %s:%d\n", listener->remote_ip, listener->remote_port);
@@ -2243,11 +2243,11 @@
 		switch_xml_free(xml);
 	}
 
-	if (switch_strlen_zero(prefs.ip)) {
+	if (zstr(prefs.ip)) {
 		set_pref_ip("127.0.0.1");
 	}
 
-	if (switch_strlen_zero(prefs.password)) {
+	if (zstr(prefs.password)) {
 		set_pref_pass("ClueCon");
 	}
 

Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c (15210 => 15211)


--- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -608,7 +608,7 @@
 	int argc = 0;
 
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto usage;
 	}
 
@@ -621,7 +621,7 @@
 	}
 
 	local_stream_name = argv[0];
-	if (switch_strlen_zero(local_stream_name)) {
+	if (zstr(local_stream_name)) {
 		goto usage;
 	}
 
@@ -662,7 +662,7 @@
 
 	switch_mutex_lock(globals.mutex);
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		for (hi = switch_hash_first(NULL, globals.source_hash); hi; hi = switch_hash_next(hi)) {
 			switch_hash_this(hi, &var, NULL, &val);
 			if ((source = (local_stream_source_t *) val)) {
@@ -751,7 +751,7 @@
 	switch_xml_t cfg, xml, directory, param;
 	int tmp;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto usage;
 	}
 
@@ -855,7 +855,7 @@
 		switch_xml_free(xml);
 	}
 	
-	if (switch_strlen_zero(local_stream_name) || switch_strlen_zero(path)) {
+	if (zstr(local_stream_name) || zstr(path)) {
 		goto usage;
 	}
 

Modified: freeswitch/trunk/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c (15210 => 15211)


--- freeswitch/trunk/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -136,7 +136,7 @@
 		int match = 0;
 		pdi = Pa_GetDeviceInfo(i);
 
-		if (switch_strlen_zero(name)) {
+		if (zstr(name)) {
 			match = 1;
 		} else if (pdi && pdi->name && strstr(pdi->name, name)) {
 			match = 1;

Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp (15210 => 15211)


--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp	2009-10-23 16:03:42 UTC (rev 15211)
@@ -140,7 +140,7 @@
 		lua_call(L, arg_count, 1);
 		err = lua_tostring(L, -1);
 
-		if (!switch_strlen_zero(err)) {
+		if (!zstr(err)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", err);
 		}
 
@@ -198,7 +198,7 @@
 
 	if (func) {
 		hangup_func_str = strdup(func);
-		if (!switch_strlen_zero(arg)) {
+		if (!zstr(arg)) {
 			hangup_func_arg = strdup(arg);
 		}
 		switch_channel_set_private(channel, "CoreSession", this);
@@ -269,7 +269,7 @@
 			lua_pushnumber(L, dtmf->duration);
 			lua_rawset(L, -3);
 
-			if (!switch_strlen_zero(cb_arg)) {
+			if (!zstr(cb_arg)) {
 				lua_getfield(L, LUA_GLOBALSINDEX, (char *) cb_arg);
 				arg_count++;
 			}
@@ -293,7 +293,7 @@
 			mod_lua_conjure_event(L, event, "__Input_Event__", 1);
 			lua_getfield(L, LUA_GLOBALSINDEX, "__Input_Event__");
 
-			if (!switch_strlen_zero(cb_arg)) {
+			if (!zstr(cb_arg)) {
 				lua_getfield(L, LUA_GLOBALSINDEX, (char *) cb_arg);
 				arg_count++;
 			}

Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp (15210 => 15211)


--- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp	2009-10-23 16:03:42 UTC (rev 15211)
@@ -121,7 +121,7 @@
 {
 	int error = 0;
 
-	if (switch_strlen_zero(input_code)) {
+	if (zstr(input_code)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No code to execute!\n");
 		return 1;
 	}
@@ -178,7 +178,7 @@
 
 	if (error) {
 		const char *err = lua_tostring(L, -1);
-		if (!switch_strlen_zero(err)) {
+		if (!zstr(err)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", err);
 		}
 		lua_pop(L, 1);			/* pop error message from the stack */
@@ -216,7 +216,7 @@
 
 	switch_xml_t xml = NULL;
 
-	if (!switch_strlen_zero(globals.xml_handler)) {
+	if (!zstr(globals.xml_handler)) {
 		lua_State *L = lua_init();
 		char *mycmd = strdup(globals.xml_handler);
 		const char *str;
@@ -253,7 +253,7 @@
 		str = lua_tostring(L, 1);
 		
 		if (str) {
-			if (switch_strlen_zero(str)) {
+			if (zstr(str)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
 			} else if (!(xml = switch_xml_parse_str_dynamic((char *)str, SWITCH_TRUE))) { 
 				/* const char -> char conversion was OK because switch_xml_parse_str_dynamic makes a duplicate of str 
@@ -293,17 +293,17 @@
 			if (!strcmp(var, "xml-handler-script")) {
 				globals.xml_handler = switch_core_strdup(globals.pool, val);
 			} else if (!strcmp(var, "xml-handler-bindings")) {
-				if (!switch_strlen_zero(globals.xml_handler)) {
+				if (!zstr(globals.xml_handler)) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "binding '%s' to '%s'\n", globals.xml_handler, val);
 					switch_xml_bind_search_function(lua_fetch, switch_xml_parse_section_string(val), NULL);
 				}
-			} else if (!strcmp(var, "module-directory") && !switch_strlen_zero(val)) {
+			} else if (!strcmp(var, "module-directory") && !zstr(val)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "lua: appending module directory: '%s'\n", val);
 				if (cpath_stream.data_len) {
 					cpath_stream.write_function(&cpath_stream, ";");
 				}
 				cpath_stream.write_function(&cpath_stream, "%s", val);
-			} else if (!strcmp(var, "script-directory") && !switch_strlen_zero(val)) {
+			} else if (!strcmp(var, "script-directory") && !zstr(val)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "lua: appending script directory: '%s'\n", val);
 				if (path_stream.data_len) {
 					path_stream.write_function(&path_stream, ";");
@@ -394,7 +394,7 @@
 	char *mycmd;
 	int error;
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "no args specified!\n");
 		return;
 	}
@@ -413,7 +413,7 @@
 SWITCH_STANDARD_API(luarun_api_function)
 {
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-ERR no args specified!\n");
 	} else {
 		lua_thread(cmd);
@@ -431,7 +431,7 @@
 	char *mycmd;
 	int error;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "");
 	} else {
 

Modified: freeswitch/trunk/src/mod/languages/mod_managed/mod_managed.cpp (15210 => 15211)


--- freeswitch/trunk/src/mod/languages/mod_managed/mod_managed.cpp	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/languages/mod_managed/mod_managed.cpp	2009-10-23 16:03:42 UTC (rev 15211)
@@ -371,7 +371,7 @@
 #endif
 SWITCH_STANDARD_API(managedrun_api_function) 
 {
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-ERR no args specified!\n");	
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -391,7 +391,7 @@
 
 SWITCH_STANDARD_API(managed_api_function) 
 {
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-ERR no args specified!\n");	
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -409,7 +409,7 @@
 
 SWITCH_STANDARD_APP(managed_app_function) 
 {
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No args specified!\n");
 		return;
 	}
@@ -426,7 +426,7 @@
 
 SWITCH_STANDARD_API(managedreload_api_function) 
 {
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-ERR no args specified!\n");	
 		return SWITCH_STATUS_SUCCESS;
 	}

Modified: freeswitch/trunk/src/mod/languages/mod_perl/mod_perl.c (15210 => 15211)


--- freeswitch/trunk/src/mod/languages/mod_perl/mod_perl.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/languages/mod_perl/mod_perl.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -64,7 +64,7 @@
 
 	Perl_eval_pv(my_perl, string, FALSE);
 
-	if ((err = SvPV(get_sv("@", TRUE), n_a)) && !switch_strlen_zero(err)) {
+	if ((err = SvPV(get_sv("@", TRUE), n_a)) && !zstr(err)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "[%s]\n%s\n", string, err);
 		return -1;
 	}
@@ -77,7 +77,7 @@
 {
 	int error = 0;
 
-	if (switch_strlen_zero(input_code)) {
+	if (zstr(input_code)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No code to execute!\n");
 		return -1;
 	}
@@ -183,7 +183,7 @@
 			}
 		}
 
-		if ((err = SvPV(get_sv("@", TRUE), n_a)) && !switch_strlen_zero(err)) {
+		if ((err = SvPV(get_sv("@", TRUE), n_a)) && !zstr(err)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", err);
 		}
 
@@ -304,7 +304,7 @@
 SWITCH_STANDARD_API(perlrun_api_function)
 {
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-ERR Missing args.\n");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -319,7 +319,7 @@
 
 	struct perl_o po = { 0 };
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "-ERR Missing args.\n");
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -338,7 +338,7 @@
 	int argc = 0;
 	switch_xml_t xml = NULL;
 
-	if (!switch_strlen_zero(globals.xml_handler)) {
+	if (!zstr(globals.xml_handler)) {
 		PerlInterpreter *my_perl = clone_perl();
 		HV *hash;
 		char *str;
@@ -360,7 +360,7 @@
 			abort();
 		}
 
-		if (switch_strlen_zero(section)) {
+		if (zstr(section)) {
 			section = "";
 		}
 
@@ -368,7 +368,7 @@
 		sv_setpv(this, section);
 		hv_store(hash, "section", 7, this, 0);
 
-		if (switch_strlen_zero(tag_name)) {
+		if (zstr(tag_name)) {
 			tag_name = "";
 		}
 
@@ -376,7 +376,7 @@
 		sv_setpv(this, tag_name);
 		hv_store(hash, "tag_name", 8, this, 0);
 
-		if (switch_strlen_zero(key_name)) {
+		if (zstr(key_name)) {
 			key_name = "";
 		}
 
@@ -384,7 +384,7 @@
 		sv_setpv(this, key_name);
 		hv_store(hash, "key_name", 8, this, 0);
 
-		if (switch_strlen_zero(key_value)) {
+		if (zstr(key_value)) {
 			key_value = "";
 		}
 
@@ -414,8 +414,8 @@
 		perl_run(my_perl);
 		str = SvPV(get_sv("XML_STRING", TRUE), n_a);
 
-		if (!switch_strlen_zero(str)) {
-			if (switch_strlen_zero(str)) {
+		if (!zstr(str)) {
+			if (zstr(str)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
 			} else if (!(xml = switch_xml_parse_str(str, strlen(str)))) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n");
@@ -446,7 +446,7 @@
 			if (!strcmp(var, "xml-handler-script")) {
 				globals.xml_handler = switch_core_strdup(globals.pool, val);
 			} else if (!strcmp(var, "xml-handler-bindings")) {
-				if (!switch_strlen_zero(globals.xml_handler)) {
+				if (!zstr(globals.xml_handler)) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "binding '%s' to '%s'\n", globals.xml_handler, var);
 					switch_xml_bind_search_function(perl_fetch, switch_xml_parse_section_string(val), NULL);
 				}

Modified: freeswitch/trunk/src/mod/languages/mod_python/mod_python.c (15210 => 15211)


--- freeswitch/trunk/src/mod/languages/mod_python/mod_python.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/languages/mod_python/mod_python.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -236,7 +236,7 @@
 	switch_xml_t xml = NULL;
 	char *str = NULL;
 
-	if (!switch_strlen_zero(globals.xml_handler)) {
+	if (!zstr(globals.xml_handler)) {
 		char *mycmd = strdup(globals.xml_handler);
 
 		switch_assert(mycmd);
@@ -244,7 +244,7 @@
 		eval_some_python("xml_fetch", mycmd, NULL, NULL, params, &str, NULL);
 
 		if (str) {
-			if (switch_strlen_zero(str)) {
+			if (zstr(str)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
 			} else if (!(xml = switch_xml_parse_str((char *) str, strlen(str)))) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n");
@@ -276,7 +276,7 @@
 			if (!strcmp(var, "xml-handler-script")) {
 				globals.xml_handler = switch_core_strdup(globals.pool, val);
 			} else if (!strcmp(var, "xml-handler-bindings")) {
-				if (!switch_strlen_zero(globals.xml_handler)) {
+				if (!zstr(globals.xml_handler)) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "binding '%s' to '%s'\n", globals.xml_handler, val);
 					switch_xml_bind_search_function(python_fetch, switch_xml_parse_section_string(val), NULL);
 				}
@@ -397,7 +397,7 @@
 SWITCH_STANDARD_API(launch_python)
 {
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "USAGE: %s\n", python_run_interface.syntax);
 		return SWITCH_STATUS_SUCCESS;
 	}

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (15210 => 15211)


--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -1015,7 +1015,7 @@
 		if ((mods = switch_xml_child(cfg, "modules"))) {
 			for (ld = switch_xml_child(mods, "load"); ld; ld = ld->next) {
 				const char *val = switch_xml_attr_soft(ld, "module");
-				if (!switch_strlen_zero(val) && strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT)) {
+				if (!zstr(val) && strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT)) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
 					continue;
 				}
@@ -1405,7 +1405,7 @@
 
 	if (argc > 0) {
 		file_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
-		if (switch_strlen_zero(file_name)) {
+		if (zstr(file_name)) {
 			return JS_FALSE;
 		}
 	}
@@ -1542,7 +1542,7 @@
 
 	if (argc > 0) {
 		phrase_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
-		if (switch_strlen_zero(phrase_name)) {
+		if (zstr(phrase_name)) {
 			return JS_FALSE;
 		}
 	} else {
@@ -1555,7 +1555,7 @@
 
 	if (argc > 2) {
 		tmp = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
-		if (!switch_strlen_zero(tmp)) {
+		if (!zstr(tmp)) {
 			phrase_lang = tmp;
 		}
 	}
@@ -1609,7 +1609,7 @@
 		}
 		JS_CallFunction(jss->cx, jss->obj, jss->on_hangup, argc, argv, &ret);
 		resp = JS_GetStringBytes(JS_ValueToString(jss->cx, ret));
-		if (!switch_strlen_zero(resp)) {
+		if (!zstr(resp)) {
 			ret = !strcasecmp(resp, "exit") ? JS_FALSE : JS_TRUE;
 		}
 	}
@@ -1683,7 +1683,7 @@
 
 	if (argc > 0) {
 		file_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
-		if (switch_strlen_zero(file_name)) {
+		if (zstr(file_name)) {
 			return JS_FALSE;
 		}
 	}
@@ -1927,12 +1927,12 @@
 	voice_name = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
 	text = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
 
-	if (switch_strlen_zero(tts_name)) {
+	if (zstr(tts_name)) {
 		eval_some_js("~throw new Error(\"Invalid TTS Name\");", cx, obj, rval);
 		return JS_FALSE;
 	}
 
-	if (switch_strlen_zero(text)) {
+	if (zstr(text)) {
 		eval_some_js("~throw new Error(\"Invalid Text\");", cx, obj, rval);
 		return JS_FALSE;
 	}
@@ -2972,21 +2972,21 @@
 
 		}
 
-		if (!switch_strlen_zero(jss->dialplan))
+		if (!zstr(jss->dialplan))
 			dialplan = jss->dialplan;
-		if (!switch_strlen_zero(jss->caller_id_name))
+		if (!zstr(jss->caller_id_name))
 			cid_name = jss->caller_id_name;
-		if (!switch_strlen_zero(jss->caller_id_number))
+		if (!zstr(jss->caller_id_number))
 			cid_num = jss->caller_id_number;
-		if (!switch_strlen_zero(jss->ani))
+		if (!zstr(jss->ani))
 			ani = jss->ani;
-		if (!switch_strlen_zero(jss->aniii))
+		if (!zstr(jss->aniii))
 			aniii = jss->aniii;
-		if (!switch_strlen_zero(jss->rdnis))
+		if (!zstr(jss->rdnis))
 			rdnis = jss->rdnis;
-		if (!switch_strlen_zero(jss->context))
+		if (!zstr(jss->context))
 			context = jss->context;
-		if (!switch_strlen_zero(jss->username))
+		if (!zstr(jss->username))
 			username = jss->username;
 
 		dest = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
@@ -2998,7 +2998,7 @@
 
 		if (argc > 2) {
 			tmp = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
-			if (!switch_strlen_zero(tmp)) {
+			if (!zstr(tmp)) {
 				to = tmp;
 			}
 		}
@@ -3678,7 +3678,7 @@
 	struct js_task *task;
 	switch_memory_pool_t *pool;
 
-	if (switch_strlen_zero(text)) {
+	if (zstr(text)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "missing required input!\n");
 		return;
 	}
@@ -3707,11 +3707,11 @@
 		path_info = switch_event_get_header(stream->param_event, "http-path-info");
 	}
 
-	if (switch_strlen_zero(cmd) && path_info) {
+	if (zstr(cmd) && path_info) {
 		cmd = path_info;
 	}
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "USAGE: %s\n", jsapi_interface->syntax);
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -3727,7 +3727,7 @@
 
 SWITCH_STANDARD_API(launch_async)
 {
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "USAGE: %s\n", js_run_interface->syntax);
 		return SWITCH_STATUS_SUCCESS;
 	}

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.c (15210 => 15211)


--- freeswitch/trunk/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -144,7 +144,7 @@
 
 	if (argc > 5) {
 		cred = JS_GetStringBytes(JS_ValueToString(cx, argv[5]));
-		if (!switch_strlen_zero(cred)) {
+		if (!zstr(cred)) {
 			curl_easy_setopt(co->curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
 			curl_easy_setopt(co->curl_handle, CURLOPT_USERPWD, cred);
 		}
@@ -174,7 +174,7 @@
 			data = "";
 		}
 		curl_easy_setopt(co->curl_handle, CURLOPT_POSTFIELDS, data);
-	} else if (!switch_strlen_zero(data)) {
+	} else if (!zstr(data)) {
 		durl = switch_mprintf("%s?%s", url, data);
 		url_p = durl;
 	}

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c (15210 => 15211)


--- freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -128,11 +128,11 @@
 		}
 	}
 
-	if (switch_strlen_zero(username)) {
+	if (zstr(username)) {
 		username = NULL;
 	}
 
-	if (switch_strlen_zero(password)) {
+	if (zstr(password)) {
 		password = NULL;
 	}
 

Modified: freeswitch/trunk/src/mod/languages/mod_yaml/mod_yaml.c (15210 => 15211)


--- freeswitch/trunk/src/mod/languages/mod_yaml/mod_yaml.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/languages/mod_yaml/mod_yaml.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -404,7 +404,7 @@
 	char *path = NULL;
 	FILE *input;
 
-	if (!switch_strlen_zero(alt_path)) {
+	if (!zstr(alt_path)) {
 		path = strdup(alt_path);
 	} else {
 		path = switch_mprintf("%s/yaml/extensions.yaml", SWITCH_GLOBAL_dirs.conf_dir);

Modified: freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c (15210 => 15211)


--- freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -130,7 +130,7 @@
 #else
 				COLORIZE = 1;
 #endif
-			} else if (!strcasecmp(var, "loglevel") && !switch_strlen_zero(val)) {
+			} else if (!strcasecmp(var, "loglevel") && !zstr(val)) {
 				hard_log_level = switch_log_str2level(val);
 			}
 		}
@@ -289,7 +289,7 @@
 	if (session)
 		return SWITCH_STATUS_FALSE;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		stream->write_function(stream, "%s", usage_string);
 		goto done;
 	}

Modified: freeswitch/trunk/src/mod/loggers/mod_logfile/mod_logfile.c (15210 => 15211)


--- freeswitch/trunk/src/mod/loggers/mod_logfile/mod_logfile.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/loggers/mod_logfile/mod_logfile.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -277,7 +277,7 @@
 		}
 	}
 
-	if (switch_strlen_zero(new_profile->logfile)) {
+	if (zstr(new_profile->logfile)) {
 		char logfile[512];
 		switch_snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch.log");
 		new_profile->logfile = strdup(logfile);

Modified: freeswitch/trunk/src/mod/loggers/mod_syslog/mod_syslog.c (15210 => 15211)


--- freeswitch/trunk/src/mod/loggers/mod_syslog/mod_syslog.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/loggers/mod_syslog/mod_syslog.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -101,7 +101,7 @@
 	}
 
 	/* don't log blank lines */
-	if (!switch_strlen_zero(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) {
+	if (!zstr(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) {
 		syslog(syslog_level, "%s", node->data);
 	}
 
@@ -130,7 +130,7 @@
 					set_global_format(val);
 				} else if (!strcmp(var, "facility")) {
 					set_global_facility(val);
-                } else if (!strcasecmp(var, "loglevel") && !switch_strlen_zero(val)) {
+                } else if (!strcasecmp(var, "loglevel") && !zstr(val)) {
                     log_level = switch_log_str2level(val);
                     if (log_level == SWITCH_LOG_INVALID) {
                         log_level = SWITCH_LOG_WARNING;
@@ -142,13 +142,13 @@
 		switch_xml_free(xml);
 	}
 
-	if (switch_strlen_zero(globals.ident)) {
+	if (zstr(globals.ident)) {
 		set_global_ident(DEFAULT_IDENT);
 	}
-	if (switch_strlen_zero(globals.format)) {
+	if (zstr(globals.format)) {
 		set_global_format(DEFAULT_FORMAT);
 	}
-    if (switch_strlen_zero(globals.facility)) {
+    if (zstr(globals.facility)) {
 		set_global_facility(DEFAULT_FACILITY);
     }
 	return 0;

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (15210 => 15211)


--- freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -89,7 +89,7 @@
 
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Rotating log file paths\n");
 
-	if (!switch_strlen_zero(globals.base_log_dir)) {
+	if (!zstr(globals.base_log_dir)) {
 		if (globals.rotate) {
 			if ((path = switch_mprintf("%s%s%s", globals.base_log_dir, SWITCH_PATH_SEPARATOR, date))) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Rotating log file path to %s\n", path);
@@ -131,7 +131,7 @@
 		}
 	}
 
-	if (!switch_strlen_zero(globals.base_err_log_dir)) {
+	if (!zstr(globals.base_err_log_dir)) {
 		if (globals.rotate) {
 			if ((path = switch_mprintf("%s%s%s", globals.base_err_log_dir, SWITCH_PATH_SEPARATOR, date))) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Rotating err log file path to %s\n", path);
@@ -223,7 +223,7 @@
 		logdir = globals.log_dir;
 	}
 
-	if (!switch_strlen_zero(logdir)) {
+	if (!zstr(logdir)) {
 		path = switch_mprintf("%s%s%s%s.cdr.xml", logdir, SWITCH_PATH_SEPARATOR, a_prefix, switch_core_session_get_uuid(session));
 		switch_thread_rwlock_unlock(globals.log_path_lock);
 		if (path) {
@@ -280,7 +280,7 @@
 			goto error;
 		}
 
-		if (!switch_strlen_zero(globals.cred)) {
+		if (!zstr(globals.cred)) {
 			curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
 			curl_easy_setopt(curl_handle, CURLOPT_USERPWD, globals.cred);
 		}
@@ -474,15 +474,15 @@
 			char *var = (char *) switch_xml_attr_soft(param, "name");
 			char *val = (char *) switch_xml_attr_soft(param, "value");
 
-			if (!strcasecmp(var, "cred") && !switch_strlen_zero(val)) {
+			if (!strcasecmp(var, "cred") && !zstr(val)) {
 				globals.cred = switch_core_strdup(globals.pool, val);
-			} else if (!strcasecmp(var, "url") && !switch_strlen_zero(val)) {
+			} else if (!strcasecmp(var, "url") && !zstr(val)) {
 				if (globals.url_count >= MAX_URLS) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "maximum urls configured!\n");
 				} else {
 					globals.urls[globals.url_count++] = switch_core_strdup(globals.pool, val);
 				}
-			} else if (!strcasecmp(var, "delay") && !switch_strlen_zero(val)) {
+			} else if (!strcasecmp(var, "delay") && !zstr(val)) {
 				globals.delay = (uint32_t) atoi(val);
 			} else if (!strcasecmp(var, "log-b-leg")) {
 				globals.log_b = switch_true(val);
@@ -490,18 +490,18 @@
 				globals.prefix_a = switch_true(val);
 			} else if (!strcasecmp(var, "disable-100-continue") && switch_true(val)) {
 				globals.disable100continue = 1;
-			} else if (!strcasecmp(var, "encode") && !switch_strlen_zero(val)) {
+			} else if (!strcasecmp(var, "encode") && !zstr(val)) {
 				if (!strcasecmp(val, "base64")) {
 					globals.encode = 2;
 				} else {
 					globals.encode = switch_true(val) ? 1 : 0;
 				}
-			} else if (!strcasecmp(var, "retries") && !switch_strlen_zero(val)) {
+			} else if (!strcasecmp(var, "retries") && !zstr(val)) {
 				globals.retries = (uint32_t) atoi(val);
-			} else if (!strcasecmp(var, "rotate") && !switch_strlen_zero(val)) {
+			} else if (!strcasecmp(var, "rotate") && !zstr(val)) {
 				globals.rotate = switch_true(val);
 			} else if (!strcasecmp(var, "log-dir")) {
-				if (switch_strlen_zero(val)) {
+				if (zstr(val)) {
 					globals.base_log_dir = switch_mprintf("%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
 				} else {
 					if (switch_is_file_path(val)) {
@@ -511,7 +511,7 @@
 					}
 				}
 			} else if (!strcasecmp(var, "err-log-dir")) {
-				if (switch_strlen_zero(val)) {
+				if (zstr(val)) {
 					globals.base_err_log_dir = switch_mprintf("%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
 				} else {
 					if (switch_is_file_path(val)) {
@@ -536,8 +536,8 @@
 				globals.enable_ssl_verifyhost = 1;
 			}
 		
-			if (switch_strlen_zero(globals.base_err_log_dir)) {
-				if (!switch_strlen_zero(globals.base_log_dir)) {
+			if (zstr(globals.base_err_log_dir)) {
+				if (!zstr(globals.base_log_dir)) {
 					globals.base_err_log_dir = switch_core_strdup(globals.pool, globals.base_log_dir);
 				} else {
 					globals.base_err_log_dir = switch_core_sprintf(globals.pool, "%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (15210 => 15211)


--- freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -90,7 +90,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto usage;
 	}
 
@@ -217,7 +217,7 @@
 	config_data.max_bytes = XML_CURL_MAX_BYTES;
 
 	if ((config_data.fd = open(filename, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR)) > -1) {
-		if (!switch_strlen_zero(binding->cred)) {
+		if (!zstr(binding->cred)) {
 			curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, binding->auth_scheme);
 			curl_easy_setopt(curl_handle, CURLOPT_USERPWD, binding->cred);
 		}
@@ -508,7 +508,7 @@
 		}
 
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML Fetch Function [%s] [%s]\n",
-						  switch_strlen_zero(bname) ? "N/A" : bname, binding->url, binding->bindings ? binding->bindings : "all");
+						  zstr(bname) ? "N/A" : bname, binding->url, binding->bindings ? binding->bindings : "all");
 		switch_xml_bind_search_function(xml_url_fetch, switch_xml_parse_section_string(binding->bindings), binding);
 		x++;
 		binding = NULL;

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c (15210 => 15211)


--- freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -93,7 +93,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		goto usage;
 	}
 
@@ -466,7 +466,7 @@
 
 
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML Fetch Function [%s] (%s) [%s]\n",
-						  switch_strlen_zero(bname) ? "N/A" : bname, binding->basedn, binding->filter, binding->bindings ? binding->bindings : "all");
+						  zstr(bname) ? "N/A" : bname, binding->basedn, binding->filter, binding->bindings ? binding->bindings : "all");
 
 		switch_xml_bind_search_function(xml_ldap_search, switch_xml_parse_section_string(bname), binding);
 

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/mod_xml_ldapv2.c (15210 => 15211)


--- freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/mod_xml_ldapv2.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/mod_xml_ldapv2.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -257,7 +257,7 @@
 
 
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML Fetch Function [%s] (%s) [%s]\n",
-						  switch_strlen_zero(bname) ? "N/A" : bname, binding->basedn, binding->filter, binding->bindings ? binding->bindings : "all");
+						  zstr(bname) ? "N/A" : bname, binding->basedn, binding->filter, binding->bindings ? binding->bindings : "all");
 
 		switch_xml_bind_search_function(xml_ldap_search, switch_xml_parse_section_string(bname), binding);
 

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c (15210 => 15211)


--- freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -257,7 +257,7 @@
 		return FALSE;
 	}
 
-	if (switch_strlen_zero(globals.realm) && switch_strlen_zero(globals.user)) {
+	if (zstr(globals.realm) && zstr(globals.user)) {
 		return TRUE;
 	}
 
@@ -272,12 +272,12 @@
 		domain_name = dp;
 	}
 
-	if (!switch_strlen_zero(globals.realm) && !switch_strlen_zero(globals.user) && !strcmp(user, globals.user)) {
+	if (!zstr(globals.realm) && !zstr(globals.user) && !strcmp(user, globals.user)) {
 		switch_safe_free(user);
 		return TRUE;
 	}
 	
-	if (switch_strlen_zero(user) || switch_strlen_zero(domain_name)) {
+	if (zstr(user) || zstr(domain_name)) {
 		switch_safe_free(user);
 		return FALSE;
 	}
@@ -352,11 +352,11 @@
 					}
 				}
 
-				if (switch_strlen_zero(user) || switch_strlen_zero(domain_name)) {
+				if (zstr(user) || zstr(domain_name)) {
 					goto fail;
 				}
 
-				if (!switch_strlen_zero(globals.realm) && !switch_strlen_zero(globals.user) && !switch_strlen_zero(globals.pass)) {
+				if (!zstr(globals.realm) && !zstr(globals.user) && !zstr(globals.pass)) {
 					if (at) {
 						switch_snprintf(z, sizeof(z), "%s@%s:%s", globals.user, globals.realm, globals.pass);
 					} else {
@@ -374,7 +374,7 @@
 				}
 
 
-				if (!switch_strlen_zero(mypass2) && !strcasecmp(mypass2, "user-choose")) {
+				if (!zstr(mypass2) && !strcasecmp(mypass2, "user-choose")) {
 					mypass2 = NULL;
 				}
 
@@ -872,7 +872,7 @@
 		relative_oid = oid;
 	}
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		switch_copy_string(buf, data, sizeof(buf));
 	}
 

Modified: freeswitch/trunk/src/switch_caller.c (15210 => 15211)


--- freeswitch/trunk/src/switch_caller.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_caller.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -33,8 +33,8 @@
 #include <switch.h>
 #include <switch_caller.h>
 
-#define profile_dup(a,b,p) if (!switch_strlen_zero(a)) { b = switch_core_strdup(p, a); } else { b = SWITCH_BLANK_STRING; }
-#define profile_dup_clean(a,b,p) if (!switch_strlen_zero(a)) { b = switch_var_clean_string(switch_clean_string(switch_core_strdup(p, a)));} else { b = SWITCH_BLANK_STRING; }
+#define profile_dup(a,b,p) if (!zstr(a)) { b = switch_core_strdup(p, a); } else { b = SWITCH_BLANK_STRING; }
+#define profile_dup_clean(a,b,p) if (!zstr(a)) { b = switch_var_clean_string(switch_clean_string(switch_core_strdup(p, a)));} else { b = SWITCH_BLANK_STRING; }
 
 SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memory_pool_t *pool,
 																	const char *username,
@@ -57,11 +57,11 @@
 		context = "default";
 	}
 
-	if (switch_strlen_zero(caller_id_name)) {
+	if (zstr(caller_id_name)) {
 		caller_id_name = "FreeSWITCH";
 	}
 
-	if (switch_strlen_zero(caller_id_number)) {
+	if (zstr(caller_id_number)) {
 		caller_id_number = "0000000000";
 	}
 
@@ -247,59 +247,59 @@
 {
 	char header_name[1024];
 
-	if (!switch_strlen_zero(caller_profile->username)) {
+	if (!zstr(caller_profile->username)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Username", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->username);
 	}
-	if (!switch_strlen_zero(caller_profile->dialplan)) {
+	if (!zstr(caller_profile->dialplan)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Dialplan", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->dialplan);
 	}
-	if (!switch_strlen_zero(caller_profile->caller_id_name)) {
+	if (!zstr(caller_profile->caller_id_name)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Name", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->caller_id_name);
 	}
-	if (!switch_strlen_zero(caller_profile->caller_id_number)) {
+	if (!zstr(caller_profile->caller_id_number)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Number", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->caller_id_number);
 	}
-	if (!switch_strlen_zero(caller_profile->network_addr)) {
+	if (!zstr(caller_profile->network_addr)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Network-Addr", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->network_addr);
 	}
-	if (!switch_strlen_zero(caller_profile->ani)) {
+	if (!zstr(caller_profile->ani)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-ANI", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->ani);
 	}
-	if (!switch_strlen_zero(caller_profile->aniii)) {
+	if (!zstr(caller_profile->aniii)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-ANI-II", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->aniii);
 	}
-	if (!switch_strlen_zero(caller_profile->destination_number)) {
+	if (!zstr(caller_profile->destination_number)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Destination-Number", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->destination_number);
 	}
-	if (!switch_strlen_zero(caller_profile->uuid)) {
+	if (!zstr(caller_profile->uuid)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Unique-ID", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->uuid);
 	}
-	if (!switch_strlen_zero(caller_profile->source)) {
+	if (!zstr(caller_profile->source)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Source", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->source);
 	}
-	if (!switch_strlen_zero(caller_profile->context)) {
+	if (!zstr(caller_profile->context)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Context", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->context);
 	}
-	if (!switch_strlen_zero(caller_profile->rdnis)) {
+	if (!zstr(caller_profile->rdnis)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-RDNIS", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->rdnis);
 	}
-	if (!switch_strlen_zero(caller_profile->chan_name)) {
+	if (!zstr(caller_profile->chan_name)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Name", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->chan_name);
 	}
-	if (!switch_strlen_zero(caller_profile->profile_index)) {
+	if (!zstr(caller_profile->profile_index)) {
 		switch_snprintf(header_name, sizeof(header_name), "%s-Profile-Index", prefix);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->profile_index);
 	}

Modified: freeswitch/trunk/src/switch_channel.c (15210 => 15211)


--- freeswitch/trunk/src/switch_channel.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_channel.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -317,7 +317,7 @@
 	int i, argc;
 	char *argv[256];
 
-	if (switch_strlen_zero(dtmf_string)) {
+	if (zstr(dtmf_string)) {
 		return SWITCH_STATUS_FALSE;
 	}
 
@@ -536,7 +536,7 @@
 	const char *val = NULL, *r = NULL;
 	switch_assert(channel != NULL);
 	
-	if (!switch_strlen_zero(varname)) {
+	if (!zstr(varname)) {
 		if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
 			switch_core_session_t *session;
 			if ((session = switch_core_session_locate(uuid))) {
@@ -599,7 +599,7 @@
 	const char *old = NULL;
 
 	switch_assert(channel != NULL);
-	if (!switch_strlen_zero(channel->name)) {
+	if (!zstr(channel->name)) {
 		old = channel->name;
 	}
 	channel->name = NULL;
@@ -619,7 +619,7 @@
 SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel_t *channel)
 {
 	switch_assert(channel != NULL);
-	return (!switch_strlen_zero(channel->name)) ? channel->name : "N/A";
+	return (!zstr(channel->name)) ? channel->name : "N/A";
 }
 
 SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t *channel, const char *name, const char *val)
@@ -629,7 +629,7 @@
 
 	switch_mutex_lock(channel->profile_mutex);
 
-	if (!switch_strlen_zero(val)) {
+	if (!zstr(val)) {
 		v = switch_core_strdup(channel->caller_profile->pool, val);
 	} else {
 		v = SWITCH_BLANK_STRING;
@@ -689,9 +689,9 @@
 	switch_assert(channel != NULL);
 
 	switch_mutex_lock(channel->profile_mutex);
-	if (channel->variables && !switch_strlen_zero(varname)) {
+	if (channel->variables && !zstr(varname)) {
 		switch_event_del_header(channel->variables, varname);
-		if (!switch_strlen_zero(value)) {
+		if (!zstr(value)) {
 			int ok = 1;
 			
 			if (var_check) {
@@ -722,7 +722,7 @@
 	switch_assert(channel != NULL);
 
 	switch_mutex_lock(channel->profile_mutex);
-	if (channel->variables && !switch_strlen_zero(varname)) {
+	if (channel->variables && !zstr(varname)) {
 		switch_event_del_header(channel->variables, varname);
 
 		va_start(ap, fmt);
@@ -750,7 +750,7 @@
 	const char *uuid;
 	switch_assert(channel != NULL);
 
-	if (!switch_strlen_zero(varname)) {
+	if (!zstr(varname)) {
 		if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
 			switch_core_session_t *session;
 			if ((session = switch_core_session_locate(uuid))) {
@@ -2126,7 +2126,7 @@
 
 	switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ANSWER");
 	switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_channel_get_uuid(channel), SWITCH_LOG_NOTICE, "Channel [%s] has been answered\n", channel->name);
-	if ((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE)) && !switch_strlen_zero(var)) {
+	if ((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE)) && !zstr(var)) {
 		char *arg = NULL;
 
 		app = switch_core_session_strdup(channel->session, var);
@@ -2143,7 +2143,7 @@
 		}
 	}
 
-	if ((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE)) && !switch_strlen_zero(var)) {
+	if ((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE)) && !zstr(var)) {
 		switch_stream_handle_t stream = { 0 };
 		char *arg = NULL;
 
@@ -2214,7 +2214,7 @@
 	char *func_val = NULL;
 	int nv = 0;
 
-	if (switch_strlen_zero(in)) {
+	if (zstr(in)) {
 		return (char *) in;
 	}
 
@@ -2495,7 +2495,7 @@
 	prof_names[10] = "uuid";
 
 	for (x = 0; prof[x]; x++) {
-		if (switch_strlen_zero(prof[x])) {
+		if (zstr(prof[x])) {
 			continue;
 		}
 		new_len = (strlen(prof[x]) * 3) + 1;
@@ -2558,12 +2558,12 @@
 	switch_mutex_lock(channel->profile_mutex);
 	switch_mutex_lock(other_channel->profile_mutex);
 
-	if (!switch_strlen_zero(channel->caller_profile->callee_id_name)) {
+	if (!zstr(channel->caller_profile->callee_id_name)) {
 		other_channel->caller_profile->callee_id_name = switch_core_strdup(channel->caller_profile->pool, channel->caller_profile->callee_id_name);
 		x++;
 	}
 
-	if (!switch_strlen_zero(channel->caller_profile->callee_id_number)) {
+	if (!zstr(channel->caller_profile->callee_id_number)) {
 		other_channel->caller_profile->callee_id_number = switch_core_strdup(channel->caller_profile->pool, channel->caller_profile->callee_id_number);
 		x++;
 	}
@@ -2621,7 +2621,7 @@
 		ocp = switch_channel_get_originator_caller_profile(channel);
 	}
 
-	if (!switch_strlen_zero(caller_profile->caller_id_name)) {
+	if (!zstr(caller_profile->caller_id_name)) {
 		cid_buf = switch_core_session_sprintf(channel->session, "\"%s\" <%s>", caller_profile->caller_id_name,
 											  switch_str_nil(caller_profile->caller_id_number));
 	} else {

Modified: freeswitch/trunk/src/switch_console.c (15210 => 15211)


--- freeswitch/trunk/src/switch_console.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_console.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -464,7 +464,7 @@
 		line = el_gets(el, &count);
 
 		if (count > 1) {
-			if (!switch_strlen_zero(line)) {
+			if (!zstr(line)) {
 				char *cmd = strdup(line);
 				char *p;
 				const LineInfo *lf = el_line(el);
@@ -513,7 +513,7 @@
 
 	switch_copy_string(h->last, target, sizeof(h->last));
 
-	if (!switch_strlen_zero(target)) {
+	if (!zstr(target)) {
 		if ((++h->hits % 4) == 0) {
 			fprintf(h->out, "\n");
 		}

Modified: freeswitch/trunk/src/switch_core.c (15210 => 15211)


--- freeswitch/trunk/src/switch_core.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_core.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -957,7 +957,7 @@
 				const char *dft = switch_xml_attr(x_list, "default");
 				switch_bool_t default_type = SWITCH_TRUE;
 
-				if (switch_strlen_zero(name)) {
+				if (zstr(name)) {
 					continue;
 				}
 
@@ -1393,34 +1393,34 @@
 #endif
 				} else if (!strcasecmp(var, "colorize-console") && switch_true(val)) {
 					runtime.colorize_console = SWITCH_TRUE;
-				} else if (!strcasecmp(var, "mailer-app") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "mailer-app") && !zstr(val)) {
 					runtime.mailer_app = switch_core_strdup(runtime.memory_pool, val);
 				} else if (!strcasecmp(var, "mailer-app-args") && val) {
 					runtime.mailer_app_args = switch_core_strdup(runtime.memory_pool, val);
-				} else if (!strcasecmp(var, "sessions-per-second") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "sessions-per-second") && !zstr(val)) {
 					switch_core_sessions_per_second(atoi(val));
-				} else if (!strcasecmp(var, "max_dtmf_duration") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "max_dtmf_duration") && !zstr(val)) {
 					int tmp = atoi(val);
 					if (tmp > 0) {
 						switch_core_max_dtmf_duration((uint32_t) tmp);
 					}
-				} else if (!strcasecmp(var, "min_dtmf_duration") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "min_dtmf_duration") && !zstr(val)) {
 					int tmp = atoi(val);
 					if (tmp > 0) {
 						switch_core_min_dtmf_duration((uint32_t) tmp);
 					}
-				} else if (!strcasecmp(var, "default_dtmf_duration") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "default_dtmf_duration") && !zstr(val)) {
 					int tmp = atoi(val);
 					if (tmp > 0) {
 						switch_core_default_dtmf_duration((uint32_t) tmp);
 					}
 				} else if (!strcasecmp(var, "disable-monotonic-timing")) {
 					switch_time_set_monotonic(SWITCH_FALSE);
-				} else if (!strcasecmp(var, "max-sessions") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "max-sessions") && !zstr(val)) {
 					switch_core_session_limit(atoi(val));
-				} else if (!strcasecmp(var, "rtp-start-port") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "rtp-start-port") && !zstr(val)) {
 					switch_rtp_set_start_port((switch_port_t) atoi(val));
-				} else if (!strcasecmp(var, "rtp-end-port") && !switch_strlen_zero(val)) {
+				} else if (!strcasecmp(var, "rtp-end-port") && !zstr(val)) {
 					switch_rtp_set_end_port((switch_port_t) atoi(val));
 #ifdef ENABLE_ZRTP
 				} else if (!strcasecmp(var, "rtp-enable-zrtp")) {

Modified: freeswitch/trunk/src/switch_core_asr.c (15210 => 15211)


--- freeswitch/trunk/src/switch_core_asr.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_core_asr.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -96,7 +96,7 @@
 
 	switch_assert(ah != NULL);
 
-	if (switch_strlen_zero(grammar)) {
+	if (zstr(grammar)) {
 		status = SWITCH_STATUS_FALSE;
 		goto done;
 	}
@@ -111,7 +111,7 @@
 	while (data && *data == ' ') {
 		data++;
 	}
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		status = SWITCH_STATUS_FALSE;
 		goto done;
 	}
@@ -120,7 +120,7 @@
 	if (*data == '{') {
 		param_string = data + 1;
 		data = switch_find_end_paren(data, '{', '}');
-		if (switch_strlen_zero(data)) {
+		if (zstr(data)) {
 			status = SWITCH_STATUS_FALSE;
 			goto done;
 		} else {	
@@ -130,7 +130,7 @@
 	}
 
 	/* set ASR params */
-	if (!switch_strlen_zero(param_string)) {
+	if (!zstr(param_string)) {
 		char *param[256] = { 0 };
 		int i;
 		int argc = switch_separate_string(param_string, ',', param, (sizeof(param) / sizeof(param[0])));

Modified: freeswitch/trunk/src/switch_core_file.c (15210 => 15211)


--- freeswitch/trunk/src/switch_core_file.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_core_file.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -53,7 +53,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-	if (switch_strlen_zero(file_path)) {
+	if (zstr(file_path)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Filename\n");
 		return SWITCH_STATUS_FALSE;
 	}

Modified: freeswitch/trunk/src/switch_core_io.c (15210 => 15211)


--- freeswitch/trunk/src/switch_core_io.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_core_io.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -1182,7 +1182,7 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-	if (switch_strlen_zero(dtmf_string)) {
+	if (zstr(dtmf_string)) {
 		return SWITCH_STATUS_FALSE;
 	}
 

Modified: freeswitch/trunk/src/switch_core_memory.c (15210 => 15211)


--- freeswitch/trunk/src/switch_core_memory.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_core_memory.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -139,7 +139,7 @@
 		return NULL;
 	}
 
-	if (switch_strlen_zero(todup)) {
+	if (zstr(todup)) {
 		return SWITCH_BLANK_STRING;
 	}
 
@@ -235,7 +235,7 @@
 		return NULL;
 	}
 
-	if (switch_strlen_zero(todup)) {
+	if (zstr(todup)) {
 		return SWITCH_BLANK_STRING;
 	}
 
@@ -275,7 +275,7 @@
 		return NULL;
 	}
 
-	if (switch_strlen_zero(todup)) {
+	if (zstr(todup)) {
 		return SWITCH_BLANK_STRING;
 	}
 

Modified: freeswitch/trunk/src/switch_core_session.c (15210 => 15211)


--- freeswitch/trunk/src/switch_core_session.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_core_session.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -373,7 +373,7 @@
 		switch_assert(channel != NULL);
 
 		forwardvar = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
-		if (!switch_strlen_zero(forwardvar)) {
+		if (!zstr(forwardvar)) {
 			forwardval = atoi(forwardvar) - 1;
 		}
 		if (forwardval <= 0) {
@@ -1494,7 +1494,7 @@
 		char *myarg = NULL;
 		if (expanded) {
 			myarg = switch_mprintf("%s(%s)", app, expanded);
-		} else if (!switch_strlen_zero(arg)) {
+		} else if (!zstr(arg)) {
 			myarg = switch_mprintf("%s(%s)", app, arg);
 		} else {
 			myarg = switch_mprintf("%s", app);
@@ -1583,11 +1583,11 @@
 	new_profile = switch_caller_profile_clone(session, profile);
 	new_profile->destination_number = switch_core_strdup(new_profile->pool, exten);
 
-	if (!switch_strlen_zero(dialplan)) {
+	if (!zstr(dialplan)) {
 		new_profile->dialplan = switch_core_strdup(new_profile->pool, dialplan);
 	}
 
-	if (!switch_strlen_zero(context)) {
+	if (!zstr(context)) {
 		new_profile->context = switch_core_strdup(new_profile->pool, context);
 	}
 

Modified: freeswitch/trunk/src/switch_core_speech.c (15210 => 15211)


--- freeswitch/trunk/src/switch_core_speech.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_core_speech.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -45,7 +45,7 @@
 	char buf[256] = "";
 	char *param = NULL;
 
-	if (!sh || !flags || switch_strlen_zero(module_name)) {
+	if (!sh || !flags || zstr(module_name)) {
 		return SWITCH_STATUS_FALSE;
 	}
 
@@ -102,7 +102,7 @@
 
 	switch_assert(sh != NULL);
 
-	if (switch_strlen_zero(text)) {
+	if (zstr(text)) {
 		status = SWITCH_STATUS_FALSE;
 		goto done;
 	}
@@ -117,7 +117,7 @@
 	while (data && *data == ' ') {
 		data++;
 	}
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		status = SWITCH_STATUS_FALSE;
 		goto done;
 	}
@@ -126,7 +126,7 @@
 	if (*data == '{') {
 		param_string = data + 1;
 		data = switch_find_end_paren(data, '{', '}');
-		if (switch_strlen_zero(data)) {
+		if (zstr(data)) {
 			status = SWITCH_STATUS_FALSE;
 			goto done;
 		} else {
@@ -136,7 +136,7 @@
 	}
 
 	/* set TTS params */
-	if (!switch_strlen_zero(param_string)) {
+	if (!zstr(param_string)) {
 		char *param[256] = { 0 };
 		int i;
 		int argc = switch_separate_string(param_string, ',', param, (sizeof(param) / sizeof(param[0])));

Modified: freeswitch/trunk/src/switch_core_sqldb.c (15210 => 15211)


--- freeswitch/trunk/src/switch_core_sqldb.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_core_sqldb.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -316,7 +316,7 @@
 			char *state = switch_event_get_header_nil(event, "channel-state-number");
 			switch_channel_state_t state_i = CS_DESTROY;
 
-			if (!switch_strlen_zero(state)) {
+			if (!zstr(state)) {
 				state_i = atoi(state);
 			}
 
@@ -375,7 +375,7 @@
 			const char *syntax = switch_event_get_header_nil(event, "syntax");
 			const char *key = switch_event_get_header_nil(event, "key");
 			const char *filename = switch_event_get_header_nil(event, "filename");
-			if (!switch_strlen_zero(type) && !switch_strlen_zero(name)) {
+			if (!zstr(type) && !zstr(name)) {
 				sql =
 					switch_mprintf("insert into interfaces (type,name,description,syntax,key,filename) values('%q','%q','%q','%q','%q','%q')",
 								   type, name, switch_str_nil(description), switch_str_nil(syntax), switch_str_nil(key), switch_str_nil(filename)
@@ -387,7 +387,7 @@
 		{
 			const char *type = switch_event_get_header_nil(event, "type");
 			const char *name = switch_event_get_header_nil(event, "name");
-			if (!switch_strlen_zero(type) && !switch_strlen_zero(name)) {
+			if (!zstr(type) && !zstr(name)) {
 				sql = switch_mprintf("delete from interfaces where type='%q' and name='%q'", type, name);
 			}
 			break;
@@ -396,7 +396,7 @@
 		{
 			const char *type = switch_event_get_header_nil(event, "secure_type");
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Secure Type: %s\n", type);
-			if (switch_strlen_zero(type)) {
+			if (zstr(type)) {
 				break;
 			}
 			sql = switch_mprintf("update channels set secure='%s' where uuid='%s'",

Modified: freeswitch/trunk/src/switch_core_state_machine.c (15210 => 15211)


--- freeswitch/trunk/src/switch_core_state_machine.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_core_state_machine.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -85,7 +85,7 @@
 		char *dp[25];
 		int argc, x, count = 0;
 
-		if (!switch_strlen_zero(caller_profile->dialplan)) {
+		if (!zstr(caller_profile->dialplan)) {
 			if ((dpstr = switch_core_session_strdup(session, caller_profile->dialplan))) {
 				expanded = switch_channel_expand_variables(session->channel, dpstr);
 				argc = switch_separate_string(expanded, ',', dp, (sizeof(dp) / sizeof(dp[0])));
@@ -482,7 +482,7 @@
 		use_session = session;
 	}
 
-	if (!switch_strlen_zero(hook_var)) {
+	if (!zstr(hook_var)) {
 		switch_stream_handle_t stream = { 0 };
 		char *cmd = switch_core_session_strdup(session, hook_var);
 		char *arg = NULL;
@@ -552,7 +552,7 @@
 	driver_state_handler = endpoint_interface->state_handler;
 	switch_assert(driver_state_handler != NULL);
 	
-	if (!switch_strlen_zero(var)) {
+	if (!zstr(var)) {
 		if (!strcasecmp(var, "a_only")) {
 			if (switch_channel_get_originator_caller_profile(session->channel)) {
 				do_extra_handlers = 0;

Modified: freeswitch/trunk/src/switch_cpp.cpp (15210 => 15211)


--- freeswitch/trunk/src/switch_cpp.cpp	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_cpp.cpp	2009-10-23 16:03:42 UTC (rev 15211)
@@ -55,7 +55,7 @@
 	switch_name_event(event_name, &e_event_id);
 	switch_core_new_memory_pool(&pool);
 	
-	if (!switch_strlen_zero(subclass_name)) {
+	if (!zstr(subclass_name)) {
 		e_subclass_name = switch_core_strdup(pool, subclass_name);
 	} else {
 		e_subclass_name = NULL;
@@ -124,7 +124,7 @@
 	menu = NULL;
 	switch_core_new_memory_pool(&pool);
 	switch_assert(pool);
-	if (switch_strlen_zero(name)) {
+	if (zstr(name)) {
 		name = "no name";
 	}
 
@@ -227,7 +227,7 @@
 		event_id = SWITCH_EVENT_MESSAGE;
 	}
 
-	if (!switch_strlen_zero(subclass_name) && event_id != SWITCH_EVENT_CUSTOM) {
+	if (!zstr(subclass_name) && event_id != SWITCH_EVENT_CUSTOM) {
 		switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_WARNING, "Changing event type to custom because you specified a subclass name!\n");
 		event_id = SWITCH_EVENT_CUSTOM;
 	}
@@ -1204,7 +1204,7 @@
 	this_check(SWITCH_STATUS_FALSE);
 	sanity_check(SWITCH_STATUS_FALSE);
 	
-    if (switch_strlen_zero(result)) {
+    if (zstr(result)) {
 		return SWITCH_STATUS_SUCCESS;	
     }
 

Modified: freeswitch/trunk/src/switch_event.c (15210 => 15211)


--- freeswitch/trunk/src/switch_event.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_event.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -1071,7 +1071,7 @@
 		}
 	}
 
-	if (!switch_strlen_zero(data)) {
+	if (!zstr(data)) {
 		body = data;
 	} else if (event->body) {
 		body = event->body;
@@ -1606,7 +1606,7 @@
 
 
 	for (x = 0; prof[x]; x++) {
-		if (switch_strlen_zero(prof[x])) {
+		if (zstr(prof[x])) {
 			continue;
 		}
 		new_len = (strlen(prof[x]) * 3) + 1;

Modified: freeswitch/trunk/src/switch_ivr.c (15210 => 15211)


--- freeswitch/trunk/src/switch_ivr.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_ivr.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -463,7 +463,7 @@
 	char *event_lock = switch_event_get_header(event, "event-lock");
 	switch_status_t status = SWITCH_STATUS_FALSE;
 
-	if (switch_strlen_zero(cmd)) {
+	if (zstr(cmd)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Command!\n");
 		return SWITCH_STATUS_FALSE;
 	}
@@ -569,19 +569,19 @@
 		char *transport = switch_event_get_header(event, "transport");
 		char *flags = switch_event_get_header(event, "flags");
 
-		if (switch_strlen_zero(local_ip)) {
+		if (zstr(local_ip)) {
 			local_ip = "127.0.0.1";
 		}
-		if (switch_strlen_zero(remote_ip)) {
+		if (zstr(remote_ip)) {
 			remote_ip = "127.0.0.1";
 		}
-		if (switch_strlen_zero(local_port)) {
+		if (zstr(local_port)) {
 			local_port = "8025";
 		}
-		if (switch_strlen_zero(remote_port)) {
+		if (zstr(remote_port)) {
 			remote_port = "8026";
 		}
-		if (switch_strlen_zero(transport)) {
+		if (zstr(transport)) {
 			transport = "udp";
 		}
 
@@ -972,7 +972,7 @@
 		*terminator = '\0';
 	}
 
-	if (!switch_strlen_zero(terminators)) {
+	if (!zstr(terminators)) {
 		for (i = 0; i < x; i++) {
 			if (strchr(terminators, buf[i]) && terminator != NULL) {
 				*terminator = buf[i];
@@ -1038,7 +1038,7 @@
 					break;
 				}
 
-				if (!switch_strlen_zero(terminators) && strchr(terminators, dtmf.digit) && terminator != NULL) {
+				if (!zstr(terminators) && strchr(terminators, dtmf.digit) && terminator != NULL) {
 					*terminator = dtmf.digit;
 					return SWITCH_STATUS_SUCCESS;
 				}
@@ -1281,7 +1281,7 @@
 	const char *forwardvar = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
 	int forwardval = 70;
 
-	if (!switch_strlen_zero(forwardvar)) {
+	if (!zstr(forwardvar)) {
 		forwardval = atoi(forwardvar) - 1;
 	}
 	if (forwardval <= 0) {
@@ -1301,26 +1301,26 @@
 	if ((profile = switch_channel_get_caller_profile(channel))) {
 		const char *var;
 		
-		if (switch_strlen_zero(dialplan)) {
+		if (zstr(dialplan)) {
 			dialplan = profile->dialplan;
-			if (!switch_strlen_zero(dialplan) && !strcasecmp(dialplan, "inline")) {
+			if (!zstr(dialplan) && !strcasecmp(dialplan, "inline")) {
 				dialplan = NULL;
 			}
 		}
 
-		if (switch_strlen_zero(context)) {
+		if (zstr(context)) {
 			context = profile->context;
 		}
 
-		if (switch_strlen_zero(dialplan)) {
+		if (zstr(dialplan)) {
 			dialplan = "XML";
 		}
 
-		if (switch_strlen_zero(context)) {
+		if (zstr(context)) {
 			context = "default";
 		}
 
-		if (switch_strlen_zero(extension)) {
+		if (zstr(extension)) {
 			extension = "service";
 		}
 
@@ -1750,7 +1750,7 @@
 		return off;
 
 	for (; hi; hi = hi->next) {
-		if (!switch_strlen_zero(hi->name) && !switch_strlen_zero(hi->value) && ((variable = switch_xml_add_child_d(xml, hi->name, off++)))) {
+		if (!zstr(hi->name) && !zstr(hi->value) && ((variable = switch_xml_add_child_d(xml, hi->name, off++)))) {
 			char *data;
 			switch_size_t dlen = strlen(hi->value) * 3;
 
@@ -1815,11 +1815,11 @@
 			goto error;
 		}
 
-		if (!switch_strlen_zero(caller_profile->dialplan)) {
+		if (!zstr(caller_profile->dialplan)) {
 			switch_xml_set_attr_d(x_callflow, "dialplan", caller_profile->dialplan);
 		}
 
-		if (!switch_strlen_zero(caller_profile->profile_index)) {
+		if (!zstr(caller_profile->profile_index)) {
 			switch_xml_set_attr_d(x_callflow, "profile_index", caller_profile->profile_index);
 		}
 
@@ -2185,7 +2185,7 @@
 	char * prefix_buffer = NULL, *prefix;
 	size_t buffer_size =0;
 	size_t prefix_size=0;
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		goto error;
 	}
 
@@ -2208,7 +2208,7 @@
 
 	status = SWITCH_STATUS_SUCCESS;
 
-	if (!switch_strlen_zero(prefix)) {
+	if (!zstr(prefix)) {
 		prefix_size = strlen(prefix);
 		buffer_size = 1024 + prefix_size + 1;
 		prefix_buffer = switch_core_session_alloc(session, buffer_size);

Modified: freeswitch/trunk/src/switch_ivr_async.c (15210 => 15211)


--- freeswitch/trunk/src/switch_ivr_async.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_ivr_async.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -653,7 +653,7 @@
 		}
 
 
-		if (!switch_strlen_zero(require_group)) {
+		if (!zstr(require_group)) {
 			int argc, i;
 			int ok = 0;
 			char *argv[10] = { 0 };
@@ -1774,7 +1774,7 @@
     switch_core_session_get_read_impl(session, &read_impl);
 
 	
-	if (switch_strlen_zero(key)) {
+	if (zstr(key)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No Key Specified!\n");
 		return SWITCH_STATUS_FALSE;
 	}
@@ -1786,7 +1786,7 @@
 		}
 
 		for (i = 0; i < cont->index; i++) {
-			if (!switch_strlen_zero(cont->list[i].key) && !strcasecmp(key, cont->list[i].key)) {
+			if (!zstr(cont->list[i].key) && !strcasecmp(key, cont->list[i].key)) {
 				switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Re-enabling %s\n", key);
 				cont->list[i].up = 1;
 				cont->list[i].hits = 0;
@@ -1797,7 +1797,7 @@
 		}
 	}
 
-	if (switch_strlen_zero(tone_spec)) {
+	if (zstr(tone_spec)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No Spec Specified!\n");
 		return SWITCH_STATUS_FALSE;
 	}
@@ -1876,7 +1876,7 @@
 	}
 
 
-	if (switch_strlen_zero(flags)) {
+	if (zstr(flags)) {
 		bflags = SMBF_READ_REPLACE;
 	} else {
 		if (strchr(flags, 'o')) {
@@ -2117,7 +2117,7 @@
 		switch_core_event_hook_add_recv_dtmf(session, meta_on_dtmf);
 	}
 
-	if (!switch_strlen_zero(app)) {
+	if (!zstr(app)) {
 		if ((bind_flags & SBF_DIAL_ALEG)) {
 			md->sr[SWITCH_DTMF_RECV].up = 1;
 			md->sr[SWITCH_DTMF_RECV].map[key].app = switch_core_session_strdup(session, app);

Modified: freeswitch/trunk/src/switch_ivr_bridge.c (15210 => 15211)


--- freeswitch/trunk/src/switch_ivr_bridge.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_ivr_bridge.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -93,20 +93,20 @@
 		name = caller_profile->callee_id_name;
 		number = caller_profile->callee_id_number;
 		
-		if (switch_strlen_zero(name)) {
+		if (zstr(name)) {
 			name = caller_profile->destination_number;
 		}
-		if (switch_strlen_zero(number)) {
+		if (zstr(number)) {
 			number = caller_profile->destination_number;
 		}
 	} else {
 		name = caller_profile->caller_id_name;
 		number = caller_profile->caller_id_number;
 		
-		if (switch_strlen_zero(name)) {
+		if (zstr(name)) {
 			name = caller_profile->destination_number;
 		}
-		if (switch_strlen_zero(number)) {
+		if (zstr(number)) {
 			number = caller_profile->destination_number;
 		}
 	}
@@ -482,7 +482,7 @@
 		hook_var = switch_channel_get_variable(chan_a, SWITCH_API_BRIDGE_END_VARIABLE);
 	}
 
-	if (!switch_strlen_zero(hook_var)) {
+	if (!zstr(hook_var)) {
 		switch_stream_handle_t stream = { 0 };
 		char *cmd = switch_core_session_strdup(session_a, hook_var);
 		char *arg = NULL;
@@ -546,7 +546,7 @@
 
 	switch_channel_set_variable(switch_core_session_get_channel(session), SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE, NULL);
 
-	if (!switch_strlen_zero(where) && (mydata = switch_core_session_strdup(session, where))) {
+	if (!zstr(where) && (mydata = switch_core_session_strdup(session, where))) {
 		if ((argc = switch_separate_string(mydata, ':', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
 			switch_ivr_session_transfer(session, argv[0], argv[1], argv[2]);
 		} else {
@@ -787,7 +787,7 @@
         const char *sbv = switch_channel_get_variable(other_channel, SWITCH_SIGNAL_BRIDGE_VARIABLE);
 		const char *var;
 
-        if (!switch_strlen_zero(sbv) && !strcmp(sbv, switch_core_session_get_uuid(session))) {
+        if (!zstr(sbv) && !strcmp(sbv, switch_core_session_get_uuid(session))) {
 
             switch_channel_set_variable(other_channel, SWITCH_SIGNAL_BRIDGE_VARIABLE, NULL);
             switch_channel_set_variable(other_channel, SWITCH_BRIDGE_VARIABLE, NULL);
@@ -1147,7 +1147,7 @@
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Restore media to %s\n", switch_channel_get_name(channel));
 		switch_ivr_media(switch_core_session_get_uuid(session), SMF_IMMEDIATE);
 
-		if (!switch_strlen_zero(sbv) && (sbsession = switch_core_session_locate(sbv))) {
+		if (!zstr(sbv) && (sbsession = switch_core_session_locate(sbv))) {
 			switch_channel_t *sbchannel = switch_core_session_get_channel(sbsession);
 			switch_channel_hangup(sbchannel, SWITCH_CAUSE_ATTENDED_TRANSFER);
 			switch_core_session_rwunlock(sbsession);
@@ -1321,7 +1321,7 @@
 		}
 	}
 
-	if (switch_strlen_zero(uuid) || !(rsession = switch_core_session_locate(uuid))) {
+	if (zstr(uuid) || !(rsession = switch_core_session_locate(uuid))) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "no uuid %s\n", uuid);
 		return;
 	}

Modified: freeswitch/trunk/src/switch_ivr_menu.c (15210 => 15211)


--- freeswitch/trunk/src/switch_ivr_menu.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_ivr_menu.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -140,35 +140,35 @@
 		inter_timeout = timeout / 2;
 	}
 
-	if (!switch_strlen_zero(name)) {
+	if (!zstr(name)) {
 		menu->name = switch_core_strdup(menu->pool, name);
 	}
 
-	if (!switch_strlen_zero(greeting_sound)) {
+	if (!zstr(greeting_sound)) {
 		menu->greeting_sound = switch_core_strdup(menu->pool, greeting_sound);
 	}
 
-	if (!switch_strlen_zero(short_greeting_sound)) {
+	if (!zstr(short_greeting_sound)) {
 		menu->short_greeting_sound = switch_core_strdup(menu->pool, short_greeting_sound);
 	}
 
-	if (!switch_strlen_zero(invalid_sound)) {
+	if (!zstr(invalid_sound)) {
 		menu->invalid_sound = switch_core_strdup(menu->pool, invalid_sound);
 	}
 
-	if (!switch_strlen_zero(exit_sound)) {
+	if (!zstr(exit_sound)) {
 		menu->exit_sound = switch_core_strdup(menu->pool, exit_sound);
 	}
 
-	if (!switch_strlen_zero(confirm_macro)) {
+	if (!zstr(confirm_macro)) {
 		menu->confirm_macro = switch_core_strdup(menu->pool, confirm_macro);
 	}
 
-	if (!switch_strlen_zero(tts_engine)) {
+	if (!zstr(tts_engine)) {
 		menu->tts_engine = switch_core_strdup(menu->pool, tts_engine);
 	}
 
-	if (!switch_strlen_zero(tts_voice)) {
+	if (!zstr(tts_voice)) {
 		menu->tts_voice = switch_core_strdup(menu->pool, tts_voice);
 	}
 
@@ -294,7 +294,7 @@
 	char *sound_expanded = sound;
 	switch_size_t menu_buf_len = 0;
 
-	if (!session || !menu || switch_strlen_zero(sound)) {
+	if (!session || !menu || zstr(sound)) {
 		return status;
 	}
 
@@ -396,7 +396,7 @@
 		switch_goto_status(SWITCH_STATUS_FALSE, end);
 	}
 
-	if (!session || !stack || switch_strlen_zero(name)) {
+	if (!session || !stack || zstr(name)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid menu context\n");
 		switch_goto_status(SWITCH_STATUS_FALSE, end);
 	}
@@ -408,7 +408,7 @@
 		switch_goto_status(SWITCH_STATUS_FALSE, end);
 	}
 
-	if (!switch_strlen_zero(menu->tts_engine) && !switch_strlen_zero(menu->tts_voice)) {
+	if (!zstr(menu->tts_engine) && !zstr(menu->tts_voice)) {
 		switch_channel_set_variable(channel, "tts_engine", menu->tts_engine);
 		switch_channel_set_variable(channel, "tts_voice", menu->tts_voice);
 	}
@@ -456,7 +456,7 @@
 				char substituted[1024];
 				char *use_arg = ap->arg;
 
-				if (!switch_strlen_zero(menu->tts_engine) && !switch_strlen_zero(menu->tts_voice)) {
+				if (!zstr(menu->tts_engine) && !zstr(menu->tts_voice)) {
 					switch_channel_set_variable(channel, "tts_engine", menu->tts_engine);
 					switch_channel_set_variable(channel, "tts_voice", menu->tts_voice);
 				}
@@ -516,7 +516,7 @@
 
 							status = SWITCH_STATUS_FALSE;
 
-							if (!switch_strlen_zero(aptr)) {
+							if (!zstr(aptr)) {
 								app_name = switch_core_session_strdup(session, aptr);
 								if ((app_arg = strchr(app_name, ' '))) {
 									*app_arg++ = '\0';
@@ -579,7 +579,7 @@
 
 	if (stack->stack_count == 1) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "exit-sound '%s'\n", menu->exit_sound);
-		if (!switch_strlen_zero(menu->exit_sound)) {
+		if (!zstr(menu->exit_sound)) {
 			status = play_and_collect(session, menu, menu->exit_sound, 0);
 		}
 	}
@@ -669,7 +669,7 @@
 {
 	int i;
 
-	if (!switch_strlen_zero(action_name)) {
+	if (!zstr(action_name)) {
 		for(i = 0;;i++) {
 			if (!iam[i].name) {
 				break;
@@ -689,7 +689,7 @@
 {
 	int i;
 
-	if (!switch_strlen_zero(action)) {
+	if (!zstr(action)) {
 		for(i = 0;;i++) {
 			if (!iam[i].name) {
 				break;
@@ -770,7 +770,7 @@
 
 		switch_ivr_menu_t *menu = NULL;
 
-		if (switch_strlen_zero(max_timeouts)) {
+		if (zstr(max_timeouts)) {
 			max_timeouts = max_failures;
 		}
 
@@ -812,7 +812,7 @@
 				const char *digits = switch_xml_attr(xml_kvp, "digits");
 				const char *param = switch_xml_attr_soft(xml_kvp, "param");
 
-				if (is_valid_action(action) && !switch_strlen_zero(digits)) {
+				if (is_valid_action(action) && !zstr(digits)) {
 					switch_ivr_menu_xml_map_t *xml_map = xml_menu_ctx->map;
 					int found = 0;
 

Modified: freeswitch/trunk/src/switch_ivr_originate.c (15210 => 15211)


--- freeswitch/trunk/src/switch_ivr_originate.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_ivr_originate.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -409,7 +409,7 @@
 				
 				if (oglobals->monitor_early_media_fail) {
 					const char *var = switch_channel_get_variable(originate_status[i].peer_channel, "monitor_early_media_fail");
-					if (!switch_strlen_zero(var)) {
+					if (!zstr(var)) {
 						char *fail_array[128] = {0};
 						int fail_count = 0;
 						char *fail_data = strdup(var);
@@ -476,7 +476,7 @@
 				if (oglobals->monitor_early_media_ring) {
 					const char *var = switch_channel_get_variable(originate_status[i].peer_channel, "monitor_early_media_ring");
 					const char *var_total = switch_channel_get_variable(originate_status[i].peer_channel, "monitor_early_media_ring_total");
-					if (!switch_strlen_zero(var)) {
+					if (!zstr(var)) {
 						char *ring_array[128] = {0};
 						int ring_count = 0;
 						char *ring_data = strdup(var);
@@ -569,7 +569,7 @@
 				   && !switch_channel_test_flag(originate_status[i].peer_channel, CF_TAGGED)
 				   ) {
 			
-			if (!switch_strlen_zero(oglobals->key)) {
+			if (!zstr(oglobals->key)) {
 				struct key_collect *collect;
 
 				if (oglobals->cancel_timeout < 0) {
@@ -578,10 +578,10 @@
 
 				if ((collect = switch_core_session_alloc(originate_status[i].peer_session, sizeof(*collect)))) {
 					switch_channel_set_flag(originate_status[i].peer_channel, CF_TAGGED);
-					if (!switch_strlen_zero(oglobals->key)) {
+					if (!zstr(oglobals->key)) {
 						collect->key = switch_core_session_strdup(originate_status[i].peer_session, oglobals->key);
 					}
-					if (!switch_strlen_zero(oglobals->file)) {
+					if (!zstr(oglobals->file)) {
 						collect->file = switch_core_session_strdup(originate_status[i].peer_session, oglobals->file);
 					}
 					switch_channel_audio_sync(originate_status[i].peer_channel);
@@ -719,7 +719,7 @@
 
 		if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) || switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) {
 			ringback_data = NULL;
-		} else if (switch_strlen_zero(ringback_data)) {
+		} else if (zstr(ringback_data)) {
 			if ((var = switch_channel_get_variable(caller_channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE))) {
 				int sval = atoi(var);
 
@@ -1146,7 +1146,7 @@
 		data++;
 	}
 
-	if (switch_strlen_zero(data)) {
+	if (zstr(data)) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "No origination URL specified!\n");
 		status = SWITCH_STATUS_GENERR;
 		goto done;
@@ -1266,7 +1266,7 @@
 
 		if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) || switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) {
 			ringback_data = NULL;
-		} else if (switch_strlen_zero(ringback_data)) {
+		} else if (zstr(ringback_data)) {
 			const char *vvar;
 			
 			if ((vvar = switch_channel_get_variable(caller_channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE))) {
@@ -2209,19 +2209,19 @@
 					switch_core_session_t *holding_session;
 					
 					if (caller_channel) {
-						if (switch_strlen_zero(context)) {
+						if (zstr(context)) {
 							context = switch_channel_get_variable(caller_channel, "context"); 
 						}
-						if (switch_strlen_zero(dialplan)) {
+						if (zstr(dialplan)) {
 							dialplan = switch_channel_get_variable(caller_channel, "dialplan"); 
 						}
 					}
 					
-					if (switch_strlen_zero(context)) {
+					if (zstr(context)) {
 						context = "default";
 					}
 
-					if (switch_strlen_zero(context)) {
+					if (zstr(context)) {
 						dialplan = "XML";
 					}
 

Modified: freeswitch/trunk/src/switch_ivr_play_say.c (15210 => 15211)


--- freeswitch/trunk/src/switch_ivr_play_say.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_ivr_play_say.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -327,7 +327,7 @@
 						if (!my_tts_voice) {
 							my_tts_voice = tts_voice;
 						}
-						if (switch_strlen_zero(tts_engine) || switch_strlen_zero(tts_voice)) {
+						if (zstr(tts_engine) || zstr(tts_voice)) {
 							switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "TTS is not configured\n");
 						} else {
 							status = switch_ivr_speak_text(session, my_tts_engine, my_tts_voice, odata, args);
@@ -924,7 +924,7 @@
 	prefix = switch_channel_get_variable(channel, "sound_prefix");
 	timer_name = switch_channel_get_variable(channel, "timer_name");
 
-	if (switch_strlen_zero(file) || !switch_channel_media_ready(channel)) {
+	if (zstr(file) || !switch_channel_media_ready(channel)) {
 		return SWITCH_STATUS_FALSE;
 	}
 
@@ -982,21 +982,21 @@
 				dup = switch_core_session_strdup(session, alt);
 				engine = dup;
 
-				if (!switch_strlen_zero(engine)) {
+				if (!zstr(engine)) {
 					if ((voice = strchr(engine, ':'))) {
 						*voice++ = '\0';
-						if (!switch_strlen_zero(voice) && (text = strchr(voice, ':'))) {
+						if (!zstr(voice) && (text = strchr(voice, ':'))) {
 							*text++ = '\0';
 						}
 					}
 				}
 
-				if (!switch_strlen_zero(engine) && !switch_strlen_zero(voice) && !switch_strlen_zero(text)) {
+				if (!zstr(engine) && !zstr(voice) && !zstr(text)) {
 					if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) {
 						return status;
 					}
 					continue;
-				} else if (!switch_strlen_zero(engine) && !(voice && text)) {
+				} else if (!zstr(engine) && !(voice && text)) {
 					text = engine;
 					engine = (char *) switch_channel_get_variable(channel, "tts_engine");
 					voice = (char *) switch_channel_get_variable(channel, "tts_voice");
@@ -1639,7 +1639,7 @@
 	args.buf = digit_buffer;
 	args.buflen = (uint32_t) digit_buffer_length;
 
-	if (!switch_strlen_zero(prompt_audio_file) && strcasecmp(prompt_audio_file, "silence")) {
+	if (!zstr(prompt_audio_file) && strcasecmp(prompt_audio_file, "silence")) {
 		if ((status = switch_ivr_play_file(session, NULL, prompt_audio_file, &args)) == SWITCH_STATUS_BREAK) {
 			status = SWITCH_STATUS_SUCCESS;
 		}
@@ -1686,7 +1686,7 @@
 		*digit_buffer = '\0';
 	}
 
-	if (var_name && !switch_strlen_zero(digit_buffer)) {
+	if (var_name && !zstr(digit_buffer)) {
 		switch_channel_set_variable(channel, var_name, digit_buffer);
 	}
 
@@ -1721,8 +1721,8 @@
 		}
 
 		if (status == SWITCH_STATUS_SUCCESS) {
-			if (!switch_strlen_zero(digit_buffer)) {
-				if (switch_strlen_zero(digits_regex)) {
+			if (!zstr(digit_buffer)) {
+				if (zstr(digits_regex)) {
 					return SWITCH_STATUS_SUCCESS;
 				}
 				switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Test Regex [%s][%s]\n", digit_buffer, digits_regex);
@@ -2217,7 +2217,7 @@
 				moh = switch_channel_get_variable(other_channel, "hold_music");
 			}
 
-			if (!switch_strlen_zero(moh) && strcasecmp(moh, "silence") && !switch_channel_test_flag(other_channel, CF_BROADCAST)) {
+			if (!zstr(moh) && strcasecmp(moh, "silence") && !switch_channel_test_flag(other_channel, CF_BROADCAST)) {
 				switch_ivr_broadcast(other_uuid, moh, SMF_ECHO_ALEG | SMF_LOOP);
 				moh_br++;
 			}
@@ -2228,7 +2228,7 @@
 				moh = switch_channel_get_variable(channel, "hold_music");
 			}
 
-			if (!switch_strlen_zero(moh) && strcasecmp(moh, "silence")) {
+			if (!zstr(moh) && strcasecmp(moh, "silence")) {
 				switch_ivr_play_file(session, NULL, moh, &args);
 			} else {
 				switch_ivr_collect_digits_callback(session, &args, 0, 0);

Modified: freeswitch/trunk/src/switch_loadable_module.c (15210 => 15211)


--- freeswitch/trunk/src/switch_loadable_module.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_loadable_module.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -960,7 +960,7 @@
 {
 	switch_status_t status;  
 
-	if (switch_strlen_zero(mod)) {
+	if (zstr(mod)) {
 		return SWITCH_STATUS_FALSE;
 	}
 
@@ -1166,7 +1166,7 @@
 				switch_bool_t global = SWITCH_FALSE;
 				const char *val = switch_xml_attr_soft(ld, "module");
 				const char *sglobal = switch_xml_attr_soft(ld, "global");
-				if (switch_strlen_zero(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
+				if (zstr(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
 					continue;
 				}
@@ -1189,7 +1189,7 @@
 				switch_bool_t global = SWITCH_FALSE;
 				const char *val = switch_xml_attr_soft(ld, "module");
 				const char *sglobal = switch_xml_attr_soft(ld, "global");
-				if (switch_strlen_zero(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
+				if (zstr(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
 					continue;
 				}
@@ -1230,7 +1230,7 @@
 				continue;
 			}
 
-			if (switch_strlen_zero(fname) || (!strstr(fname, ext) && !strstr(fname, EXT))) {
+			if (zstr(fname) || (!strstr(fname, ext) && !strstr(fname, EXT))) {
 				continue;
 			}
 

Modified: freeswitch/trunk/src/switch_log.c (15210 => 15211)


--- freeswitch/trunk/src/switch_log.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_log.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -103,12 +103,12 @@
 	
 	*newnode = *node;
 	
-	if (!switch_strlen_zero(node->data)) {
+	if (!zstr(node->data)) {
 		newnode->data = strdup(node->data);	
 		switch_assert(node->data);
 	}
 	
-	if (!switch_strlen_zero(node->userdata)) {
+	if (!zstr(node->userdata)) {
 		newnode->userdata = strdup(node->userdata);
 		switch_assert(node->userdata);
 	}
@@ -398,7 +398,7 @@
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Log-Function", funcp);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Line", "%d", line);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Level", "%d", (int) level);
-			if (!switch_strlen_zero(userdata)) {
+			if (!zstr(userdata)) {
 				switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "User-Data", userdata);
 			}
 			switch_event_fire(&event);
@@ -458,7 +458,7 @@
 		node->content = content;
 		node->timestamp = now;
 		node->channel = channel;
-		node->userdata = !switch_strlen_zero(userdata) ? strdup(userdata) : NULL;
+		node->userdata = !zstr(userdata) ? strdup(userdata) : NULL;
 
 		if (switch_queue_trypush(LOG_QUEUE, node) != SWITCH_STATUS_SUCCESS) {
 			switch_log_node_free(&node);

Modified: freeswitch/trunk/src/switch_nat.c (15210 => 15211)


--- freeswitch/trunk/src/switch_nat.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_nat.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -69,7 +69,7 @@
 	if (UPNP_GetExternalIPAddress(nat_globals.urls.controlURL,
 								   nat_globals.data.servicetype,
 								   pub_addr) == UPNPCOMMAND_SUCCESS) {
-		if (!strcmp(pub_addr, "0.0.0.0") || switch_strlen_zero_buf(pub_addr)) {
+		if (!strcmp(pub_addr, "0.0.0.0") || zstr_buf(pub_addr)) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, 
 							  "uPNP Device (url: %s) returned an invalid external address of '%s'.  Disabling uPNP\n", nat_globals.urls.controlURL, pub_addr);
 			return SWITCH_STATUS_GENERR;

Modified: freeswitch/trunk/src/switch_odbc.c (15210 => 15211)


--- freeswitch/trunk/src/switch_odbc.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_odbc.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -524,7 +524,7 @@
 	
 	if (stmt) {
 		err_str = switch_odbc_handle_get_error(handle, stmt);
-		if (!switch_strlen_zero(err_str)) {
+		if (!zstr(err_str)) {
 			switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, switch_str_nil(err_str));
 		}
 		switch_safe_free(err_str);

Modified: freeswitch/trunk/src/switch_rtp.c (15210 => 15211)


--- freeswitch/trunk/src/switch_rtp.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_rtp.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -765,7 +765,7 @@
 
 	*err = NULL;
 
-	if (switch_strlen_zero(host) || !port) {
+	if (zstr(host) || !port) {
 		*err = "Address Error";
 		goto done;
 	}
@@ -869,7 +869,7 @@
 
 SWITCH_DECLARE(char *) switch_rtp_get_remote_host(switch_rtp_t *rtp_session)
 {
-	return switch_strlen_zero(rtp_session->remote_host_str) ? "0.0.0.0" : rtp_session->remote_host_str;
+	return zstr(rtp_session->remote_host_str) ? "0.0.0.0" : rtp_session->remote_host_str;
 }
 
 SWITCH_DECLARE(switch_port_t) switch_rtp_get_remote_port(switch_rtp_t *rtp_session)
@@ -1138,15 +1138,15 @@
 	switch_rtp_set_interval(rtp_session, ms_per_packet, samples_per_interval);
 	rtp_session->conf_samples_per_interval = samples_per_interval;
 
-	if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER) && switch_strlen_zero(timer_name)) {
+	if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER) && zstr(timer_name)) {
 		timer_name = "soft";
 	}
 
-	if (!switch_strlen_zero(timer_name) && !strcasecmp(timer_name, "none")) {
+	if (!zstr(timer_name) && !strcasecmp(timer_name, "none")) {
 		timer_name = NULL;
 	}
 
-	if (!switch_strlen_zero(timer_name)) {
+	if (!zstr(timer_name)) {
 		rtp_session->timer_name = switch_core_strdup(pool, timer_name);
 		switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
 		switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_NOBLOCK);
@@ -1229,7 +1229,7 @@
 {
 	switch_rtp_t *rtp_session = NULL;
 
-	if (switch_strlen_zero(rx_host)) {
+	if (zstr(rx_host)) {
 		*err = "Missing local host";
 		goto end;
 	}
@@ -1239,7 +1239,7 @@
 		goto end;
 	}
 
-	if (switch_strlen_zero(tx_host)) {
+	if (zstr(tx_host)) {
 		*err = "Missing remote host";
 		goto end;
 	}
@@ -1901,7 +1901,7 @@
 					const char *err;
 					uint32_t old = rtp_session->remote_port;
 					
-					if (!switch_strlen_zero(tx_host) && switch_sockaddr_get_port(rtp_session->from_addr) > 0) {
+					if (!zstr(tx_host) && switch_sockaddr_get_port(rtp_session->from_addr) > 0) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
 										  "Auto Changing port from %s:%u to %s:%u\n", old_host, old, tx_host,
 										  switch_sockaddr_get_port(rtp_session->from_addr));

Modified: freeswitch/trunk/src/switch_scheduler.c (15210 => 15211)


--- freeswitch/trunk/src/switch_scheduler.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_scheduler.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -263,7 +263,7 @@
 
 	switch_mutex_lock(globals.task_mutex);
 	for (tp = globals.task_list; tp; tp = tp->next) {
-		if (!switch_strlen_zero(group) && !strcmp(tp->task.group, group)) {
+		if (!zstr(group) && !strcmp(tp->task.group, group)) {
 			if (switch_test_flag(tp, SSHF_NO_DEL)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Attempt made to delete undeletable task #%u (group %s)\n",
 								  tp->task.task_id, group);

Modified: freeswitch/trunk/src/switch_swig.c (15210 => 15211)


--- freeswitch/trunk/src/switch_swig.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_swig.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -49,7 +49,7 @@
 	switch_status_t status;
 	const char *err = NULL;
 
-	if (switch_strlen_zero(path)) {
+	if (zstr(path)) {
 		path = NULL;
 	}
 

Modified: freeswitch/trunk/src/switch_time.c (15210 => 15211)


--- freeswitch/trunk/src/switch_time.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_time.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -640,11 +640,11 @@
 				const char *name = switch_xml_attr(x_list, "name");
 				const char *value= switch_xml_attr(x_list, "value");
 
-				if (switch_strlen_zero(name)) {
+				if (zstr(name)) {
 					continue;
 				}
 
-				if (switch_strlen_zero(value)) {
+				if (zstr(value)) {
 					continue;
 				}
 
@@ -683,7 +683,7 @@
 
 	timep =  (thetime) / (int64_t) (1000000);
 
-	if (!switch_strlen_zero(tz_name)) {
+	if (!zstr(tz_name)) {
 		tzdef = switch_lookup_timezone( tz_name );
 	} else {
 		/* We set the default timezone to GMT. */
@@ -719,7 +719,7 @@
 
 	timep =  (thetime) / (int64_t) (1000000);
 
-	if (!switch_strlen_zero(tz_name)) {
+	if (!zstr(tz_name)) {
 		tzdef = switch_lookup_timezone( tz_name );
 	} else {
 		/* We set the default timezone to GMT. */
@@ -730,8 +730,8 @@
 	if (tzdef) { /* The lookup of the zone may fail. */
 		tztime( &timep, tzdef, &tm );
 		tm2switchtime( &tm, &stm );
-		switch_strftime_nocheck(date, &retsize, len, switch_strlen_zero(format) ? "%Y-%m-%d %T" : format, &stm);
-		if (!switch_strlen_zero_buf(date)) {
+		switch_strftime_nocheck(date, &retsize, len, zstr(format) ? "%Y-%m-%d %T" : format, &stm);
+		if (!zstr_buf(date)) {
 			return SWITCH_STATUS_SUCCESS;
 		}
 	}

Modified: freeswitch/trunk/src/switch_utils.c (15210 => 15211)


--- freeswitch/trunk/src/switch_utils.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_utils.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -181,7 +181,7 @@
 	node->bits = bits;
 	node->str = switch_core_strdup(list->pool, cidr_str);
 
-	if (!switch_strlen_zero(token)) {
+	if (!zstr(token)) {
 		node->token = switch_core_strdup(list->pool, token);
 	}
 	
@@ -449,7 +449,7 @@
 	char *newfile = NULL;
 	switch_bool_t rval = SWITCH_FALSE;
 
-	if (!switch_strlen_zero(file) && !switch_strlen_zero(convert_cmd) && !switch_strlen_zero(convert_ext)) {
+	if (!zstr(file) && !zstr(convert_cmd) && !zstr(convert_ext)) {
 		if ((ext = strrchr(file, '.'))) {
 			dupfile = strdup(file);
 			if ((ext = strrchr(dupfile, '.'))) {
@@ -580,7 +580,7 @@
 		close(ifd);
 	}
 
-	if (switch_strlen_zero(from)) {
+	if (zstr(from)) {
 		from = "freeswitch";
 	}
 
@@ -617,7 +617,7 @@
 
 SWITCH_DECLARE(switch_bool_t) switch_is_lan_addr(const char *ip)
 {
-	if (switch_strlen_zero(ip))
+	if (zstr(ip))
 		return SWITCH_FALSE;
 
 	return (strncmp(ip, "10.", 3) &&
@@ -1824,7 +1824,7 @@
 	char *o;
 	unsigned int tmp;
 
-	if (switch_strlen_zero(s)) {
+	if (zstr(s)) {
 		return s;
 	}
 

Modified: freeswitch/trunk/src/switch_xml.c (15210 => 15211)


--- freeswitch/trunk/src/switch_xml.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_xml.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -1551,7 +1551,7 @@
 			const char *err = NULL;
 
 			err = switch_xml_error(xml);
-			if (switch_strlen_zero(err)) {
+			if (zstr(err)) {
 				if ((conf = switch_xml_find_child(xml, "section", "name", "result"))) {
 					switch_xml_t p;
 					const char *aname;
@@ -1890,7 +1890,7 @@
 		*err = switch_xml_error(new_main);
 		switch_copy_string(not_so_threadsafe_error_buffer, *err, sizeof(not_so_threadsafe_error_buffer));
 		*err = not_so_threadsafe_error_buffer;
-		if (!switch_strlen_zero(*err)) {
+		if (!zstr(*err)) {
 			switch_xml_free(new_main);
 			new_main = NULL;
 			errcnt++;

Modified: freeswitch/trunk/src/switch_xml_config.c (15210 => 15211)


--- freeswitch/trunk/src/switch_xml_config.c	2009-10-23 15:50:51 UTC (rev 15210)
+++ freeswitch/trunk/src/switch_xml_config.c	2009-10-23 16:03:42 UTC (rev 15211)
@@ -208,7 +208,7 @@
 					
 					/* Perform validation */
 					if (value) {
-						if (!switch_strlen_zero(string_options->validation_regex)) {
+						if (!zstr(string_options->validation_regex)) {
 							if (switch_regex_match(value, string_options->validation_regex) == SWITCH_STATUS_SUCCESS) {
 								newstring = value; /* Regex match, accept value*/
 							} else {