[asterisk-commits] dvossel: branch dvossel/awesomehooks r287268 - /team/dvossel/awesomehooks/funcs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 16 17:35:34 CDT 2010


Author: dvossel
Date: Thu Sep 16 17:35:31 2010
New Revision: 287268

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=287268
Log:
func_awesome_trace update

Modified:
    team/dvossel/awesomehooks/funcs/func_awesome_trace.c

Modified: team/dvossel/awesomehooks/funcs/func_awesome_trace.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/awesomehooks/funcs/func_awesome_trace.c?view=diff&rev=287268&r1=287267&r2=287268
==============================================================================
--- team/dvossel/awesomehooks/funcs/func_awesome_trace.c (original)
+++ team/dvossel/awesomehooks/funcs/func_awesome_trace.c Thu Sep 16 17:35:31 2010
@@ -36,8 +36,152 @@
 
 static struct ast_frame *awesome_trace_event_cb(struct ast_channel *chan, struct ast_frame *frame, enum ast_awesomehook_event event, void *datastore)
 {
-
-	//todohere, print out the frame
+	if (!frame) {
+		return frame;
+	}
+
+	if ((event != AST_AWESOMEHOOK_EVENT_WRITE) && (event != AST_AWESOMEHOOK_EVENT_READ)) {
+		return frame;
+	}
+
+	ast_verbose("%s on Channel %s\n", event == AST_AWESOMEHOOK_EVENT_READ ? "<--Read" : "--> Write", chan->name);
+
+	switch (frame->frametype) {
+	case AST_FRAME_DTMF_END:
+		ast_verbose("FrameType: DTMF END\n");
+		break;
+	case AST_FRAME_VOICE:
+		ast_verbose("FrameType: VOICE\n");
+		ast_verbose("Codec: %s\n", ast_getformatname(frame->subclass.codec));
+		ast_verbose("MS: %ld\n", frame->len);
+		ast_verbose("Samples: %d\n", frame->samples);
+		ast_verbose("Bytes: %d\n", frame->datalen);
+		break;
+	case AST_FRAME_VIDEO:
+		ast_verbose("FrameType: VIDEO\n");
+		break;
+	case AST_FRAME_CONTROL:
+		ast_verbose("FrameType: CONTROL\n");
+		switch (frame->subclass.integer) {
+		case AST_CONTROL_HANGUP:
+			ast_verbose("SubClass: HANGUP\n");
+		break;
+		case AST_CONTROL_RING:
+			ast_verbose("SubClass: RING\n");
+		break;
+		case AST_CONTROL_RINGING:
+			ast_verbose("SubClass: RINGING\n");
+		break;
+		case AST_CONTROL_ANSWER:
+			ast_verbose("SubClass: ANSWER\n");
+		break;
+		case AST_CONTROL_BUSY:
+			ast_verbose("SubClass: BUSY\n");
+		break;
+		case AST_CONTROL_TAKEOFFHOOK:
+			ast_verbose("SubClass: TAKEOFFHOOK\n");
+		break;
+		case AST_CONTROL_OFFHOOK:
+			ast_verbose("SubClass: OFFHOOK\n");
+		break;
+		case AST_CONTROL_CONGESTION:
+			ast_verbose("SubClass: CONGESTION\n");
+		break;
+		case AST_CONTROL_FLASH:
+			ast_verbose("SubClass: FLASH\n");
+		break;
+		case AST_CONTROL_WINK:
+			ast_verbose("SubClass: WINK\n");
+		break;
+		case AST_CONTROL_OPTION:
+			ast_verbose("SubClass: OPTION\n");
+		break;
+		case AST_CONTROL_RADIO_KEY:
+			ast_verbose("SubClass: RADIO KEY\n");
+		break;
+		case AST_CONTROL_RADIO_UNKEY:
+			ast_verbose("SubClass: RADIO UNKEY\n");
+		break;
+		case AST_CONTROL_PROGRESS:
+			ast_verbose("SubClass: PROGRESS\n");
+		break;
+		case AST_CONTROL_PROCEEDING:
+			ast_verbose("SubClass: PROCEEDING\n");
+		break;
+		case AST_CONTROL_HOLD:
+			ast_verbose("SubClass: HOLD\n");
+		break;
+		case AST_CONTROL_UNHOLD:
+			ast_verbose("SubClass: UNHOLD\n");
+		break;
+		case AST_CONTROL_VIDUPDATE:
+			ast_verbose("SubClass: VIDUPDATE\n");
+		break;
+		case _XXX_AST_CONTROL_T38:
+			ast_verbose("SubClass: XXX T38\n");
+		break;
+		case AST_CONTROL_SRCUPDATE:
+			ast_verbose("SubClass: SRCUPDATE\n");
+		break;
+		case AST_CONTROL_TRANSFER:
+			ast_verbose("SubClass: TRANSFER\n");
+		break;
+		case AST_CONTROL_CONNECTED_LINE:
+			ast_verbose("SubClass: CONNECTED LINE\n");
+		break;
+		case AST_CONTROL_REDIRECTING:
+			ast_verbose("SubClass: REDIRECTING\n");
+		break;
+		case AST_CONTROL_T38_PARAMETERS:
+			ast_verbose("SubClass: T38 PARAMETERS\n");
+		break;
+		case AST_CONTROL_CC:
+			ast_verbose("SubClass: CC\n");
+		break;
+		case AST_CONTROL_SRCCHANGE:
+			ast_verbose("SubClass: SRCCHANGE\n");
+		break;
+		case AST_CONTROL_READ_ACTION:
+			ast_verbose("SubClass: READ ACTION\n");
+		break;
+		case AST_CONTROL_AOC:
+			ast_verbose("SubClass: AOC\n");
+		break;
+		default:
+			ast_verbose("SubClass: Unknown\n");
+		}
+		break;
+	case AST_FRAME_NULL:
+		ast_verbose("FrameType: NULL\n");
+		break;
+	case AST_FRAME_IAX:
+		ast_verbose("FrameType: IAX\n");
+		break;
+	case AST_FRAME_TEXT:
+		ast_verbose("FrameType: TXT\n");
+		break;
+	case AST_FRAME_IMAGE:
+		ast_verbose("FrameType: IMAGE\n");
+		break;
+	case AST_FRAME_HTML:
+		ast_verbose("FrameType: HTML\n");
+		break;
+	case AST_FRAME_CNG:
+		ast_verbose("FrameType: CNG\n");
+		break;
+	case AST_FRAME_MODEM:
+		ast_verbose("FrameType: MODEM\n");
+		break;
+	case AST_FRAME_DTMF_BEGIN:
+		ast_verbose("FrameType: DTMF BEGIN\n");
+		break;
+	default:
+		ast_verbose("FrameType: Unknown\n");
+	}
+
+	ast_verbose("Src: %s\n", ast_strlen_zero(frame->src) ? "NOT PRESENT" : frame->src);
+
+	ast_verbose("\n");
 	return frame;
 }
 




More information about the asterisk-commits mailing list