[asterisk-commits] mnicholson: branch irroot/t38gateway-trunk r321532 - in /team/irroot/t38gatew...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 1 12:21:27 CDT 2011


Author: mnicholson
Date: Wed Jun  1 12:21:19 2011
New Revision: 321532

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321532
Log:
use the flags var of frames to signal the framehook to ignore them instead of using frame->src

Modified:
    team/irroot/t38gateway-trunk/include/asterisk/res_fax.h
    team/irroot/t38gateway-trunk/res/res_fax.c
    team/irroot/t38gateway-trunk/res/res_fax_spandsp.c

Modified: team/irroot/t38gateway-trunk/include/asterisk/res_fax.h
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-trunk/include/asterisk/res_fax.h?view=diff&rev=321532&r1=321531&r2=321532
==============================================================================
--- team/irroot/t38gateway-trunk/include/asterisk/res_fax.h (original)
+++ team/irroot/t38gateway-trunk/include/asterisk/res_fax.h Wed Jun  1 12:21:19 2011
@@ -208,7 +208,8 @@
 	struct ast_smoother *smoother;
 };
 
-#define AST_GW_GEN_SRC		"T38_FAX_GATEWAY"
+/* if this overlaps with any AST_FRFLAG_* values, problems will occur */
+#define AST_FAX_FRFLAG_GATEWAY (1 << 13)
 
 /*! \brief used for gateway framehook */
 struct ast_fax_session_gateway {

Modified: team/irroot/t38gateway-trunk/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-trunk/res/res_fax.c?view=diff&rev=321532&r1=321531&r2=321532
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax.c Wed Jun  1 12:21:19 2011
@@ -2508,15 +2508,16 @@
 		return f;
 	}
 
+	/* this frame was generated by the fax gateway, pass it on */
+	if (ast_test_flag(f, AST_FAX_FRFLAG_GATEWAY)) {
+		return f;
+	}
+
 	peer = ast_bridged_channel(chan);
 	s = gateway->s;
 
 	switch (event) {
 		case AST_FRAMEHOOK_EVENT_WRITE:
-			/* If i have been written by the GW gen i must pass it on*/
-			if (f->src && !strcmp(f->src, AST_GW_GEN_SRC)) {
-				return f;
-			}
 			/* when we become active change the formats to SLIN for CED detect and T.30*/
 			if (peer && !gateway->bridged) {
 				ast_format_copy(&gateway->chan_read_format, &chan->readformat);

Modified: team/irroot/t38gateway-trunk/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-trunk/res/res_fax_spandsp.c?view=diff&rev=321532&r1=321531&r2=321532
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax_spandsp.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax_spandsp.c Wed Jun  1 12:21:19 2011
@@ -203,7 +203,7 @@
 	}
 
 	if (p->t38_gw_chan) {
-		f->src = AST_GW_GEN_SRC;
+		ast_set_flag(f, AST_FAX_FRFLAG_GATEWAY);
 		return ast_write(p->t38_gw_chan, f);
 	}
 
@@ -605,8 +605,9 @@
 	struct ast_frame *f;
 	struct ast_frame t30_frame = {
 		.frametype = AST_FRAME_VOICE,
-		.src = AST_GW_GEN_SRC,
+		.src = "res_fax_spandsp_g711",
 		.samples = samples,
+		.flags = AST_FAX_FRFLAG_GATEWAY,
 	};
 
 	AST_FRAME_SET_BUFFER(&t30_frame, buffer, AST_FRIENDLY_OFFSET, t30_frame.samples * sizeof(int16_t));




More information about the asterisk-commits mailing list