[asterisk-commits] russell: branch group/vldtmf r39423 - in /team/group/vldtmf: ./ apps/ include...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Aug 8 16:31:23 MST 2006


Author: russell
Date: Tue Aug  8 18:31:22 2006
New Revision: 39423

URL: http://svn.digium.com/view/asterisk?rev=39423&view=rev
Log:
- move frame types to an enum
- define AST_FRAME_DTMF to be the same as AST_FRAME_DTMF_END
- fix a couple places where both DTMF and DTMF_END were listed in a switch

Modified:
    team/group/vldtmf/apps/app_echo.c
    team/group/vldtmf/channel.c
    team/group/vldtmf/include/asterisk/frame.h

Modified: team/group/vldtmf/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/apps/app_echo.c?rev=39423&r1=39422&r2=39423&view=diff
==============================================================================
--- team/group/vldtmf/apps/app_echo.c (original)
+++ team/group/vldtmf/apps/app_echo.c Tue Aug  8 18:31:22 2006
@@ -74,19 +74,13 @@
 		f->delivery.tv_usec = 0;
 		switch (f->frametype) {
 		case AST_FRAME_DTMF:
-		case AST_FRAME_DTMF_END:
 			if (f->subclass == '#') {
 				res = 0;
 				ast_frfree(f);
 				goto end;
 			}
 			/* fall through */
-		case AST_FRAME_DTMF_BEGIN:
-		case AST_FRAME_VOICE:
-		case AST_FRAME_VIDEO:
-		case AST_FRAME_TEXT:
-		case AST_FRAME_HTML:
-		case AST_FRAME_IMAGE:
+		default:
 			if (ast_write(chan, f)) {
 				ast_frfree(f);
 				goto end;

Modified: team/group/vldtmf/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/channel.c?rev=39423&r1=39422&r2=39423&view=diff
==============================================================================
--- team/group/vldtmf/channel.c (original)
+++ team/group/vldtmf/channel.c Tue Aug  8 18:31:22 2006
@@ -2028,8 +2028,8 @@
 				}
 			}
 			break;
-		case AST_FRAME_DTMF:
-			ast_log(LOG_DTMF, "DTMF '%c' received on %s\n", f->subclass, chan->name);
+		case AST_FRAME_DTMF_END:
+			ast_log(LOG_DTMF, "DTMF end '%c' received on %s\n", f->subclass, chan->name);
 			if (ast_test_flag(chan, AST_FLAG_DEFER_DTMF)) {
 				if (strlen(chan->dtmfq) < sizeof(chan->dtmfq) - 2)
 					chan->dtmfq[strlen(chan->dtmfq)] = f->subclass;
@@ -2041,9 +2041,6 @@
 			break;
 		case AST_FRAME_DTMF_BEGIN:
 			ast_log(LOG_DTMF, "DTMF begin '%c' received on %s\n", f->subclass, chan->name);
-			break;
-		case AST_FRAME_DTMF_END:
-			ast_log(LOG_DTMF, "DTMF end '%c' received on %s\n", f->subclass, chan->name);
 			break;
 		case AST_FRAME_VOICE:
 			if (dropaudio) {
@@ -2387,10 +2384,12 @@
 			chan->tech->send_digit_begin(chan, fr->subclass);
 		break;
 	case AST_FRAME_DTMF_END:
+	/* XXX Change this once send_digit_end callbacks are implemented */
+#if 0
 		res = (chan->tech->send_digit_end == NULL) ? 0 :
 			chan->tech->send_digit_end(chan);
 		break;
-	case AST_FRAME_DTMF:
+#endif
 		ast_clear_flag(chan, AST_FLAG_BLOCKING);
 		ast_channel_unlock(chan);
 		res = do_senddigit(chan,fr->subclass);

Modified: team/group/vldtmf/include/asterisk/frame.h
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/include/asterisk/frame.h?rev=39423&r1=39422&r2=39423&view=diff
==============================================================================
--- team/group/vldtmf/include/asterisk/frame.h (original)
+++ team/group/vldtmf/include/asterisk/frame.h Tue Aug  8 18:31:22 2006
@@ -84,11 +84,41 @@
 
 */
 
+/*! Frame types */
+enum ast_frame_type {
+	/*! DTMF end event, subclass is the digit */
+	AST_FRAME_DTMF_END = 1,
+	/*! DTMF begin event, subclass is the digit */
+	AST_FRAME_DTMF_BEGIN,
+	/*! Voice data, subclass is AST_FORMAT_* */
+	AST_FRAME_VOICE,
+	/*! Video frame, maybe?? :) */
+	AST_FRAME_VIDEO,
+	/*! A control frame, subclass is AST_CONTROL_* */
+	AST_FRAME_CONTROL,
+	/*! An empty, useless frame */
+	AST_FRAME_NULL,
+	/*! Inter Asterisk Exchange private frame type */
+	AST_FRAME_IAX,
+	/*! Text messages */
+	AST_FRAME_TEXT,
+	/*! Image Frames */
+	AST_FRAME_IMAGE,
+	/*! HTML Frame */
+	AST_FRAME_HTML,
+	/*! Comfort Noise frame (subclass is level of CNG in -dBov), 
+	    body may include zero or more 8-bit quantization coefficients */
+	AST_FRAME_CNG,
+	/*! Modem-over-IP data streams */
+	AST_FRAME_MODEM,	
+};
+#define AST_FRAME_DTMF AST_FRAME_DTMF_END
+
 /*! \brief Data structure associated with a single frame of data
  */
 struct ast_frame {
 	/*! Kind of frame */
-	int frametype;				
+	enum ast_frame_type frametype;				
 	/*! Subclass, frame dependent */
 	int subclass;				
 	/*! Length of data */
@@ -149,35 +179,6 @@
 #define AST_MALLOCD_DATA	(1 << 1)
 /*! Need the source be free'd? (haha!) */
 #define AST_MALLOCD_SRC		(1 << 2)
-
-/* Frame types */
-/*! A DTMF digit, subclass is the digit */
-#define AST_FRAME_DTMF		1
-/*! Voice data, subclass is AST_FORMAT_* */
-#define AST_FRAME_VOICE		2
-/*! Video frame, maybe?? :) */
-#define AST_FRAME_VIDEO		3
-/*! A control frame, subclass is AST_CONTROL_* */
-#define AST_FRAME_CONTROL	4
-/*! An empty, useless frame */
-#define AST_FRAME_NULL		5
-/*! Inter Asterisk Exchange private frame type */
-#define AST_FRAME_IAX		6
-/*! Text messages */
-#define AST_FRAME_TEXT		7
-/*! Image Frames */
-#define AST_FRAME_IMAGE		8
-/*! HTML Frame */
-#define AST_FRAME_HTML		9
-/*! Comfort Noise frame (subclass is level of CNG in -dBov), 
-    body may include zero or more 8-bit quantization coefficients */
-#define AST_FRAME_CNG		10
-/*! Modem-over-IP data streams */
-#define AST_FRAME_MODEM		11
-/*! DTMF begin event, subclass is the digit */
-#define AST_FRAME_DTMF_BEGIN	12
-/*! DTMF end event, subclass is the digit */
-#define AST_FRAME_DTMF_END	13
 
 /* MODEM subclasses */
 /*! T.38 Fax-over-IP */



More information about the asterisk-commits mailing list