Improve func FRAME_TRACE DTMF digit format.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 31 Jan 2013 18:15:49 +0000 (18:15 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 31 Jan 2013 18:15:49 +0000 (18:15 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380655 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_frame_trace.c
main/frame.c

index 45da969..6410d12 100644 (file)
@@ -209,7 +209,8 @@ static void print_frame(struct ast_frame *frame)
        switch (frame->frametype) {
        case AST_FRAME_DTMF_END:
                ast_verbose("FrameType: DTMF END\n");
-               ast_verbose("Digit: %d\n", frame->subclass.integer);
+               ast_verbose("Digit: 0x%02X '%c'\n", frame->subclass.integer,
+                       frame->subclass.integer < ' ' ? ' ' : frame->subclass.integer);
                break;
        case AST_FRAME_VOICE:
                ast_verbose("FrameType: VOICE\n");
@@ -372,7 +373,8 @@ static void print_frame(struct ast_frame *frame)
                break;
        case AST_FRAME_DTMF_BEGIN:
                ast_verbose("FrameType: DTMF BEGIN\n");
-               ast_verbose("Digit: %d\n", frame->subclass.integer);
+               ast_verbose("Digit: 0x%02X '%c'\n", frame->subclass.integer,
+                       frame->subclass.integer < ' ' ? ' ' : frame->subclass.integer);
                break;
        }
 
index ddc74a1..a3f67da 100644 (file)
@@ -692,6 +692,7 @@ void ast_frame_subclass2str(struct ast_frame *f, char *subclass, size_t slen, ch
                break;
        default:
                ast_copy_string(subclass, "Unknown Subclass", slen);
+               break;
        }
 }
 
@@ -734,6 +735,7 @@ void ast_frame_type2str(enum ast_frame_type frame_type, char *ftype, size_t len)
                break;
        default:
                snprintf(ftype, len, "Unknown Frametype '%d'", frame_type);
+               break;
        }
 }