Revision
15385
Author
anthm
Date
2009-11-06 10:00:56 -0600 (Fri, 06 Nov 2009)

Log Message

change zstr to inline and fix small display update

Modified Paths

Diff

Modified: freeswitch/trunk/src/include/switch_utils.h (15384 => 15385)


--- freeswitch/trunk/src/include/switch_utils.h	2009-11-06 15:58:08 UTC (rev 15384)
+++ freeswitch/trunk/src/include/switch_utils.h	2009-11-06 16:00:56 UTC (rev 15385)
@@ -74,7 +74,10 @@
   \param s the string to test
   \return true value if the string is NULL or zero length
 */
-#define zstr(s) (!s || *(s) == '\0')
+static inline int zstr(const char *s) {
+	return (!s || *(s) == '\0');
+}
+
 #define zstr_buf(s) (*(s) == '\0')
 static inline switch_bool_t switch_is_moh(const char *s)
 {

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


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-11-06 15:58:08 UTC (rev 15384)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-11-06 16:00:56 UTC (rev 15385)
@@ -467,21 +467,21 @@
 		}
 	}
 
-	if ((tmp = switch_channel_get_variable(channel, "effective_callee_id_name")) ||
+	if (((tmp = switch_channel_get_variable(channel, "effective_callee_id_name")) ||
 		(tmp = switch_channel_get_variable(channel, "sip_callee_id_name")) ||
-		(tmp = switch_channel_get_variable(channel, "callee_id_name"))) {
+		 (tmp = switch_channel_get_variable(channel, "callee_id_name"))) && !zstr(tmp)) {
 		name = (char *)tmp;
 	}
 
-	if ((tmp = switch_channel_get_variable(channel, "effective_callee_id_number")) ||
+	if (((tmp = switch_channel_get_variable(channel, "effective_callee_id_number")) ||
 		(tmp = switch_channel_get_variable(channel, "sip_callee_id_number")) ||
-		(tmp = switch_channel_get_variable(channel, "callee_id_number"))) {
+		 (tmp = switch_channel_get_variable(channel, "callee_id_number"))) && !zstr(tmp)) {
 		number = tmp;
 	}
 
 	if (zstr(name)) name = (char *) number;
 
-	if (zstr(name) || zstr(number)) {
+	if (zstr(name) && zstr(number)) {
 		goto end;
 	}
 
@@ -507,7 +507,7 @@
 		sofia_send_callee_id(session, NULL, NULL);
 	}
 
- end:
+	end:
 	switch_safe_free(dup);
 }