提交 e6e5f610 authored 作者: Anthony Minessale's avatar Anthony Minessale

change zstr to inline and fix small display update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15385 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 b6b7dd26
...@@ -74,7 +74,10 @@ SWITCH_DECLARE(int) switch_isxdigit(int c); ...@@ -74,7 +74,10 @@ SWITCH_DECLARE(int) switch_isxdigit(int c);
\param s the string to test \param s the string to test
\return true value if the string is NULL or zero length \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') #define zstr_buf(s) (*(s) == '\0')
static inline switch_bool_t switch_is_moh(const char *s) static inline switch_bool_t switch_is_moh(const char *s)
{ {
......
...@@ -467,21 +467,21 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro ...@@ -467,21 +467,21 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
} }
} }
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, "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; 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, "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; number = tmp;
} }
if (zstr(name)) name = (char *) number; if (zstr(name)) name = (char *) number;
if (zstr(name) || zstr(number)) { if (zstr(name) && zstr(number)) {
goto end; goto end;
} }
...@@ -507,7 +507,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro ...@@ -507,7 +507,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
sofia_send_callee_id(session, NULL, NULL); sofia_send_callee_id(session, NULL, NULL);
} }
end: end:
switch_safe_free(dup); switch_safe_free(dup);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论