[asterisk-commits] russell: branch russell/chan_console r72849 - /team/russell/chan_console/chan...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Jul 1 21:45:09 CDT 2007
Author: russell
Date: Sun Jul 1 21:45:08 2007
New Revision: 72849
URL: http://svn.digium.com/view/asterisk?view=rev&rev=72849
Log:
simplify the text in ast_verbose calls
Modified:
team/russell/chan_console/channels/chan_console.c
Modified: team/russell/chan_console/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_console.c?view=diff&rev=72849&r1=72848&r2=72849
==============================================================================
--- team/russell/chan_console/channels/chan_console.c (original)
+++ team/russell/chan_console/channels/chan_console.c Sun Jul 1 21:45:08 2007
@@ -41,7 +41,7 @@
* answer CLI command
* flash CLI command
* transfer CLI command
- * autoanswer CLI command (maybe general settings CLIcommand, instead?)
+ * autoanswer CLI command (maybe general settings CLI command, instead?)
* boost CLI command
* active CLI command
*/
@@ -106,6 +106,9 @@
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
+
+#define V_BEGIN " --- <(\"<) --- "
+#define V_END " --- (>\")> ---\n"
static const char config_file[] = "console.conf";
@@ -341,14 +344,14 @@
static int console_digit_begin(struct ast_channel *c, char digit)
{
- ast_verbose(" --- <(\"<) --- Console Received Beginning of Digit %c --- (>\")> ---\n", digit);
+ ast_verbose(V_BEGIN "Console Received Beginning of Digit %c" V_END, digit);
return 0;
}
static int console_digit_end(struct ast_channel *c, char digit, unsigned int duration)
{
- ast_verbose(" --- <(\"<) --- Console Received End of Digit %c (duration %u) --- (>\")> ---\n",
+ ast_verbose(V_BEGIN "Console Received End of Digit %c (duration %u)" V_END,
digit, duration);
return 0;
@@ -356,7 +359,7 @@
static int console_text(struct ast_channel *c, const char *text)
{
- ast_verbose(" --- <(\"<) --- Console Received Text '%s' --- (>\")> ---\n", text);
+ ast_verbose(V_BEGIN "Console Received Text '%s'" V_END, text);
return 0;
}
@@ -367,7 +370,7 @@
if (sound == -1) {
pvt->cursound = -1;
- ast_verbose(" --- <(\"<) --- Sound stopped --- (>\")> ---\n");
+ ast_verbose(V_BEGIN "Sound stopped" V_END);
return;
}
@@ -377,17 +380,17 @@
}
if (pvt->cursound > -1)
- ast_verbose(" --- <(\"<) --- Sound playing should be '%s' --- (>\")> ---\n",
+ ast_verbose(V_BEGIN "Sound playing should be '%s'" V_END,
sounds[pvt->cursound].desc);
else
- ast_verbose(" --- <(\"<) --- Unknown sound requested on the console! --- (>\")> ---\n");
+ ast_verbose(V_BEGIN "Unknown sound requested on the console!" V_END);
}
static int console_hangup(struct ast_channel *c)
{
struct console_pvt *pvt = &console_pvt;
- ast_verbose(" --- <(\"<) --- Hangup on Console --- (>\")> ---\n");
+ ast_verbose(V_BEGIN "Hangup on Console" V_END);
pvt->hookstate = 0;
set_cursound(pvt, -1);
@@ -413,7 +416,7 @@
int res;
struct console_pvt *pvt = &console_pvt;
- ast_verbose(" --- <(\"<) --- Call from Console has been Answered --- (>\")> ---\n");
+ ast_verbose(V_BEGIN "Call from Console has been Answered" V_END);
ast_mutex_lock(&pvt->lock);
ast_setstate(c, AST_STATE_UP);
@@ -436,17 +439,17 @@
struct ast_frame f = { 0, };
struct console_pvt *pvt = &console_pvt;
- ast_verbose(" --- <(\"<) --- Call to device '%s' on console from '%s' <%s> --- (>\")> ---\n",
+ ast_verbose(V_BEGIN "Call to device '%s' on console from '%s' <%s>" V_END,
dest, c->cid.cid_name, c->cid.cid_num);
if (pvt->autoanswer) {
- ast_verbose(" --- <(\"<) --- Auto-answered --- (>\")> --- \n");
+ ast_verbose(V_BEGIN "Auto-answered" V_END);
pvt->hookstate = 1;
f.frametype = AST_FRAME_CONTROL;
f.subclass = AST_CONTROL_ANSWER;
ast_queue_frame(c, &f);
} else {
- ast_verbose(" --- <(\"<) --- Type 'answer' to answer, or use 'autoanswer' for future calls --- (>\")> ---\n");
+ ast_verbose(V_BEGIN "Type 'answer' to answer, or use 'autoanswer' for future calls" V_END);
f.frametype = AST_FRAME_CONTROL;
f.subclass = AST_CONTROL_RINGING;
ast_queue_frame(c, &f);
@@ -486,11 +489,11 @@
set_cursound(pvt, -1);
break;
case AST_CONTROL_HOLD:
- ast_verbose(" --- <(\"<) --- Console Has Been Placed on Hold --- (>\")> --- \n");
+ ast_verbose(V_BEGIN "Console Has Been Placed on Hold" V_END);
ast_moh_start(chan, data, pvt->mohinterpret);
break;
case AST_CONTROL_UNHOLD:
- ast_verbose(" --- <(\"<) --- Console Has Been Retrieved from Hold --- (>\")> --- \n");
+ ast_verbose(V_BEGIN "Console Has Been Retrieved from Hold" V_END);
ast_moh_stop(chan);
break;
default:
@@ -807,7 +810,7 @@
else
return CLI_SHOWUSAGE;
- ast_verbose(" --- <(\"<) --- The Console is now %s --- (>\")> ---\n",
+ ast_verbose(V_BEGIN "The Console is now %s" V_END,
pvt->muted ? "Muted" : "Unmuted");
return CLI_SUCCESS;
More information about the asterisk-commits
mailing list