diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 96461fce9a..b5897df554 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -619,9 +619,9 @@ static struct ast_flags globalflags = {0}; static int saydurationminfo; -static char dialcontext[AST_MAX_CONTEXT]; -static char callcontext[AST_MAX_CONTEXT]; -static char exitcontext[AST_MAX_CONTEXT]; +static char dialcontext[AST_MAX_CONTEXT] = ""; +static char callcontext[AST_MAX_CONTEXT] = ""; +static char exitcontext[AST_MAX_CONTEXT] = ""; static char cidinternalcontexts[MAX_NUM_CID_CONTEXTS][64]; @@ -665,12 +665,9 @@ static void populate_defaults(struct ast_vm_user *vmu) ast_copy_flags(vmu, (&globalflags), AST_FLAGS_ALL); if (saydurationminfo) vmu->saydurationm = saydurationminfo; - if (callcontext) - ast_copy_string(vmu->callback, callcontext, sizeof(vmu->callback)); - if (dialcontext) - ast_copy_string(vmu->dialout, dialcontext, sizeof(vmu->dialout)); - if (exitcontext) - ast_copy_string(vmu->exit, exitcontext, sizeof(vmu->exit)); + ast_copy_string(vmu->callback, callcontext, sizeof(vmu->callback)); + ast_copy_string(vmu->dialout, dialcontext, sizeof(vmu->dialout)); + ast_copy_string(vmu->exit, exitcontext, sizeof(vmu->exit)); if (vmmaxsecs) vmu->maxsecs = vmmaxsecs; if (maxmsg) diff --git a/channels/chan_agent.c b/channels/chan_agent.c index cda841fa51..d1231556e8 100644 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -390,10 +390,10 @@ static int __agent_start_monitoring(struct ast_channel *ast, struct agent_pvt *p /* substitute . for - */ if ((pointer = strchr(filename, '.'))) *pointer = '-'; - snprintf(tmp, sizeof(tmp), "%s%s",savecallsin ? savecallsin : "", filename); + snprintf(tmp, sizeof(tmp), "%s%s", savecallsin, filename); ast_monitor_start(ast, recordformat, tmp, needlock, X_REC_IN | X_REC_OUT); ast_monitor_setjoinfiles(ast, 1); - snprintf(tmp2, sizeof(tmp2), "%s%s.%s", urlprefix ? urlprefix : "", filename, recordformatext); + snprintf(tmp2, sizeof(tmp2), "%s%s.%s", urlprefix, filename, recordformatext); #if 0 ast_verbose("name is %s, link is %s\n",tmp, tmp2); #endif diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b22d798ff4..2f5c5c5c2f 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4948,7 +4948,7 @@ static int sip_register(char *value, int lineno) regobjs++; ASTOBJ_INIT(reg); ast_string_field_set(reg, callback, callback); - if (username) + if (!ast_strlen_zero(username)) ast_string_field_set(reg, username, username); if (hostname) ast_string_field_set(reg, hostname, hostname); diff --git a/pbx/pbx_realtime.c b/pbx/pbx_realtime.c index 9ee770c99a..d1011fe8eb 100644 --- a/pbx/pbx_realtime.c +++ b/pbx/pbx_realtime.c @@ -211,7 +211,7 @@ static int realtime_exec(struct ast_channel *chan, const char *context, const ch "Application: %s\r\n" "AppData: %s\r\n" "Uniqueid: %s\r\n", - chan->name, chan->context, chan->exten, chan->priority, app, appdata ? appdata : "(NULL)", chan->uniqueid); + chan->name, chan->context, chan->exten, chan->priority, app, !ast_strlen_zero(appdata) ? appdata : "(NULL)", chan->uniqueid); res = pbx_exec(chan, a, appdata); } else