[asterisk-commits] file: trunk r75566 - in /trunk: apps/ channels/ pbx/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jul 18 08:59:01 CDT 2007
Author: file
Date: Wed Jul 18 08:59:01 2007
New Revision: 75566
URL: http://svn.digium.com/view/asterisk?view=rev&rev=75566
Log:
Minor code tweaks. Variables were being checked wrong in some situations and didn't need to be checked in others.
Modified:
trunk/apps/app_voicemail.c
trunk/channels/chan_agent.c
trunk/channels/chan_sip.c
trunk/pbx/pbx_realtime.c
Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=75566&r1=75565&r2=75566
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed Jul 18 08:59:01 2007
@@ -619,9 +619,9 @@
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 @@
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)
Modified: trunk/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_agent.c?view=diff&rev=75566&r1=75565&r2=75566
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Wed Jul 18 08:59:01 2007
@@ -390,10 +390,10 @@
/* 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
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=75566&r1=75565&r2=75566
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jul 18 08:59:01 2007
@@ -4948,7 +4948,7 @@
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);
Modified: trunk/pbx/pbx_realtime.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_realtime.c?view=diff&rev=75566&r1=75565&r2=75566
==============================================================================
--- trunk/pbx/pbx_realtime.c (original)
+++ trunk/pbx/pbx_realtime.c Wed Jul 18 08:59:01 2007
@@ -211,7 +211,7 @@
"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
More information about the asterisk-commits
mailing list