char buf[AST_MAX_BUF];
/* if there is no Caller ID, nothing to do */
- if (!callerid || ast_strlen_zero(callerid))
+ if (ast_strlen_zero(callerid))
return;
snprintf(buf, sizeof(buf), "%s_%s",GETAGENTBYCALLERID, callerid);
char *talkingtoChan = NULL;
char *status = NULL;
- if (id && !ast_strlen_zero(id))
+ if (!ast_strlen_zero(id))
snprintf(idText, sizeof(idText) ,"ActionID: %s\r\n", id);
astman_send_ack(s, m, "Agents will follow");
ast_mutex_lock(&agentlock);
int soft;
int ret; /* return value of agent_logoff */
- if (!agent || ast_strlen_zero(agent)) {
+ if (ast_strlen_zero(agent)) {
astman_send_error(s, m, "No agent specified");
return 0;
}
strsep(&options, "|");
}
- while (options && !ast_strlen_zero(options)) {
+ while (!ast_strlen_zero(options)) {
if (*options == 's') {
play_announcement = 0;
break;
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
if (!res) {
- if (opt_user && !ast_strlen_zero(opt_user))
+ if (!ast_strlen_zero(opt_user))
ast_copy_string(user, opt_user, AST_MAX_AGENT);
else
res = ast_app_getdata(chan, "agent-user", user, sizeof(user) - 1, 0);
res = 0;
} else
res = ast_app_getdata(chan, "agent-newlocation", tmpchan+pos, sizeof(tmpchan) - 2, 0);
- if (ast_strlen_zero(tmpchan) || ast_exists_extension(chan, context && !ast_strlen_zero(context) ? context : "default", tmpchan,
+ if (ast_strlen_zero(tmpchan) || ast_exists_extension(chan, !ast_strlen_zero(context) ? context : "default", tmpchan,
1, NULL))
break;
if (exten) {
exten = NULL;
pos = 0;
} else {
- ast_log(LOG_WARNING, "Extension '%s@%s' is not valid for automatic login of agent '%s'\n", tmpchan, context && !ast_strlen_zero(context) ? context : "default", p->agent);
+ ast_log(LOG_WARNING, "Extension '%s@%s' is not valid for automatic login of agent '%s'\n", tmpchan, !ast_strlen_zero(context) ? context : "default", p->agent);
res = ast_streamfile(chan, "invalid", chan->language);
if (!res)
res = ast_waitstream(chan, AST_DIGIT_ANY);
exten = tmpchan;
if (!res) {
set_agentbycallerid(p->logincallerid, NULL);
- if (context && !ast_strlen_zero(context) && !ast_strlen_zero(tmpchan))
+ if (!ast_strlen_zero(context) && !ast_strlen_zero(tmpchan))
snprintf(p->loginchan, sizeof(p->loginchan), "%s@%s", tmpchan, context);
else {
ast_copy_string(last_loginchan, p->loginchan, sizeof(last_loginchan));
else
snprintf(p->loginchan, sizeof(p->loginchan), "%s@%s", exten, context);
- if (wrapuptime_s && !ast_strlen_zero(wrapuptime_s)) {
+ if (!ast_strlen_zero(wrapuptime_s)) {
p->wrapuptime = atoi(wrapuptime_s);
if (p->wrapuptime < 0)
p->wrapuptime = 0;
tmp->readformat = AST_FORMAT_SLINEAR;
tmp->writeformat = AST_FORMAT_SLINEAR;
tmp->tech_pvt = p;
- if (strlen(p->context))
- strncpy(tmp->context, p->context, sizeof(tmp->context)-1);
- if (strlen(p->exten))
- strncpy(tmp->exten, p->exten, sizeof(tmp->exten)-1);
- if (strlen(language))
- strncpy(tmp->language, language, sizeof(tmp->language)-1);
+ if (!ast_strlen_zero(p->context))
+ ast_copy_string(tmp->context, p->context, sizeof(tmp->context));
+ if (!ast_strlen_zero(p->exten))
+ ast_copy_string(tmp->exten, p->exten, sizeof(tmp->exten));
+ if (!ast_strlen_zero(language))
+ ast_copy_string(tmp->language, language, sizeof(tmp->language));
p->owner = tmp;
ast_setstate(tmp, state);
ast_mutex_lock(&usecnt_lock);
#endif
switch(state) {
case 0:
- if (strlen(word) && !strncasecmp(word, "on", MIN(strlen(word), 2)))
+ if (!ast_strlen_zero(word) && !strncasecmp(word, "on", MIN(strlen(word), 2)))
return strdup("on");
case 1:
- if (strlen(word) && !strncasecmp(word, "off", MIN(strlen(word), 3)))
+ if (!ast_strlen_zero(word) && !strncasecmp(word, "off", MIN(strlen(word), 3)))
return strdup("off");
default:
return NULL;
stringp=tmp;
strsep(&stringp, "@");
tmp2 = strsep(&stringp, "@");
- if (strlen(tmp))
+ if (!ast_strlen_zero(tmp))
mye = tmp;
- if (tmp2 && strlen(tmp2))
+ if (!ast_strlen_zero(tmp2))
myc = tmp2;
}
if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
}
if (!ast_strlen_zero(pvt->cid_num)) {
ch->cid.cid_num = strdup(pvt->cid_num);
- } else if (pvt->cd.call_source_e164 && !ast_strlen_zero(pvt->cd.call_source_e164)) {
+ } else if (!ast_strlen_zero(pvt->cd.call_source_e164)) {
ch->cid.cid_num = strdup(pvt->cd.call_source_e164);
}
if (!ast_strlen_zero(pvt->cid_name)) {
ch->cid.cid_name = strdup(pvt->cid_name);
- } else if (pvt->cd.call_source_e164 && !ast_strlen_zero(pvt->cd.call_source_name)) {
+ } else if (!ast_strlen_zero(pvt->cd.call_source_name)) {
ch->cid.cid_name = strdup(pvt->cd.call_source_name);
}
if (!ast_strlen_zero(pvt->rdnis)) {
ext = NULL;
}
strtok_r(host, "/", &(h323id));
- if (h323id && !ast_strlen_zero(h323id)) {
+ if (!ast_strlen_zero(h323id)) {
h323_set_id(h323id);
}
if (ext) {
{
int res = 0;
struct iax_firmware *cur;
- if (dev && !ast_strlen_zero(dev)) {
+ if (!ast_strlen_zero(dev)) {
ast_mutex_lock(&waresl.lock);
cur = waresl.wares;
while(cur) {
unsigned int start = (desc >> 8) & 0xffffff;
unsigned int bytes;
struct iax_firmware *cur;
- if (dev && !ast_strlen_zero((char *)dev) && bs) {
+ if (!ast_strlen_zero((char *)dev) && bs) {
start *= bs;
ast_mutex_lock(&waresl.lock);
cur = waresl.wares;
*/
static void parse_dial_string(char *data, struct parsed_dial_string *pds)
{
- if (!data || ast_strlen_zero(data))
+ if (ast_strlen_zero(data))
return;
pds->peer = strsep(&data, "/");
if (ast_test_flag(iaxs[callno], IAX_SENDANI) && c->cid.cid_ani)
iax_ie_append_str(&ied, IAX_IE_CALLING_ANI, c->cid.cid_ani);
- if (c->language && !ast_strlen_zero(c->language))
+ if (!ast_strlen_zero(c->language))
iax_ie_append_str(&ied, IAX_IE_LANGUAGE, c->language);
- if (c->cid.cid_dnid && !ast_strlen_zero(c->cid.cid_dnid))
+ if (!ast_strlen_zero(c->cid.cid_dnid))
iax_ie_append_str(&ied, IAX_IE_DNID, c->cid.cid_dnid);
if (pds.context)
int ret;
char *id;
id = astman_get_header(m,"ActionID");
- if (id && !ast_strlen_zero(id))
+ if (!ast_strlen_zero(id))
ast_cli(s->fd, "ActionID: %s\r\n",id);
ret = __iax2_show_peers(1, s->fd, 3, a );
ast_cli(s->fd, "\r\n\r\n" );
int res = -1;
int x;
char iabuf[INET_ADDRSTRLEN];
- if (keyn && !ast_strlen_zero(keyn)) {
+ if (!ast_strlen_zero(keyn)) {
if (!(authmethods & IAX_AUTH_RSA)) {
- if (!secret || ast_strlen_zero(secret))
+ if (ast_strlen_zero(secret))
ast_log(LOG_NOTICE, "Asked to authenticate to %s with an RSA key, but they don't allow RSA authentication\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr));
} else if (ast_strlen_zero(challenge)) {
ast_log(LOG_NOTICE, "No challenge provided for RSA authentication to %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr));
}
}
/* Fall back */
- if (res && secret && !ast_strlen_zero(secret)) {
+ if (res && !ast_strlen_zero(secret)) {
if ((authmethods & IAX_AUTH_MD5) && !ast_strlen_zero(challenge)) {
struct MD5Context md5;
unsigned char digest[16];
p->encmethods = 0;
/* Check for override RSA authentication first */
- if ((override && !ast_strlen_zero(override)) || (okey && !ast_strlen_zero(okey))) {
+ if (!ast_strlen_zero(override) || !ast_strlen_zero(okey)) {
/* Normal password authentication */
res = authenticate(p->challenge, override, okey, authmethods, &ied, sin, &p->ecx, &p->dcx);
} else {
int force =0;
unsigned short callno = PTR_TO_CALLNO(chan->tech_pvt);
char iabuf[INET_ADDRSTRLEN];
- if (!data || ast_strlen_zero(data))
+ if (ast_strlen_zero(data))
data = "default";
sdata = ast_strdupa(data);
opts = strchr(sdata, '|');
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);
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);
/* 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;
/* 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;
}
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;
}
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
- if (strlen(i->language))
+ if (!ast_strlen_zero(i->language))
strncpy(tmp->language,i->language, sizeof(tmp->language)-1);
- if (strlen(i->dnid))
+ if (!ast_strlen_zero(i->dnid))
strncpy(tmp->exten, i->dnid, sizeof(tmp->exten) - 1);
i->owner = tmp;
ast_mutex_lock(&usecnt_lock);
#include "asterisk/callerid.h"
#include "asterisk/ulaw.h"
#include "asterisk/pbx.h"
+#include "asterisk/utils.h"
#define STATE_COMMAND 0
#define STATE_VOICE 1
ast_log(LOG_WARNING, "Unable to set to voice mode\n");
return -1;
}
- if (strlen(p->msn)) {
+ if (!ast_strlen_zero(p->msn)) {
snprintf(cmd, sizeof(cmd), "AT&E%s", p->msn);
if (ast_modem_send(p, cmd, 0) ||
ast_modem_expect(p, "OK", 5)) {
return -1;
}
}
- if (strlen(p->incomingmsn)) {
+ if (!ast_strlen_zero(p->incomingmsn)) {
char *q;
snprintf(cmd, sizeof(cmd), "AT&L%s", p->incomingmsn);
/* translate , into ; since that is the seperator I4L uses, but can't be directly */
/* Find callerid number first, to set the correct A number */
if (c && c->cid.cid_num && !(c->cid.cid_pres & 0x20)) {
snprintf(tmpmsn, sizeof(tmpmsn), ",%s,", c->cid.cid_num);
- if(strlen(p->outgoingmsn) && strstr(p->outgoingmsn,tmpmsn) != NULL) {
+ if(!ast_strlen_zero(p->outgoingmsn) && strstr(p->outgoingmsn,tmpmsn) != NULL) {
/* Tell ISDN4Linux to use this as A number */
snprintf(cmd, sizeof(cmd), "AT&E%s\n", c->cid.cid_num);
if (ast_modem_send(p, cmd, strlen(cmd))) {
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/options.h"
+#include "asterisk/utils.h"
static const char desc[] = "Network Broadcast Sound Support";
static const char type[] = "NBS";
p = malloc(sizeof(struct nbs_pvt));
if (p) {
memset(p, 0, sizeof(struct nbs_pvt));
- if (strlen(opts)) {
+ if (!ast_strlen_zero(opts)) {
if (strchr(opts, 'm'))
flags |= NBS_FLAG_MUTE;
if (strchr(opts, 'o'))
c->writeformat = AST_FORMAT_SLINEAR;
c->tech_pvt = o;
- if (ctx && !ast_strlen_zero(ctx))
+ if (!ast_strlen_zero(ctx))
ast_copy_string(c->context, ctx, sizeof(c->context));
- if (ext && !ast_strlen_zero(ext))
+ if (!ast_strlen_zero(ext))
ast_copy_string(c->exten, ext, sizeof(c->exten));
- if (o->language && !ast_strlen_zero(o->language))
+ if (!ast_strlen_zero(o->language))
ast_copy_string(c->language, o->language, sizeof(c->language));
o->owner = c;
tmp->readformat = AST_FORMAT_SLINEAR;
tmp->writeformat = AST_FORMAT_SLINEAR;
tmp->tech_pvt = p;
- if (strlen(p->context))
+ if (!ast_strlen_zero(p->context))
strncpy(tmp->context, p->context, sizeof(tmp->context)-1);
- if (strlen(p->exten))
+ if (!ast_strlen_zero(p->exten))
strncpy(tmp->exten, p->exten, sizeof(tmp->exten)-1);
- if (strlen(language))
+ if (!ast_strlen_zero(language))
strncpy(tmp->language, language, sizeof(tmp->language)-1);
p->owner = tmp;
ast_setstate(tmp, state);
#endif
switch(state) {
case 0:
- if (strlen(word) && !strncasecmp(word, "on", MIN(strlen(word), 2)))
+ if (!ast_strlen_zero(word) && !strncasecmp(word, "on", MIN(strlen(word), 2)))
return strdup("on");
case 1:
- if (strlen(word) && !strncasecmp(word, "off", MIN(strlen(word), 3)))
+ if (!ast_strlen_zero(word) && !strncasecmp(word, "off", MIN(strlen(word), 3)))
return strdup("off");
default:
return NULL;
ast_cli(fd, "No one is calling us\n");
return RESULT_FAILURE;
}
- if (strlen(text2send))
+ if (!ast_strlen_zero(text2send))
ast_cli(fd, "Warning: message already waiting to be sent, overwriting\n");
text2send[0] = '\0';
while(tmparg < argc) {
strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1);
strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1);
}
- if (strlen(text2send)) {
+ if (!ast_strlen_zero(text2send)) {
f.frametype = AST_FRAME_TEXT;
f.subclass = 0;
f.data = text2send;
stringp=tmp;
strsep(&stringp, "@");
tmp2 = strsep(&stringp, "@");
- if (strlen(tmp))
+ if (!ast_strlen_zero(tmp))
mye = tmp;
- if (tmp2 && strlen(tmp2))
+ if (!ast_strlen_zero(tmp2))
myc = tmp2;
}
if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
snprintf(cid.min, sizeof(cid.min), "%02d", tm.tm_min);
}
/* the standard format of ast->callerid is: "name" <number>, but not always complete */
- if (!ast->cid.cid_name || ast_strlen_zero(ast->cid.cid_name))
+ if (ast_strlen_zero(ast->cid.cid_name))
strncpy(cid.name, DEFAULT_CALLER_ID, sizeof(cid.name) - 1);
else
strncpy(cid.name, ast->cid.cid_name, sizeof(cid.name) - 1);
tmp->rings = 1;
tmp->tech_pvt = i;
strncpy(tmp->context, context, sizeof(tmp->context)-1);
- if (strlen(i->ext))
+ if (!ast_strlen_zero(i->ext))
strncpy(tmp->exten, i->ext, sizeof(tmp->exten)-1);
else
strncpy(tmp->exten, "s", sizeof(tmp->exten) - 1);
- if (strlen(i->language))
+ if (!ast_strlen_zero(i->language))
strncpy(tmp->language, i->language, sizeof(tmp->language)-1);
if (!ast_strlen_zero(i->cid_num))
tmp->cid.cid_num = strdup(i->cid_num);
{
int i, res = 0;
- if (!msg || ast_strlen_zero(msg))
+ if (ast_strlen_zero(msg))
return 0;
for (i = 1; (i < (sizeof(sip_methods) / sizeof(sip_methods[0]))) && !res; i++) {
int i;
unsigned int profile = 0;
- if (!supported || ast_strlen_zero(supported) )
+ if (ast_strlen_zero(supported) )
return 0;
if (option_debug > 2 && sipdebug)
ast_verbose("Sending text %s on %s\n", text, ast->name);
if (!p)
return -1;
- if (!text || ast_strlen_zero(text))
+ if (ast_strlen_zero(text))
return 0;
if (debug)
ast_verbose("Really sending text %s on %s\n", text, ast->name);
*hostname = '\0';
hostname++;
}
- if (!username || ast_strlen_zero(username) || !hostname || ast_strlen_zero(hostname)) {
+ if (ast_strlen_zero(username) || ast_strlen_zero(hostname)) {
ast_log(LOG_WARNING, "Format for registration is user[:secret[:authuser]]@host[:port][/contact] at line %d\n", lineno);
return -1;
}
hostname = strsep(&stringp, "/");
if (hostname)
contact = strsep(&stringp, "/");
- if (!contact || ast_strlen_zero(contact))
+ if (ast_strlen_zero(contact))
contact = "s";
stringp=hostname;
hostname = strsep(&stringp, ":");
n = strchr(c, ';');
if (n)
*n = '\0';
- if (c && !ast_strlen_zero(c))
+ if (!ast_strlen_zero(c))
ast_copy_string(p->uri, c, sizeof(p->uri));
}
if (p->owner && p->owner->cid.cid_name) {
clin = strdup(p->owner->cid.cid_name);
}
- if (!clin || ast_strlen_zero(clin))
+ if (ast_strlen_zero(clin))
clin = clid;
switch (p->callingpres) {
}
if (!l)
l = default_callerid;
- if (!n || ast_strlen_zero(n))
+ if (ast_strlen_zero(n))
n = l;
/* Allow user to be overridden */
if (!ast_strlen_zero(p->fromuser))
add_header(&req, "Content-Type", default_notifymime);
ast_build_string(&t, &maxbytes, "Messages-Waiting: %s\r\n", newmsgs ? "yes" : "no");
- ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s\r\n", (vmexten && !ast_strlen_zero(vmexten)) ? vmexten : global_vmexten, p->fromdomain);
+ ast_build_string(&t, &maxbytes, "Message-Account: sip:%s@%s\r\n", !ast_strlen_zero(vmexten) ? vmexten : global_vmexten, p->fromdomain);
ast_build_string(&t, &maxbytes, "Voice-Message: %d/%d (0/0)\r\n", newmsgs, oldmsgs);
if (t > tmp + sizeof(tmp))
/* Fromdomain is what we are registering to, regardless of actual
host name from SRV */
- if (p->fromdomain && !ast_strlen_zero(p->fromdomain))
+ if (!ast_strlen_zero(p->fromdomain))
snprintf(addr, sizeof(addr), "sip:%s", p->fromdomain);
else
snprintf(addr, sizeof(addr), "sip:%s", r->hostname);
if (auth) /* Add auth header */
add_header(&req, authheader, auth);
- else if ( !ast_strlen_zero(r->nonce) ) {
+ else if (!ast_strlen_zero(r->nonce)) {
char digest[1024];
/* We have auth data to reuse, build a digest header! */
what we currently have stored as their contact address, so return
it
*/
- if (ast_strlen_zero(c) && (!expires || ast_strlen_zero(expires))) {
+ if (ast_strlen_zero(c) && ast_strlen_zero(expires)) {
if ((p->expire > -1) && !ast_strlen_zero(p->fullcontact)) {
/* tell them when the registration is going to expire */
pvt->expiry = ast_sched_when(sched, p->expire);
char idtext[256] = "";
int total = 0;
- if (id && !ast_strlen_zero(id))
+ if (!ast_strlen_zero(id))
snprintf(idtext,256,"ActionID: %s\r\n",id);
astman_send_ack(s, m, "Peer status list will follow");
if (s) { /* Manager - get ActionID */
id = astman_get_header(m,"ActionID");
- if (id && !ast_strlen_zero(id))
+ if (!ast_strlen_zero(id))
snprintf(idtext,256,"ActionID: %s\r\n",id);
}
int ret;
peer = astman_get_header(m,"Peer");
- if (!peer || ast_strlen_zero(peer)) {
+ if (ast_strlen_zero(peer)) {
astman_send_error(s, m, "Peer: <name> missing.\n");
return 0;
}
a[2] = "peer";
a[3] = peer;
- if (id && !ast_strlen_zero(id))
+ if (!ast_strlen_zero(id))
ast_cli(s->fd, "ActionID: %s\r\n",id);
ret = _sip_show_peer(1, s->fd, s, m, 4, a );
ast_cli( s->fd, "\r\n\r\n" );
/*! \brief function_check_sipdomain: Dial plan function to check if domain is local */
static char *func_check_sipdomain(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
- if (!data || ast_strlen_zero(data)) {
+ if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "CHECKSIPDOMAIN requires an argument - A domain name\n");
return buf;
}
parse_sip_options(p, supported);
}
required = get_header(req, "Required");
- if (required && !ast_strlen_zero(required)) {
+ if (!ast_strlen_zero(required)) {
required_profile = parse_sip_options(NULL, required);
if (required_profile) { /* They require something */
/* At this point we support no extensions, so fail */
return 0;
}
/* Initialize the context if it hasn't been already */
- if (p->subscribecontext && !ast_strlen_zero(p->subscribecontext))
+ if (!ast_strlen_zero(p->subscribecontext))
ast_copy_string(p->context, p->subscribecontext, sizeof(p->context));
else if (ast_strlen_zero(p->context))
strcpy(p->context, default_context);
{
struct domain *d;
- if (!domain || ast_strlen_zero(domain)) {
+ if (ast_strlen_zero(domain)) {
ast_log(LOG_WARNING, "Zero length domain.\n");
return 1;
}
ast_copy_string(d->domain, domain, sizeof(d->domain));
- if (context && !ast_strlen_zero(context))
+ if (!ast_strlen_zero(context))
ast_copy_string(d->context, context, sizeof(d->context));
d->mode = mode;
struct sip_auth *auth;
struct sip_auth *b = NULL, *a = authlist;
- if (!configuration || ast_strlen_zero(configuration))
+ if (ast_strlen_zero(configuration))
return authlist;
ast_log(LOG_DEBUG, "Auth config :: %s\n", configuration);
*realm = '\0';
realm++;
}
- if (!username || ast_strlen_zero(username) || !realm || ast_strlen_zero(realm)) {
+ if (ast_strlen_zero(username) || ast_strlen_zero(realm)) {
ast_log(LOG_WARNING, "Format for authentication entry is user[:secret]@realm at line %d\n", lineno);
return authlist;
}
if (ast_strlen_zero(domain))
ast_log(LOG_WARNING, "Empty domain specified at line %d\n", v->lineno);
- else if (context && ast_strlen_zero(context))
+ else if (ast_strlen_zero(context))
ast_log(LOG_WARNING, "Empty context specified at line %d for domain '%s'\n", v->lineno, domain);
else
add_sip_domain(ast_strip(domain), SIP_DOMAIN_CONFIG, context ? ast_strip(context) : "");
}
if (number)
ast_shrink_phone_number(number);
- if (number && !ast_strlen_zero(number)) {
+ if (!ast_strlen_zero(number)) {
owner->cid.cid_num = strdup(number);
owner->cid.cid_ani = strdup(number);
- if (name && !ast_strlen_zero(name)){
+ if (!ast_strlen_zero(name)){
owner->cid.cid_name = strdup(name);
snprintf(p->callerid,(sizeof(p->callerid)-1),"%s %s",number,name);
}
if (argc < 5)
return RESULT_SHOWUSAGE;
- if (!argv[4] || ast_strlen_zero(argv[4]))
+ if (ast_strlen_zero(argv[4]))
return RESULT_SHOWUSAGE;
myfd = open(argv[4], O_CREAT|O_WRONLY);
char idText[256] = "";
astman_send_ack(s, m, "Zapata channel status will follow");
- if (id && !ast_strlen_zero(id))
+ if (!ast_strlen_zero(id))
snprintf(idText, sizeof(idText) - 1, "ActionID: %s\r\n", id);
ast_mutex_lock(&iflock);
else
callprogress &= ~6;
} else if (!strcasecmp(v->name, "echocancel")) {
- if (v->value && !ast_strlen_zero(v->value)) {
+ if (!ast_strlen_zero(v->value)) {
y = atoi(v->value);
} else
y = 0;