[asterisk-commits] pabelanger: branch pabelanger/issue18556 r300387 - in /team/pabelanger/issue1...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jan 4 20:09:17 UTC 2011
Author: pabelanger
Date: Tue Jan 4 14:09:08 2011
New Revision: 300387
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=300387
Log:
Remove option_debug if statements, plus code formatting
Modified:
team/pabelanger/issue18556/addons/chan_ooh323.c
team/pabelanger/issue18556/apps/app_fax.c
team/pabelanger/issue18556/apps/app_meetme.c
team/pabelanger/issue18556/apps/app_rpt.c
team/pabelanger/issue18556/apps/app_voicemail.c
team/pabelanger/issue18556/cel/cel_radius.c
team/pabelanger/issue18556/channels/chan_dahdi.c
team/pabelanger/issue18556/channels/chan_iax2.c
team/pabelanger/issue18556/channels/chan_misdn.c
team/pabelanger/issue18556/channels/chan_sip.c
team/pabelanger/issue18556/channels/chan_skinny.c
team/pabelanger/issue18556/channels/sig_pri.c
team/pabelanger/issue18556/codecs/codec_ilbc.c
team/pabelanger/issue18556/include/asterisk/channel.h
team/pabelanger/issue18556/include/asterisk/sched.h
team/pabelanger/issue18556/main/audiohook.c
team/pabelanger/issue18556/main/channel.c
team/pabelanger/issue18556/main/features.c
team/pabelanger/issue18556/main/pbx.c
team/pabelanger/issue18556/main/say.c
team/pabelanger/issue18556/main/taskprocessor.c
team/pabelanger/issue18556/res/res_config_ldap.c
team/pabelanger/issue18556/res/res_http_post.c
team/pabelanger/issue18556/res/res_musiconhold.c
team/pabelanger/issue18556/res/res_rtp_asterisk.c
team/pabelanger/issue18556/res/res_smdi.c
team/pabelanger/issue18556/utils/extconf.c
Modified: team/pabelanger/issue18556/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue18556/addons/chan_ooh323.c?view=diff&rev=300387&r1=300386&r2=300387
==============================================================================
--- team/pabelanger/issue18556/addons/chan_ooh323.c (original)
+++ team/pabelanger/issue18556/addons/chan_ooh323.c Tue Jan 4 14:09:08 2011
@@ -1034,13 +1034,13 @@
if (gH323Debug)
ast_verbose(" hanging %s with cause: %d\n", p->username, q931cause);
- ast->tech_pvt = NULL;
+ ast->tech_pvt = NULL;
if (!ast_test_flag(p, H323_ALREADYGONE)) {
- ooHangCall(p->callToken,
+ ooHangCall(p->callToken,
ooh323_convert_hangupcause_asteriskToH323(q931cause), q931cause);
ast_set_flag(p, H323_ALREADYGONE);
/* ast_mutex_unlock(&p->lock); */
- } else
+ } else
ast_set_flag(p, H323_NEEDDESTROY);
/* detach channel here */
if (p->owner) {
@@ -1056,11 +1056,11 @@
/* Notify the module monitors that use count for resource has changed */
ast_update_use_count();
-
+
} else {
ast_debug(1, "No call to hangup\n" );
}
-
+
if (gH323Debug)
ast_verbose("+++ ooh323_hangup\n");
@@ -1080,8 +1080,7 @@
if (ast->_state != AST_STATE_UP) {
ast_channel_lock(ast);
ast_setstate(ast, AST_STATE_UP);
- if (option_debug)
- ast_debug(1, "ooh323_answer(%s)\n", ast->name);
+ ast_debug(1, "ooh323_answer(%s)\n", ast->name);
ast_channel_unlock(ast);
ooAnswerCall(p->callToken);
}
@@ -1130,11 +1129,10 @@
return res;
}
-
if (f->frametype == AST_FRAME_VOICE) {
/* sending progress for first */
if (!ast_test_flag(p, H323_OUTGOING) && !p->progsent &&
- p->callToken) {
+ p->callToken) {
ooManualProgress(p->callToken);
p->progsent = 1;
}
@@ -1198,48 +1196,50 @@
if (gH323Debug)
ast_verbose("----- ooh323_indicate %d on call %s\n", condition, callToken);
-
- ast_mutex_lock(&p->lock);
+
+ ast_mutex_lock(&p->lock);
switch (condition) {
case AST_CONTROL_CONGESTION:
if (!ast_test_flag(p, H323_ALREADYGONE)) {
- ooHangCall(callToken, OO_REASON_LOCAL_CONGESTED,
+ ooHangCall(callToken, OO_REASON_LOCAL_CONGESTED,
AST_CAUSE_SWITCH_CONGESTION);
ast_set_flag(p, H323_ALREADYGONE);
}
break;
case AST_CONTROL_BUSY:
if (!ast_test_flag(p, H323_ALREADYGONE)) {
- ooHangCall(callToken, OO_REASON_LOCAL_BUSY, AST_CAUSE_USER_BUSY);
+ ooHangCall(callToken, OO_REASON_LOCAL_BUSY, AST_CAUSE_USER_BUSY);
ast_set_flag(p, H323_ALREADYGONE);
}
break;
case AST_CONTROL_HOLD:
- ast_moh_start(ast, data, NULL);
+ ast_moh_start(ast, data, NULL);
break;
case AST_CONTROL_UNHOLD:
ast_moh_stop(ast);
break;
case AST_CONTROL_PROGRESS:
if (ast->_state != AST_STATE_UP) {
- if (!p->progsent) {
- if (gH323Debug)
- ast_debug(1,"Sending manual progress for %s, res = %d\n", callToken,
- ooManualProgress(callToken));
- else
- ooManualProgress(callToken);
- p->progsent = 1;
- }
+ if (!p->progsent) {
+ if (gH323Debug) {
+ ast_debug(1, "Sending manual progress for %s, res = %d\n", callToken,
+ ooManualProgress(callToken));
+ } else {
+ ooManualProgress(callToken);
+ }
+ p->progsent = 1;
+ }
}
break;
case AST_CONTROL_RINGING:
if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING) {
- if (gH323Debug)
- ast_debug(1,"Sending manual ringback for %s, res = %d\n",
+ if (gH323Debug) {
+ ast_debug(1, "Sending manual ringback for %s, res = %d\n",
callToken,
- ooManualRingback(callToken));
- else
- ooManualRingback(callToken);
+ ooManualRingback(callToken));
+ } else {
+ ooManualRingback(callToken);
+ }
}
break;
case AST_CONTROL_SRCUPDATE:
@@ -1253,9 +1253,10 @@
|| ast_strlen_zero(ast->connected.id.name.str)) {
break;
}
- if (gH323Debug)
+ if (gH323Debug) {
ast_debug(1, "Sending connected line info for %s (%s)\n",
callToken, ast->connected.id.name.str);
+ }
ooSetANI(callToken, ast->connected.id.name.str);
break;
@@ -1370,8 +1371,8 @@
if (gH323Debug)
ast_verbose("+++++ ooh323_queryoption %d on channel %s\n", option, ast->name);
-
- ast_mutex_unlock(&p->lock);
+
+ ast_mutex_unlock(&p->lock);
return res;
}
@@ -1415,9 +1416,9 @@
char formats[FORMAT_STRING_SIZE];
if (gH323Debug)
- ast_verbose("--- ooh323_update_writeformat %s/%d\n",
+ ast_verbose("--- ooh323_update_writeformat %s/%d\n",
ast_getformatname_multiple(formats,FORMAT_STRING_SIZE, fmt), txframes);
-
+
p = find_call(call);
if (!p) {
ast_log(LOG_ERROR, "No matching call found for %s\n", call->callToken);
@@ -1430,7 +1431,7 @@
if (p->owner) {
while (p->owner && ast_channel_trylock(p->owner)) {
- ast_debug(1,"Failed to grab lock, trying again\n");
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
}
if (!p->owner) {
@@ -1439,7 +1440,7 @@
return;
}
if (gH323Debug)
- ast_verbose("Writeformat before update %s/%s\n",
+ ast_verbose("Writeformat before update %s/%s\n",
ast_getformatname_multiple(formats,FORMAT_STRING_SIZE, p->owner->writeformat),
ast_getformatname_multiple(formats,FORMAT_STRING_SIZE, p->owner->nativeformats));
if (txframes)
@@ -1476,7 +1477,7 @@
if (gH323Debug)
ast_verbose("--- ooh323_update_readformat %s\n",
ast_getformatname_multiple(formats,FORMAT_STRING_SIZE, fmt));
-
+
p = find_call(call);
if (!p) {
ast_log(LOG_ERROR, "No matching call found for %s\n", call->callToken);
@@ -1490,7 +1491,7 @@
if (p->owner) {
while (p->owner && ast_channel_trylock(p->owner)) {
- ast_debug(1,"Failed to grab lock, trying again\n");
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
}
if (!p->owner) {
@@ -1500,12 +1501,12 @@
}
if (gH323Debug)
- ast_verbose("Readformat before update %s\n",
+ ast_verbose("Readformat before update %s\n",
ast_getformatname_multiple(formats,FORMAT_STRING_SIZE, p->owner->readformat));
p->owner->nativeformats = fmt;
- ast_set_read_format(p->owner, p->owner->readformat);
+ ast_set_read_format(p->owner, p->owner->readformat);
ast_channel_unlock(p->owner);
- } else
+ } else
ast_log(LOG_ERROR, "No owner found\n");
ast_mutex_unlock(&p->lock);
@@ -1523,12 +1524,12 @@
if (gH323Debug)
ast_verbose("--- onAlerting %s\n", call->callToken);
- p = find_call(call);
-
- if(!p) {
+ p = find_call(call);
+
+ if(!p) {
ast_log(LOG_ERROR, "No matching call found\n");
return -1;
- }
+ }
ast_mutex_lock(&p->lock);
if (!p->owner) {
ast_mutex_unlock(&p->lock);
@@ -1536,7 +1537,7 @@
return 0;
}
while (p->owner && ast_channel_trylock(p->owner)) {
- ast_debug(1,"Failed to grab lock, trying again\n");
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
}
if (!p->owner) {
@@ -1579,12 +1580,12 @@
if (gH323Debug)
ast_verbose("--- onProgress %s\n", call->callToken);
- p = find_call(call);
-
- if(!p) {
+ p = find_call(call);
+
+ if(!p) {
ast_log(LOG_ERROR, "No matching call found\n");
return -1;
- }
+ }
ast_mutex_lock(&p->lock);
if (!p->owner) {
ast_mutex_unlock(&p->lock);
@@ -1592,7 +1593,7 @@
return 0;
}
while (p->owner && ast_channel_trylock(p->owner)) {
- ast_debug(1,"Failed to grab lock, trying again\n");
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
}
if (!p->owner) {
@@ -1618,8 +1619,8 @@
ast_setstate(c, AST_STATE_RINGING);
ast_queue_control(c, AST_CONTROL_PROGRESS);
- ast_channel_unlock(c);
- ast_mutex_unlock(&p->lock);
+ ast_channel_unlock(c);
+ ast_mutex_unlock(&p->lock);
if (gH323Debug)
ast_verbose("+++ onProgress %s\n", call->callToken);
@@ -1659,7 +1660,7 @@
f.src = "SEND_DIGIT";
while (p->owner && ast_channel_trylock(p->owner)) {
- ast_debug(1,"Failed to grab lock, trying again\n");
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
}
if (!p->owner) {
@@ -1997,16 +1998,16 @@
return -1;
}
- if(ast_test_flag(p, H323_OUTGOING)) {
+ if(ast_test_flag(p, H323_OUTGOING)) {
ast_mutex_lock(&p->lock);
if (!p->owner) {
ast_mutex_unlock(&p->lock);
ast_log(LOG_ERROR, "Channel has no owner\n");
return -1;
}
-
+
while (p->owner && ast_channel_trylock(p->owner)) {
- ast_debug(1,"Failed to grab lock, trying again\n");
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
}
if (p->owner) {
@@ -2026,7 +2027,7 @@
}
ast_queue_control(c, AST_CONTROL_ANSWER);
- ast_channel_unlock(p->owner);
+ ast_channel_unlock(p->owner);
manager_event(EVENT_FLAG_SYSTEM,"ChannelUpdate","Channel: %s\r\nChanneltype: %s\r\n"
"CallRef: %d\r\n", c->name, "OOH323", p->call_reference);
}
@@ -2051,42 +2052,42 @@
if ((p = find_call(call))) {
ast_mutex_lock(&p->lock);
-
+
while (p->owner) {
if (ast_channel_trylock(p->owner)) {
ooTrace(OOTRCLVLINFO, "Failed to grab lock, trying again\n");
- ast_debug(1,"Failed to grab lock, trying again\n");
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
} else {
- ownerLock = 1; break;
+ ownerLock = 1; break;
}
}
if (ownerLock) {
- if (!ast_test_flag(p, H323_ALREADYGONE)) {
+ if (!ast_test_flag(p, H323_ALREADYGONE)) {
ast_set_flag(p, H323_ALREADYGONE);
p->owner->hangupcause = call->q931cause;
p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
ast_queue_hangup_with_cause(p->owner,call->q931cause);
}
- }
-
- if(p->owner) {
- p->owner->tech_pvt = NULL;
+ }
+
+ if(p->owner) {
+ p->owner->tech_pvt = NULL;
ast_channel_unlock(p->owner);
- p->owner = NULL;
+ p->owner = NULL;
ast_module_unref(myself);
}
ast_set_flag(p, H323_NEEDDESTROY);
- ooh323c_stop_call_thread(call);
+ ooh323c_stop_call_thread(call);
ast_mutex_unlock(&p->lock);
- ast_mutex_lock(&usecnt_lock);
- usecnt--;
- ast_mutex_unlock(&usecnt_lock);
+ ast_mutex_lock(&usecnt_lock);
+ usecnt--;
+ ast_mutex_unlock(&usecnt_lock);
}
@@ -3506,7 +3507,7 @@
free(cur->callerid_name);
cur->callerid_name = 0;
}
-
+
if (cur->callerid_num) {
free(cur->callerid_num);
cur->callerid_num = 0;
@@ -3521,20 +3522,20 @@
ast_udptl_destroy(cur->udptl);
cur->udptl = NULL;
}
-
+
/* Unlink us from the owner if we have one */
if (cur->owner) {
- while(ast_channel_trylock(cur->owner)) {
- ast_debug(1,"Failed to grab lock, trying again\n");
+ while(ast_channel_trylock(cur->owner)) {
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&cur->lock);
- }
+ }
ast_debug(1, "Detaching from %s\n", cur->owner->name);
cur->owner->tech_pvt = NULL;
ast_channel_unlock(cur->owner);
cur->owner = NULL;
ast_module_unref(myself);
}
-
+
if (cur->vad) {
ast_dsp_free(cur->vad);
cur->vad = NULL;
@@ -4080,7 +4081,7 @@
ast_verbose("--- setup_udptl_connection\n");
/* Find the call or allocate a private structure if call not found */
- p = find_call(call);
+ p = find_call(call);
if (!p) {
ast_log(LOG_ERROR, "Something is wrong: rtp\n");
@@ -4090,7 +4091,7 @@
ast_mutex_lock(&p->lock);
if (p->owner) {
while (p->owner && ast_channel_trylock(p->owner)) {
- ast_debug(1,"Failed to grab lock, trying again\n");
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
}
if (!p->owner) {
@@ -4117,7 +4118,7 @@
ast_queue_control_data(p->owner, AST_CONTROL_T38_PARAMETERS, ¶meters, sizeof(parameters));
}
if (gH323Debug)
- ast_debug(1, "Receiving UDPTL %s:%d\n", ast_inet_ntoa(them.sin_addr),
+ ast_debug(1, "Receiving UDPTL %s:%d\n", ast_inet_ntoa(them.sin_addr),
ntohs(them.sin_port));
ast_channel_unlock(p->owner);
@@ -4133,19 +4134,19 @@
{
struct ooh323_pvt *p = NULL;
- if(gH323Debug)
+ if(gH323Debug)
ast_verbose("--- close_udptl_connection\n");
p = find_call(call);
if (!p) {
- ast_log(LOG_ERROR, "Couldn't find matching call to close udptl "
+ ast_log(LOG_ERROR, "Couldn't find matching call to close udptl "
"connection\n");
return;
}
ast_mutex_lock(&p->lock);
if (p->owner) {
while (p->owner && ast_channel_trylock(p->owner)) {
- ast_debug(1,"Failed to grab lock, trying again\n");
+ ast_debug(1, "Failed to grab lock, trying again\n");
DEADLOCK_AVOIDANCE(&p->lock);
}
if (!p->owner) {
@@ -4226,8 +4227,10 @@
break;
case 5:
f = ast_udptl_read(p->udptl); /* UDPTL t.38 data */
- if (gH323Debug) ast_debug(1, "Got UDPTL %d/%d len %d for %s\n",
+ if (gH323Debug) {
+ ast_debug(1, "Got UDPTL %d/%d len %d for %s\n",
f->frametype, f->subclass.integer, f->datalen, ast->name);
+ }
break;
default:
@@ -4238,7 +4241,7 @@
/* We already hold the channel lock */
if (f->frametype == AST_FRAME_VOICE && !p->faxmode) {
if (f->subclass.codec != p->owner->nativeformats) {
- ast_debug(1, "Oooh, voice format changed to %s\n", ast_getformatname(f->subclass.codec));
+ ast_debug(1, "Oooh, voice format changed to %s\n", ast_getformatname(f->subclass.codec));
p->owner->nativeformats = f->subclass.codec;
ast_set_read_format(p->owner, p->owner->readformat);
ast_set_write_format(p->owner, p->owner->writeformat);
@@ -4248,8 +4251,9 @@
(f->subclass.codec == AST_FORMAT_SLINEAR || f->subclass.codec == AST_FORMAT_ALAW ||
f->subclass.codec == AST_FORMAT_ULAW)) {
f = ast_dsp_process(p->owner, p->vad, f);
- if (f && (f->frametype == AST_FRAME_DTMF))
- ast_debug(1, "* Detected inband DTMF '%c'\n", f->subclass.integer);
+ if (f && (f->frametype == AST_FRAME_DTMF)) {
+ ast_debug(1, "* Detected inband DTMF '%c'\n", f->subclass.integer);
+ }
}
}
}
@@ -4267,13 +4271,15 @@
ast_mutex_lock(&p->lock);
- if (gH323Debug)
- ast_debug(1, "change mode to %d for %s\n", t38mode, call->callToken);
+ if (gH323Debug) {
+ ast_debug(1, "change mode to %d for %s\n", t38mode, call->callToken);
+ }
if (t38mode == p->faxmode) {
- if (gH323Debug)
+ if (gH323Debug) {
ast_debug(1, "mode for %s is already %d\n", call->callToken,
t38mode);
+ }
ast_mutex_unlock(&p->lock);
return;
}
Modified: team/pabelanger/issue18556/apps/app_fax.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue18556/apps/app_fax.c?view=diff&rev=300387&r1=300386&r2=300387
==============================================================================
--- team/pabelanger/issue18556/apps/app_fax.c (original)
+++ team/pabelanger/issue18556/apps/app_fax.c Tue Jan 4 14:09:08 2011
@@ -17,7 +17,7 @@
<depend>spandsp</depend>
<conflict>res_fax</conflict>
***/
-
+
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -224,13 +224,13 @@
return;
}
-
- s->finished = 1;
-
+
+ s->finished = 1;
+
local_ident = S_OR(t30_get_tx_ident(f), "");
far_ident = S_OR(t30_get_rx_ident(f), "");
- pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "SUCCESS");
- pbx_builtin_setvar_helper(s->chan, "FAXERROR", NULL);
+ pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "SUCCESS");
+ pbx_builtin_setvar_helper(s->chan, "FAXERROR", NULL);
pbx_builtin_setvar_helper(s->chan, "REMOTESTATIONID", far_ident);
#if SPANDSP_RELEASE_DATE >= 20090220
pages_transferred = (s->direction) ? stat.pages_tx : stat.pages_rx;
@@ -242,14 +242,14 @@
snprintf(buf, sizeof(buf), "%d", stat.y_resolution);
pbx_builtin_setvar_helper(s->chan, "FAXRESOLUTION", buf);
snprintf(buf, sizeof(buf), "%d", stat.bit_rate);
- pbx_builtin_setvar_helper(s->chan, "FAXBITRATE", buf);
-
+ pbx_builtin_setvar_helper(s->chan, "FAXBITRATE", buf);
+
ast_debug(1, "Fax transmitted successfully.\n");
ast_debug(1, " Remote station ID: %s\n", far_ident);
ast_debug(1, " Pages transferred: %d\n", pages_transferred);
ast_debug(1, " Image resolution: %d x %d\n", stat.x_resolution, stat.y_resolution);
ast_debug(1, " Transfer Rate: %d\n", stat.bit_rate);
-
+
ast_manager_event(s->chan, EVENT_FLAG_CALL,
s->direction ? "FaxSent" : "FaxReceived",
"Channel: %s\r\n"
@@ -397,7 +397,7 @@
/* wait up to five seconds for negotiation to complete */
unsigned int timeout = 5000;
int ms;
-
+
ast_debug(1, "Negotiating T.38 for receive on %s\n", s->chan->name);
while (timeout > 0) {
ms = ast_waitfor(s->chan, 1000);
@@ -422,7 +422,7 @@
(inf->subclass.integer == AST_CONTROL_T38_PARAMETERS) &&
(inf->datalen == sizeof(t38_parameters))) {
struct ast_control_t38_parameters *parameters = inf->data.ptr;
-
+
switch (parameters->request_response) {
case AST_T38_NEGOTIATED:
ast_debug(1, "Negotiated T.38 for receive on %s\n", s->chan->name);
@@ -667,7 +667,7 @@
res = -1;
break;
}
-
+
t38_terminal_send_timeout(&t38, ast_tvdiff_us(now, last_frame) / (1000000 / 8000));
if (!res) {
@@ -724,7 +724,7 @@
/* wait up to five seconds for negotiation to complete */
unsigned int timeout = 5000;
int ms;
-
+
ast_debug(1, "Shutting down T.38 on %s\n", s->chan->name);
while (timeout > 0) {
ms = ast_waitfor(s->chan, 1000);
@@ -749,7 +749,7 @@
(inf->subclass.integer == AST_CONTROL_T38_PARAMETERS) &&
(inf->datalen == sizeof(t38_parameters))) {
struct ast_control_t38_parameters *parameters = inf->data.ptr;
-
+
switch (parameters->request_response) {
case AST_T38_TERMINATED:
ast_debug(1, "Shut down T.38 on %s\n", s->chan->name);
Modified: team/pabelanger/issue18556/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue18556/apps/app_meetme.c?view=diff&rev=300387&r1=300386&r2=300387
==============================================================================
--- team/pabelanger/issue18556/apps/app_meetme.c (original)
+++ team/pabelanger/issue18556/apps/app_meetme.c Tue Jan 4 14:09:08 2011
@@ -2038,7 +2038,7 @@
static void conf_start_moh(struct ast_channel *chan, const char *musicclass)
{
- char *original_moh;
+ char *original_moh;
ast_channel_lock(chan);
original_moh = ast_strdupa(chan->musicclass);
@@ -2239,16 +2239,16 @@
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
char *exitkeys = NULL;
- unsigned int calldurationlimit = 0;
- long timelimit = 0;
- long play_warning = 0;
- long warning_freq = 0;
- const char *warning_sound = NULL;
- const char *end_sound = NULL;
- char *parse;
- long time_left_ms = 0;
- struct timeval nexteventts = { 0, };
- int to;
+ unsigned int calldurationlimit = 0;
+ long timelimit = 0;
+ long play_warning = 0;
+ long warning_freq = 0;
+ const char *warning_sound = NULL;
+ const char *end_sound = NULL;
+ char *parse;
+ long time_left_ms = 0;
+ struct timeval nexteventts = { 0, };
+ int to;
int setusercount = 0;
int confsilence = 0, totalsilence = 0;
char *mailbox, *context;
@@ -2264,72 +2264,72 @@
(opt_waitmarked_timeout > 0)) {
timeout = time(NULL) + opt_waitmarked_timeout;
}
-
- if (ast_test_flag64(confflags, CONFFLAG_DURATION_STOP) && !ast_strlen_zero(optargs[OPT_ARG_DURATION_STOP])) {
- calldurationlimit = atoi(optargs[OPT_ARG_DURATION_STOP]);
- ast_verb(3, "Setting call duration limit to %d seconds.\n", calldurationlimit);
- }
-
- if (ast_test_flag64(confflags, CONFFLAG_DURATION_LIMIT) && !ast_strlen_zero(optargs[OPT_ARG_DURATION_LIMIT])) {
- char *limit_str, *warning_str, *warnfreq_str;
+
+ if (ast_test_flag64(confflags, CONFFLAG_DURATION_STOP) && !ast_strlen_zero(optargs[OPT_ARG_DURATION_STOP])) {
+ calldurationlimit = atoi(optargs[OPT_ARG_DURATION_STOP]);
+ ast_verb(3, "Setting call duration limit to %d seconds.\n", calldurationlimit);
+ }
+
+ if (ast_test_flag64(confflags, CONFFLAG_DURATION_LIMIT) && !ast_strlen_zero(optargs[OPT_ARG_DURATION_LIMIT])) {
+ char *limit_str, *warning_str, *warnfreq_str;
const char *var;
-
- parse = optargs[OPT_ARG_DURATION_LIMIT];
- limit_str = strsep(&parse, ":");
- warning_str = strsep(&parse, ":");
- warnfreq_str = parse;
-
- timelimit = atol(limit_str);
- if (warning_str)
- play_warning = atol(warning_str);
- if (warnfreq_str)
- warning_freq = atol(warnfreq_str);
-
- if (!timelimit) {
- timelimit = play_warning = warning_freq = 0;
- warning_sound = NULL;
- } else if (play_warning > timelimit) {
- if (!warning_freq) {
- play_warning = 0;
- } else {
- while (play_warning > timelimit)
- play_warning -= warning_freq;
- if (play_warning < 1)
- play_warning = warning_freq = 0;
- }
- }
-
+
+ parse = optargs[OPT_ARG_DURATION_LIMIT];
+ limit_str = strsep(&parse, ":");
+ warning_str = strsep(&parse, ":");
+ warnfreq_str = parse;
+
+ timelimit = atol(limit_str);
+ if (warning_str)
+ play_warning = atol(warning_str);
+ if (warnfreq_str)
+ warning_freq = atol(warnfreq_str);
+
+ if (!timelimit) {
+ timelimit = play_warning = warning_freq = 0;
+ warning_sound = NULL;
+ } else if (play_warning > timelimit) {
+ if (!warning_freq) {
+ play_warning = 0;
+ } else {
+ while (play_warning > timelimit)
+ play_warning -= warning_freq;
+ if (play_warning < 1)
+ play_warning = warning_freq = 0;
+ }
+ }
+
ast_channel_lock(chan);
if ((var = pbx_builtin_getvar_helper(chan, "CONF_LIMIT_WARNING_FILE"))) {
var = ast_strdupa(var);
}
ast_channel_unlock(chan);
- warning_sound = var ? var : "timeleft";
-
+ warning_sound = var ? var : "timeleft";
+
ast_channel_lock(chan);
if ((var = pbx_builtin_getvar_helper(chan, "CONF_LIMIT_TIMEOUT_FILE"))) {
var = ast_strdupa(var);
}
ast_channel_unlock(chan);
-
+
end_sound = var ? var : NULL;
-
- /* undo effect of S(x) in case they are both used */
- calldurationlimit = 0;
- /* more efficient do it like S(x) does since no advanced opts */
- if (!play_warning && !end_sound && timelimit) {
- calldurationlimit = timelimit / 1000;
- timelimit = play_warning = warning_freq = 0;
- } else {
- ast_debug(2, "Limit Data for this call:\n");
+
+ /* undo effect of S(x) in case they are both used */
+ calldurationlimit = 0;
+ /* more efficient do it like S(x) does since no advanced opts */
+ if (!play_warning && !end_sound && timelimit) {
+ calldurationlimit = timelimit / 1000;
+ timelimit = play_warning = warning_freq = 0;
+ } else {
+ ast_debug(2, "Limit Data for this call:\n");
ast_debug(2, "- timelimit = %ld\n", timelimit);
- ast_debug(2, "- play_warning = %ld\n", play_warning);
- ast_debug(2, "- warning_freq = %ld\n", warning_freq);
- ast_debug(2, "- warning_sound = %s\n", warning_sound ? warning_sound : "UNDEF");
- ast_debug(2, "- end_sound = %s\n", end_sound ? end_sound : "UNDEF");
- }
- }
+ ast_debug(2, "- play_warning = %ld\n", play_warning);
+ ast_debug(2, "- warning_freq = %ld\n", warning_freq);
+ ast_debug(2, "- warning_sound = %s\n", warning_sound ? warning_sound : "UNDEF");
+ ast_debug(2, "- end_sound = %s\n", end_sound ? end_sound : "UNDEF");
+ }
+ }
/* Get exit keys */
if (ast_test_flag64(confflags, CONFFLAG_KEYEXIT)) {
@@ -2648,7 +2648,7 @@
memset(&dahdic, 0, sizeof(dahdic));
memset(&dahdic_empty, 0, sizeof(dahdic_empty));
/* Check to see if we're in a conference... */
- dahdic.chan = 0;
+ dahdic.chan = 0;
if (ioctl(fd, DAHDI_GETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
@@ -2664,7 +2664,7 @@
}
memset(&dahdic, 0, sizeof(dahdic));
/* Add us to the conference */
- dahdic.chan = 0;
+ dahdic.chan = 0;
dahdic.confno = conf->dahdiconf;
if (!ast_test_flag64(confflags, CONFFLAG_QUIET) && (ast_test_flag64(confflags, CONFFLAG_INTROUSER) ||
@@ -2698,7 +2698,7 @@
dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
else if (ast_test_flag64(confflags, CONFFLAG_TALKER))
dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
- else
+ else
dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
@@ -3569,7 +3569,7 @@
} else if ((f->frametype == AST_FRAME_DTMF) && ast_test_flag64(confflags, CONFFLAG_KEYEXIT) &&
(strchr(exitkeys, f->subclass.integer))) {
pbx_builtin_setvar_helper(chan, "MEETME_EXIT_KEY", dtmfstr);
-
+
if (ast_test_flag64(confflags, CONFFLAG_PASS_DTMF)) {
conf_queue_dtmf(conf, user, f);
}
@@ -3597,12 +3597,12 @@
goto outrun;
break;
default:
- ast_debug(1,
+ ast_debug(1,
"Got ignored control frame on channel %s, f->frametype=%d,f->subclass=%d\n",
chan->name, f->frametype, f->subclass.integer);
}
} else {
- ast_debug(1,
+ ast_debug(1,
"Got unrecognized frame on channel %s, f->frametype=%d,f->subclass=%d\n",
chan->name, f->frametype, f->subclass.integer);
}
@@ -4012,7 +4012,7 @@
AST_LIST_LOCK(&confs);
AST_LIST_TRAVERSE(&confs, cnf, list) {
ast_debug(3, "Does conf %s match %s?\n", confno, cnf->confno);
- if (!strcmp(confno, cnf->confno))
+ if (!strcmp(confno, cnf->confno))
break;
}
if (cnf) {
@@ -6246,7 +6246,7 @@
}
snprintf(conf_name, sizeof(conf_name), "SLA_%s", trunk_ref->trunk->name);
- ast_set_flag64(&conf_flags,
+ ast_set_flag64(&conf_flags,
CONFFLAG_QUIET | CONFFLAG_MARKEDEXIT | CONFFLAG_PASS_DTMF | CONFFLAG_SLA_STATION);
ast_answer(chan);
conf = build_conf(conf_name, "", "", 0, 0, 1, chan, NULL);
Modified: team/pabelanger/issue18556/apps/app_rpt.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue18556/apps/app_rpt.c?view=diff&rev=300387&r1=300386&r2=300387
==============================================================================
--- team/pabelanger/issue18556/apps/app_rpt.c (original)
+++ team/pabelanger/issue18556/apps/app_rpt.c Tue Jan 4 14:09:08 2011
@@ -12495,7 +12495,7 @@
f->data.ptr,f->datalen / 2);
if (n1 != l->wasvox)
{
- if (debug)ast_debug(1,"Link Node %s, vox %d\n",l->name,n1);
+ ast_debug(1,"Link Node %s, vox %d\n",l->name,n1);
l->wasvox = n1;
l->voxtostate = 0;
if (n1) l->voxtotimer = myrpt->p.voxtimeout_ms;
@@ -12844,7 +12844,7 @@
n = dovox(&myrpt->vox,f->data.ptr,f->datalen / 2);
if (n != myrpt->wasvox)
{
- if (debug) ast_debug(1,"Node %s, vox %d\n",myrpt->name,n);
+ ast_debug(1,"Node %s, vox %d\n",myrpt->name,n);
myrpt->wasvox = n;
myrpt->voxtostate = 0;
if (n) myrpt->voxtotimer = myrpt->p.voxtimeout_ms;
Modified: team/pabelanger/issue18556/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue18556/apps/app_voicemail.c?view=diff&rev=300387&r1=300386&r2=300387
==============================================================================
--- team/pabelanger/issue18556/apps/app_voicemail.c (original)
+++ team/pabelanger/issue18556/apps/app_voicemail.c Tue Jan 4 14:09:08 2011
@@ -1212,7 +1212,7 @@
if (!ast_strlen_zero(ext_pass_check_cmd)) {
char cmd[255], buf[255];
- ast_log(AST_LOG_DEBUG, "Verify password policies for %s\n", password);
+ ast_debug(1, "Verify password policies for %s\n", password);
snprintf(cmd, sizeof(cmd), "%s %s %s %s %s", ext_pass_check_cmd, vmu->mailbox, vmu->context, vmu->password, password);
if (vm_check_password_shell(cmd, buf, sizeof(buf))) {
@@ -1754,8 +1754,7 @@
ast_log(LOG_WARNING, "msgnum %d, mailbox message %lu is zero.\n", msgnum, messageNum);
return;
}
- if (option_debug > 2)
- ast_debug(1, "deleting msgnum %d, which is mailbox message %lu\n", msgnum, messageNum);
+ ast_debug(3, "deleting msgnum %d, which is mailbox message %lu\n", msgnum, messageNum);
/* delete message */
snprintf (arg, sizeof(arg), "%lu", messageNum);
ast_mutex_lock(&vms->lock);
@@ -1782,7 +1781,7 @@
if (file)
*file++ = '\0';
else {
- ast_debug (1, "Failed to procure file name from directory passed.\n");
+ ast_debug(1, "Failed to procure file name from directory passed.\n");
return -1;
}
}
@@ -1878,7 +1877,7 @@
res = -1;
goto exit;
}
-
+
make_file(vms->fn, sizeof(vms->fn), dir, msgnum);
snprintf(vms->introfn, sizeof(vms->introfn), "%sintro", vms->fn);
@@ -1888,8 +1887,7 @@
goto exit;
}
- if (option_debug > 2)
- ast_debug(1, "Before mail_fetchheaders, curmsg is: %d, imap messages is %lu\n", msgnum, vms->msgArray[msgnum]);
+ ast_debug(3, "Before mail_fetchheaders, curmsg is: %d, imap messages is %lu\n", msgnum, vms->msgArray[msgnum]);
if (vms->msgArray[msgnum] == 0) {
ast_log(LOG_WARNING, "Trying to access unknown message\n");
res = -1;
@@ -2029,7 +2027,7 @@
return -1;
}
}
-
+
/* No IMAP account available */
if (vmu->imapuser[0] == '\0') {
ast_log(AST_LOG_WARNING, "IMAP user not set for mailbox %s\n", vmu->mailbox);
@@ -2126,7 +2124,7 @@
ast_play_and_wait(chan, "vm-mailboxfull");
return -1;
}
-
+
/* Check if we have exceeded maxmsg */
ast_debug(3, "Checking message number quota: mailbox has %d messages, maximum is set to %d, current messages %d\n", msgnum, vmu->maxmsg, inprocess_count(vmu->mailbox, vmu->context, 0));
if (msgnum >= vmu->maxmsg - inprocess_count(vmu->mailbox, vmu->context, +1)) {
@@ -2178,7 +2176,7 @@
if (msgnum < 0 && !imapgreetings) {
return 0;
}
-
+
if (imap_check_limits(chan, vms, vmu, msgcount)) {
return -1;
}
@@ -2188,7 +2186,7 @@
ast_debug(3, "Setting message flag \\\\FLAGGED.\n");
imap_flags = "\\FLAGGED";
}
-
+
/* Attach only the first format */
fmt = ast_strdupa(fmt);
stringp = fmt;
@@ -2206,7 +2204,7 @@
if (ast_fileexists(introfn, NULL, NULL) <= 0) {
*introfn = '\0';
}
-
+
if (ast_strlen_zero(vmu->email)) {
/* We need the vmu->email to be set when we call make_email_file, but
* if we keep it set, a duplicate e-mail will be created. So at the end
@@ -2278,7 +2276,7 @@
return -1;
}
ast_debug(3, "%s stored\n", fn);
-
+
if (tempcopy)
*(vmu->email) = '\0';
inprocess_count(vmu->mailbox, vmu->context, -1);
@@ -2317,7 +2315,7 @@
/* If no mailbox, return immediately */
if (ast_strlen_zero(mailbox_context))
return 0;
-
+
ast_copy_string(tmp, mailbox_context, sizeof(tmp));
context = strchr(tmp, '@');
if (strchr(mailbox_context, ',')) {
@@ -2499,16 +2497,14 @@
MAILSTREAM *stream = NIL;
long debug;
char tmp[256];
-
+
if (!vms) {
ast_log(LOG_ERROR, "vm_state is NULL!\n");
return -1;
}
- if (option_debug > 2)
- ast_debug(1, "vm_state user is:%s\n", vms->imapuser);
+ ast_debug(3, "vm_state user is:%s\n", vms->imapuser);
if (vms->mailstream == NIL || !vms->mailstream) {
- if (option_debug)
- ast_debug(1, "mailstream not set.\n");
+ ast_debug(1, "mailstream not set.\n");
} else {
stream = vms->mailstream;
}
@@ -2541,8 +2537,7 @@
}
/* Now connect to the target folder */
imap_mailbox_name(tmp, sizeof(tmp), vms, box, 1);
- if (option_debug > 2)
- ast_debug(1, "Before mail_open, server: %s, box:%d\n", tmp, box);
+ ast_debug(3, "Before mail_open, server: %s, box:%d\n", tmp, box);
ast_mutex_lock(&vms->lock);
vms->mailstream = mail_open (stream, tmp, debug ? OP_DEBUG : NIL);
ast_mutex_unlock(&vms->lock);
@@ -2574,9 +2569,9 @@
ast_log(AST_LOG_ERROR, "Could not initialize mailstream\n");
return -1;
}
-
+
create_dirpath(vms->curdir, sizeof(vms->curdir), vmu->context, vms->username, vms->curbox);
-
+
/* Check Quota */
if (box == 0) {
ast_debug(3, "Mailbox name set to: %s, about to check quotas\n", mbox(vmu, box));
@@ -2853,13 +2848,13 @@
char *mailbox = stream->mailbox, *user;
char buf[1024] = "";
unsigned long usage = 0, limit = 0;
-
+
while (pquota) {
usage = pquota->usage;
limit = pquota->limit;
pquota = pquota->next;
}
-
+
if (!(user = get_user_by_mailbox(mailbox, buf, sizeof(buf))) || (!(vms = get_vm_state_by_imapuser(user, 2)) && !(vms = get_vm_state_by_imapuser(user, 0)))) {
ast_log(AST_LOG_ERROR, "No state found.\n");
return;
@@ -2927,8 +2922,7 @@
if ((vms_p = pthread_getspecific(ts_vmstate.key)) && !strcmp(vms_p->imapuser, vmu->imapuser) && !strcmp(vms_p->username, vmu->mailbox)) {
return vms_p;
}
- if (option_debug > 4)
- ast_log(AST_LOG_DEBUG, "Adding new vmstate for %s\n", vmu->imapuser);
+ ast_debug(5, "Adding new vmstate for %s\n", vmu->imapuser);
if (!(vms_p = ast_calloc(1, sizeof(*vms_p))))
return NULL;
ast_copy_string(vms_p->imapuser, vmu->imapuser, sizeof(vms_p->imapuser));
@@ -2937,8 +2931,7 @@
ast_copy_string(vms_p->context, vmu->context, sizeof(vms_p->context));
vms_p->mailstream = NIL; /* save for access from interactive entry point */
vms_p->imapversion = vmu->imapversion;
- if (option_debug > 4)
- ast_log(AST_LOG_DEBUG, "Copied %s to %s\n", vmu->imapuser, vms_p->imapuser);
+ ast_debug(5, "Copied %s to %s\n", vmu->imapuser, vms_p->imapuser);
vms_p->updated = 1;
/* set mailbox to INBOX! */
ast_copy_string(vms_p->curbox, mbox(vmu, 0), sizeof(vms_p->curbox));
@@ -3012,7 +3005,7 @@
}
ast_debug(3, "comparing mailbox %s@%s (i=%d) to vmstate mailbox %s@%s (i=%d)\n", mailbox, local_context, interactive, vlist->vms->username, vlist->vms->context, vlist->vms->interactive);
-
+
if (!strcmp(vlist->vms->username, mailbox) && !strcmp(vlist->vms->context, local_context) && vlist->vms->interactive == interactive) {
ast_debug(3, "Found it!\n");
AST_LIST_UNLOCK(&vmstates);
@@ -3026,7 +3019,7 @@
return NULL;
}
-static void vmstate_insert(struct vm_state *vms)
+static void vmstate_insert(struct vm_state *vms)
{
struct vmstate *v;
struct vm_state *altvms;
@@ -3036,7 +3029,7 @@
We can compare the username to find the duplicate */
if (vms->interactive == 1) {
altvms = get_vm_state_by_mailbox(vms->username, vms->context, 0);
- if (altvms) {
+ if (altvms) {
ast_debug(3, "Duplicate mailbox %s, copying message info...\n", vms->username);
vms->newmessages = altvms->newmessages;
vms->oldmessages = altvms->oldmessages;
@@ -3057,7 +3050,7 @@
if (!(v = ast_calloc(1, sizeof(*v))))
return;
-
+
v->vms = vms;
ast_debug(3, "Inserting vm_state for user:%s, mailbox %s\n", vms->imapuser, vms->username);
@@ -3067,7 +3060,7 @@
AST_LIST_UNLOCK(&vmstates);
}
-static void vmstate_delete(struct vm_state *vms)
+static void vmstate_delete(struct vm_state *vms)
{
struct vmstate *vc = NULL;
struct vm_state *altvms = NULL;
@@ -3084,9 +3077,9 @@
/* Interactive states are not stored within the persistent list */
return;
}
-
+
ast_debug(3, "Removing vm_state for user:%s, mailbox %s\n", vms->imapuser, vms->username);
-
+
AST_LIST_LOCK(&vmstates);
AST_LIST_TRAVERSE_SAFE_BEGIN(&vmstates, vc, list) {
if (vc->vms == vms) {
@@ -3105,7 +3098,7 @@
ast_log(AST_LOG_ERROR, "No vmstate found for user:%s, mailbox %s\n", vms->imapuser, vms->username);
}
-static void set_update(MAILSTREAM * stream)
+static void set_update(MAILSTREAM * stream)
{
struct vm_state *vms;
char *mailbox = stream->mailbox, *user;
@@ -3122,7 +3115,7 @@
vms->updated = 1; /* Set updated flag since mailbox changed */
}
-static void init_vm_state(struct vm_state *vms)
+static void init_vm_state(struct vm_state *vms)
{
int x;
vms->vmArrayIndex = 0;
@@ -3132,7 +3125,7 @@
ast_mutex_init(&vms->lock);
}
-static int save_body(BODY *body, struct vm_state *vms, char *section, char *format, int is_intro)
+static int save_body(BODY *body, struct vm_state *vms, char *section, char *format, int is_intro)
{
char *body_content;
char *body_decoded;
@@ -3140,7 +3133,7 @@
unsigned long len;
unsigned long newlen;
char filename[256];
-
+
if (!body || body == NIL)
return -1;
@@ -3149,9 +3142,9 @@
ast_mutex_unlock(&vms->lock);
if (body_content != NIL) {
snprintf(filename, sizeof(filename), "%s.%s", fn, format);
- /* ast_debug(1,body_content); */
+ /* ast_debug(1, body_content); */
body_decoded = rfc822_base64((unsigned char *) body_content, len, &newlen);
- /* If the body of the file is empty, return an error */
+ /* If the body of the file is empty, return an error */
if (!newlen) {
return -1;
}
@@ -4248,9 +4241,7 @@
strcat(fromfile, ".txt");
}
if (!(msg_cfg = ast_config_load(fromfile, config_flags))) {
- if (option_debug > 0) {
- ast_debug(1, "Config load for message text file '%s' failed\n", fromfile);
- }
+ ast_debug(1, "Config load for message text file '%s' failed\n", fromfile);
return;
}
@@ -4922,7 +4913,7 @@
{
struct ast_tm tm;
struct timeval t = ast_tvnow();
-
+
ast_localtime(&t, &tm, "UTC");
return ast_strftime(s, len, "%a %b %e %r UTC %Y", &tm);
@@ -5653,8 +5644,7 @@
}
/* If maxmsg is zero, act as a "greetings only" voicemail: Exit successfully without recording */
if (vmu->maxmsg == 0) {
- if (option_debug > 2)
- ast_debug(1, "Greetings only VM (maxmsg=0), Skipping voicemail recording\n");
+ ast_debug(3, "Greetings only VM (maxmsg=0), Skipping voicemail recording\n");
pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS");
goto leave_vm_out;
}
@@ -5746,7 +5736,7 @@
}
}
vms->newmessages++;
-
+
/* here is a big difference! We add one to it later */
msgnum = newmsgs + oldmsgs;
ast_debug(3, "Messagecount set to %d\n", msgnum);
@@ -6031,7 +6021,7 @@
/* get the real IMAP message number for this message */
snprintf(sequence, sizeof(sequence), "%ld", vms->msgArray[msg]);
-
+
ast_debug(3, "Copying sequence %s to mailbox %s\n", sequence, mbox(vmu, box));
ast_mutex_lock(&vms->lock);
/* if save to Old folder, put in INBOX as read */
@@ -6049,7 +6039,7 @@
/* Create the folder if it don't exist */
imap_mailbox_name(mailbox, sizeof(mailbox), vms, box, 1); /* Get the full mailbox name */
ast_debug(5, "Checking if folder exists: %s\n", mailbox);
- if (mail_create(vms->mailstream, mailbox) == NIL)
+ if (mail_create(vms->mailstream, mailbox) == NIL)
ast_debug(5, "Folder exists.\n");
else
[... 2748 lines stripped ...]
More information about the asterisk-commits
mailing list