aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-27 02:19:37 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-27 02:19:37 +0000
commitee234bbb3efea571ea7ad138de22f1e010b92ec9 (patch)
tree9f24232bc60be91cb9017aab391d2eff0f4a6341 /channels/chan_mgcp.c
parent4cc87ee6e1e0ad07889f178b9c843fdd55d826e8 (diff)
Remove unnecessary checks before calls to ast_strlen_zero. Also, change
some places where strlen is used instead of ast_strlen_zero git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6866 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rwxr-xr-xchannels/chan_mgcp.c14
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;
}