- Logging clean up

- Whitespace removed and added, formatting fixed


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Olle Johansson 20 years ago
parent 242a478023
commit 95144f75a5

@ -425,7 +425,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
ast_goto_if_exists(in, in->context, in->exten, in->priority + 101); ast_goto_if_exists(in, in->context, in->exten, in->priority + 101);
} else { } else {
if (option_verbose > 2) if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_2 "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, numbusy, numcongestion, numnochan); ast_verbose(VERBOSE_PREFIX_3 "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, numbusy, numcongestion, numnochan);
} }
*to = 0; *to = 0;
return NULL; return NULL;
@ -631,22 +631,24 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
} }
break; break;
default: default:
if (option_debug)
ast_log(LOG_DEBUG, "Dunno what to do with control type %d\n", f->subclass); ast_log(LOG_DEBUG, "Dunno what to do with control type %d\n", f->subclass);
} }
} else if (single && (f->frametype == AST_FRAME_VOICE) && } else if (single && (f->frametype == AST_FRAME_VOICE) &&
!(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) { !(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) {
if (ast_write(in, f)) if (ast_write(in, f))
ast_log(LOG_DEBUG, "Unable to forward frame\n"); ast_log(LOG_WARNING, "Unable to forward voice frame\n");
} else if (single && (f->frametype == AST_FRAME_IMAGE) && } else if (single && (f->frametype == AST_FRAME_IMAGE) &&
!(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) { !(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) {
if (ast_write(in, f)) if (ast_write(in, f))
ast_log(LOG_DEBUG, "Unable to forward image\n"); ast_log(LOG_WARNING, "Unable to forward image\n");
} else if (single && (f->frametype == AST_FRAME_TEXT) && } else if (single && (f->frametype == AST_FRAME_TEXT) &&
!(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) { !(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) {
if (ast_write(in, f)) if (ast_write(in, f))
ast_log(LOG_DEBUG, "Unable to text\n"); ast_log(LOG_WARNING, "Unable to send text\n");
} else if (single && (f->frametype == AST_FRAME_HTML) && !ast_test_flag(outgoing, DIAL_NOFORWARDHTML)) } else if (single && (f->frametype == AST_FRAME_HTML) && !ast_test_flag(outgoing, DIAL_NOFORWARDHTML))
ast_channel_sendhtml(in, f->subclass, f->data, f->datalen); if(ast_channel_sendhtml(in, f->subclass, f->data, f->datalen) == -1)
ast_log(LOG_WARNING, "Unable to send URL\n");
ast_frfree(f); ast_frfree(f);
} else { } else {
@ -679,7 +681,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
if (ast_test_flag(peerflags, OPT_DTMF_EXIT)) { if (ast_test_flag(peerflags, OPT_DTMF_EXIT)) {
context = pbx_builtin_getvar_helper(in, "EXITCONTEXT"); context = pbx_builtin_getvar_helper(in, "EXITCONTEXT");
if (onedigit_goto(in, context, (char) f->subclass, 1)) { if (onedigit_goto(in, context, (char) f->subclass, 1)) {
if (option_verbose > 3) if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass); ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
*to=0; *to=0;
*result = f->subclass; *result = f->subclass;
@ -690,8 +692,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
} }
if (ast_test_flag(peerflags, OPT_CALLER_HANGUP) && if (ast_test_flag(peerflags, OPT_CALLER_HANGUP) &&
(f->subclass == '*')) { /* hmm it it not guarenteed to be '*' anymore. */ (f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */
if (option_verbose > 3) if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass); ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
*to=0; *to=0;
strcpy(status, "CANCEL"); strcpy(status, "CANCEL");
@ -702,7 +704,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
/* Forward HTML stuff */ /* Forward HTML stuff */
if (single && f && (f->frametype == AST_FRAME_HTML) && !ast_test_flag(outgoing, DIAL_NOFORWARDHTML)) if (single && f && (f->frametype == AST_FRAME_HTML) && !ast_test_flag(outgoing, DIAL_NOFORWARDHTML))
ast_channel_sendhtml(outgoing->chan, f->subclass, f->data, f->datalen); if(ast_channel_sendhtml(outgoing->chan, f->subclass, f->data, f->datalen) == -1)
ast_log(LOG_WARNING, "Unable to send URL\n");
if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF))) { if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF))) {
@ -922,6 +925,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
} }
if(privdb_val == AST_PRIVACY_DENY ) { if(privdb_val == AST_PRIVACY_DENY ) {
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Privacy DB reports PRIVACY_DENY for this callerid. Dial reports unavailable\n"); ast_verbose( VERBOSE_PREFIX_3 "Privacy DB reports PRIVACY_DENY for this callerid. Dial reports unavailable\n");
res=0; res=0;
goto out; goto out;
@ -1011,7 +1015,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
tmp->chan = ast_request(tech, chan->nativeformats, numsubst, &cause); tmp->chan = ast_request(tech, chan->nativeformats, numsubst, &cause);
if (!tmp->chan) { if (!tmp->chan) {
/* If we can't, just go on to the next call */ /* If we can't, just go on to the next call */
ast_log(LOG_NOTICE, "Unable to create channel of type '%s' (cause %d - %s)\n", tech, cause, ast_cause2str(cause)); ast_log(LOG_WARNING, "Unable to create channel of type '%s' (cause %d - %s)\n", tech, cause, ast_cause2str(cause));
HANDLE_CAUSE(cause, chan); HANDLE_CAUSE(cause, chan);
cur = rest; cur = rest;
if (!cur) if (!cur)
@ -1202,6 +1206,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
number = numsubst; number = numsubst;
pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", number); pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", number);
if (!ast_strlen_zero(args.url) && ast_channel_supports_html(peer) ) { if (!ast_strlen_zero(args.url) && ast_channel_supports_html(peer) ) {
if (option_debug)
ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", args.url); ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", args.url);
ast_channel_sendurl( peer, args.url ); ast_channel_sendurl( peer, args.url );
} }
@ -1250,7 +1255,8 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if( ast_test_flag(&opts, OPT_SCREENING) ) if( ast_test_flag(&opts, OPT_SCREENING) )
res2 = ast_play_and_wait(peer,"screen-callee-options"); res2 = ast_play_and_wait(peer,"screen-callee-options");
} }
/* priv-callee-options script: /*! \page DialPrivacy Dial Privacy scripts
\par priv-callee-options script:
"Dial 1 if you wish this caller to reach you directly in the future, "Dial 1 if you wish this caller to reach you directly in the future,
and immediately connect to their incoming call and immediately connect to their incoming call
Dial 2 if you wish to send this caller to voicemail now and Dial 2 if you wish to send this caller to voicemail now and
@ -1259,9 +1265,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
Dial 4 to send this caller to a simple "go away" menu, now and forevermore. Dial 4 to send this caller to a simple "go away" menu, now and forevermore.
Dial 5 to allow this caller to come straight thru to you in the future, Dial 5 to allow this caller to come straight thru to you in the future,
but right now, just this once, send them to voicemail." but right now, just this once, send them to voicemail."
*/ \par screen-callee-options script:
/* screen-callee-options script:
"Dial 1 if you wish to immediately connect to the incoming call "Dial 1 if you wish to immediately connect to the incoming call
Dial 2 if you wish to send this caller to voicemail. Dial 2 if you wish to send this caller to voicemail.
Dial 3 to send this callerr to the torture menus. Dial 3 to send this callerr to the torture menus.
@ -1361,7 +1365,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
/* well, there seems basically two choices. Just patch the caller thru immediately, /* well, there seems basically two choices. Just patch the caller thru immediately,
or,... put 'em thru to voicemail. */ or,... put 'em thru to voicemail. */
/* since the callee may have hung up, let's do the voicemail thing, no database decision */ /* since the callee may have hung up, let's do the voicemail thing, no database decision */
if (option_verbose > 2)
ast_log(LOG_NOTICE, "privacy: no valid response from the callee. Sending the caller to voicemail, the callee isn't responding\n"); ast_log(LOG_NOTICE, "privacy: no valid response from the callee. Sending the caller to voicemail, the callee isn't responding\n");
if (ast_test_flag(&opts, OPT_MUSICBACK)) { if (ast_test_flag(&opts, OPT_MUSICBACK)) {
ast_moh_stop(chan); ast_moh_stop(chan);
@ -1590,6 +1593,7 @@ out:
} }
hanguptree(outgoing, NULL); hanguptree(outgoing, NULL);
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status); pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
if (option_debug)
ast_log(LOG_DEBUG, "Exiting with DIALSTATUS=%s.\n", status); ast_log(LOG_DEBUG, "Exiting with DIALSTATUS=%s.\n", status);
if ((ast_test_flag(peerflags, OPT_GO_ON)) && (!chan->_softhangup) && (res != AST_PBX_KEEPALIVE)) if ((ast_test_flag(peerflags, OPT_GO_ON)) && (!chan->_softhangup) && (res != AST_PBX_KEEPALIVE))

Loading…
Cancel
Save