[Asterisk-cvs] asterisk channel.c,1.232,1.233 logger.c,1.78,1.79
kpfleming
kpfleming
Mon Aug 22 17:17:54 CDT 2005
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv9559
Modified Files:
channel.c logger.c
Log Message:
add a LOG_DTMF logging channel and send all bridged DTMF events out that channel (issue #4835)
Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -d -r1.232 -r1.233
--- channel.c 16 Aug 2005 20:37:27 -0000 1.232
+++ channel.c 22 Aug 2005 21:19:59 -0000 1.233
@@ -1966,6 +1966,14 @@
res = 0;
}
}
+
+ /* It's possible this is a translated frame */
+ if (f && f->frametype == AST_FRAME_DTMF) {
+ ast_log(LOG_DTMF, "%s : %c\n", chan->name, f->subclass);
+ } else if (fr->frametype == AST_FRAME_DTMF) {
+ ast_log(LOG_DTMF, "%s : %c\n", chan->name, fr->subclass);
+ }
+
if (f && (f != fr))
ast_frfree(f);
ast_clear_flag(chan, AST_FLAG_BLOCKING);
Index: logger.c
===================================================================
RCS file: /usr/cvsroot/asterisk/logger.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- logger.c 15 Aug 2005 19:35:25 -0000 1.78
+++ logger.c 22 Aug 2005 21:19:59 -0000 1.79
@@ -44,6 +44,7 @@
LOG_NOTICE,
LOG_WARNING,
LOG_ERR,
+ LOG_DEBUG,
LOG_DEBUG
};
@@ -107,7 +108,8 @@
"NOTICE",
"WARNING",
"ERROR",
- "VERBOSE"
+ "VERBOSE",
+ "DTMF"
};
static int colors[] = {
@@ -116,7 +118,8 @@
COLOR_YELLOW,
COLOR_BRRED,
COLOR_RED,
- COLOR_GREEN
+ COLOR_GREEN,
+ COLOR_BRGREEN
};
static int make_components(char *s, int lineno)
@@ -141,6 +144,8 @@
res |= (1 << __LOG_DEBUG);
else if (!strcasecmp(w, "verbose"))
res |= (1 << __LOG_VERBOSE);
+ else if (!strcasecmp(w, "dtmf"))
+ res |= (1 << __LOG_DTMF);
else {
fprintf(stderr, "Logfile Warning: Unknown keyword '%s' at line %d of logger.conf\n", w, lineno);
}
@@ -495,6 +500,8 @@
ast_cli(fd, " - ");
if (chan->logmask & (1 << __LOG_DEBUG))
ast_cli(fd, "Debug ");
+ if (chan->logmask & (1 << __LOG_DTMF))
+ ast_cli(fd, "DTMF ");
if (chan->logmask & (1 << __LOG_VERBOSE))
ast_cli(fd, "Verbose ");
if (chan->logmask & (1 << __LOG_WARNING))
@@ -653,6 +660,9 @@
if (level == __LOG_VERBOSE) {
snprintf(buf, sizeof(buf), "VERBOSE[%ld]: ", (long)GETTID());
level = __LOG_DEBUG;
+ } else if (level == __LOG_DTMF) {
+ snprintf(buf, sizeof(buf), "DTMF[%ld]: ", (long)GETTID());
+ level = __LOG_DEBUG;
} else {
snprintf(buf, sizeof(buf), "%s[%ld]: %s:%d in %s: ",
levels[level], (long)GETTID(), file, line, function);
More information about the svn-commits
mailing list