--- chan_sip.c-old 2004-05-08 11:50:49.000000000 -0400 +++ chan_sip.c 2004-05-08 12:29:30.000000000 -0400 @@ -1976,7 +1976,7 @@ *hostname = '\0'; hostname++; } - if (!username || ast_strlen_zero(username) || !hostname || !strlen(hostname)) { + if (!username || ast_strlen_zero(username) || !hostname || ast_strlen_zero(hostname)) { ast_log(LOG_WARNING, "Format for registration is user[:secret[:authuser]]@host[:port][/contact] at line %d", lineno); return -1; } @@ -3122,9 +3122,9 @@ l = p->fromuser; if ((ourport != 5060) && ast_strlen_zero(p->fromdomain)) - snprintf(from, sizeof(from), "\"%s\" ;tag=as%08x", n, l, strlen(p->fromdomain) ? p->fromdomain : inet_ntoa(p->ourip), ourport, p->tag); + snprintf(from, sizeof(from), "\"%s\" ;tag=as%08x", n, l, ast_strlen_zero(p->fromdomain) ? inet_ntoa(p->ourip) : p->fromdomain, ourport, p->tag); else - snprintf(from, sizeof(from), "\"%s\" ;tag=as%08x", n, l, strlen(p->fromdomain) ? p->fromdomain : inet_ntoa(p->ourip), p->tag); + snprintf(from, sizeof(from), "\"%s\" ;tag=as%08x", n, l, ast_strlen_zero(p->fromdomain) ? inet_ntoa(p->ourip) : p->fromdomain, p->tag); if (!ast_strlen_zero(p->username)) { if (ntohs(p->sa.sin_port) != DEFAULT_SIP_PORT) { @@ -4754,8 +4754,8 @@ if (peer) { ast_cli(fd,"\n\n"); ast_cli(fd, " * Name : %s\n", peer->name); - ast_cli(fd, " Secret : %s\n", strlen(peer->secret)?"":""); - ast_cli(fd, " MD5Secret : %s\n", strlen(peer->md5secret)?"":""); + ast_cli(fd, " Secret : %s\n", ast_strlen_zero(peer->secret)?"":""); + ast_cli(fd, " MD5Secret : %s\n", ast_strlen_zero(peer->md5secret)?"":""); ast_cli(fd, " Context : %s\n", peer->context); ast_cli(fd, " Methods : %s\n", peer->methods); ast_cli(fd, " Language : %s\n", peer->language); @@ -4994,7 +4994,7 @@ if (!strcasecmp(get_header(req, "Content-Type"), "application/dtmf-relay")) { /* Try getting the "signal=" part */ - if (strlen(c = get_sdp(req, "Signal")) || strlen(c = get_sdp(req, "d"))) { + if (ast_strlen_zero(c = get_sdp(req, "Signal")) && ast_strlen_zero(c = get_sdp(req, "d"))) { strncpy(buf, c, sizeof(buf) - 1); } else { ast_log(LOG_WARNING, "Unable to retrieve DTMF signal from INFO message from %s\n", p->callid);