aboutsummaryrefslogtreecommitdiffstats
path: root/frame.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-01 23:05:28 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-01 23:05:28 +0000
commit21d21f89c04ebaad6822311ceadd13275b357513 (patch)
tree86a6664b5cba70b924fdd1cef2ecbf93226e7d58 /frame.c
parent4d4470fe1560a6d00b17db78798f0cc9790fe74b (diff)
use string fields for some stuff in ast_channel
const-ify some more APIs remove 'type' field from ast_channel, in favor of the one in the channel's tech structure allow string field module users to specify the 'chunk size' for pool allocations update chan_alsa to be compatible with recent const-ification patches git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9060 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'frame.c')
-rw-r--r--frame.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/frame.c b/frame.c
index d640e0772..d88a4deb5 100644
--- a/frame.c
+++ b/frame.c
@@ -655,9 +655,9 @@ static char frame_show_codec_n_usage[] =
" Displays codec mapping\n";
/*! Dump a frame for debugging purposes */
-void ast_frame_dump(char *name, struct ast_frame *f, char *prefix)
+void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
{
- char *n = "unknown";
+ const char noname[] = "unknown";
char ftype[40] = "Unknown Frametype";
char cft[80];
char subclass[40] = "Unknown Subclass";
@@ -666,13 +666,16 @@ void ast_frame_dump(char *name, struct ast_frame *f, char *prefix)
char cn[60];
char cp[40];
char cmn[40];
- if (name)
- n = name;
+
+ if (!name)
+ name = noname;
+
+
if (!f) {
ast_verbose("%s [ %s (NULL) ] [%s]\n",
term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
term_color(cft, "HANGUP", COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
- term_color(cn, n, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
+ term_color(cn, name, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
return;
}
/* XXX We should probably print one each of voice and video when the format changes XXX */
@@ -795,22 +798,21 @@ void ast_frame_dump(char *name, struct ast_frame *f, char *prefix)
}
if (!ast_strlen_zero(moreinfo))
ast_verbose("%s [ TYPE: %s (%d) SUBCLASS: %s (%d) '%s' ] [%s]\n",
- term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
- term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
- f->frametype,
- term_color(csub, subclass, COLOR_BRCYAN, COLOR_BLACK, sizeof(csub)),
- f->subclass,
- term_color(cmn, moreinfo, COLOR_BRGREEN, COLOR_BLACK, sizeof(cmn)),
- term_color(cn, n, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
+ term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
+ term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
+ f->frametype,
+ term_color(csub, subclass, COLOR_BRCYAN, COLOR_BLACK, sizeof(csub)),
+ f->subclass,
+ term_color(cmn, moreinfo, COLOR_BRGREEN, COLOR_BLACK, sizeof(cmn)),
+ term_color(cn, name, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
else
ast_verbose("%s [ TYPE: %s (%d) SUBCLASS: %s (%d) ] [%s]\n",
- term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
- term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
- f->frametype,
- term_color(csub, subclass, COLOR_BRCYAN, COLOR_BLACK, sizeof(csub)),
- f->subclass,
- term_color(cn, n, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
-
+ term_color(cp, prefix, COLOR_BRMAGENTA, COLOR_BLACK, sizeof(cp)),
+ term_color(cft, ftype, COLOR_BRRED, COLOR_BLACK, sizeof(cft)),
+ f->frametype,
+ term_color(csub, subclass, COLOR_BRCYAN, COLOR_BLACK, sizeof(csub)),
+ f->subclass,
+ term_color(cn, name, COLOR_YELLOW, COLOR_BLACK, sizeof(cn)));
}