mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@6866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user