diff options
Diffstat (limited to 'channels/chan_mgcp.c')
-rwxr-xr-x | channels/chan_mgcp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 329c72da1..a560fd335 100755 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -905,7 +905,7 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout) ast_mutex_lock(&sub->lock); switch (p->hookstate) { case MGCP_OFFHOOK: - if (distinctive_ring && !ast_strlen_zero(distinctive_ring)) { + if (!ast_strlen_zero(distinctive_ring)) { snprintf(tone, sizeof(tone), "L/wt%s", distinctive_ring); if (mgcpdebug) { ast_verbose(VERBOSE_PREFIX_3 "MGCP distinctive callwait %s\n", tone); @@ -919,7 +919,7 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout) break; case MGCP_ONHOOK: default: - if (distinctive_ring && !ast_strlen_zero(distinctive_ring)) { + if (!ast_strlen_zero(distinctive_ring)) { snprintf(tone, sizeof(tone), "L/r%s", distinctive_ring); if (mgcpdebug) { ast_verbose(VERBOSE_PREFIX_3 "MGCP distinctive ring %s\n", tone); @@ -1801,7 +1801,7 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req) /* Scan through the RTP payload types specified in a "m=" line: */ ast_rtp_pt_clear(sub->rtp); codecs = ast_strdupa(m + len); - while (codecs && !ast_strlen_zero(codecs)) { + while (!ast_strlen_zero(codecs)) { if (sscanf(codecs, "%d%n", &codec, &len) != 1) { if (codec_count) break; @@ -3314,7 +3314,7 @@ static int mgcpsock_read(int *id, int fd, short events, void *ignore) /* Must have at least one header */ return 1; } - if (!req.identifier || ast_strlen_zero(req.identifier)) { + if (ast_strlen_zero(req.identifier)) { ast_log(LOG_NOTICE, "Message from %s missing identifier\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr)); return 1; } @@ -3356,9 +3356,9 @@ static int mgcpsock_read(int *id, int fd, short events, void *ignore) gw->name, ident); } } else { - if (!req.endpoint || ast_strlen_zero(req.endpoint) || - !req.version || ast_strlen_zero(req.version) || - !req.verb || ast_strlen_zero(req.verb)) { + if (ast_strlen_zero(req.endpoint) || + ast_strlen_zero(req.version) || + ast_strlen_zero(req.verb)) { ast_log(LOG_NOTICE, "Message must have a verb, an idenitifier, version, and endpoint\n"); return 1; } |