[asterisk-commits] mnicholson: branch irroot/t38gateway-trunk r321541 - /team/irroot/t38gateway-...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 1 15:22:26 CDT 2011


Author: mnicholson
Date: Wed Jun  1 15:22:20 2011
New Revision: 321541

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321541
Log:
removed usage of t38_gw_chan in favor of ast_queue_frame()

Modified:
    team/irroot/t38gateway-trunk/res/res_fax_spandsp.c

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=321541&r1=321540&r2=321541
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax_spandsp.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax_spandsp.c Wed Jun  1 15:22:20 2011
@@ -144,7 +144,6 @@
 
 	struct spandsp_fax_gw_stats *t38stats;
 	t38_gateway_state_t t38_gw_state;
-	struct ast_channel *t38_gw_chan;
 
 	struct ast_timer *timer;
 	AST_LIST_HEAD(frame_queue, ast_frame) read_frames;
@@ -205,7 +204,13 @@
 
 	if (s->details->caps & AST_FAX_TECH_GATEWAY) {
 		ast_set_flag(f, AST_FAX_FRFLAG_GATEWAY);
-		return ast_write(p->t38_gw_chan, f);
+		if (ast_channel_get_t38_state(s->chan) == T38_STATE_NEGOTIATED) {
+			return ast_write(s->chan, f);
+		} else {
+			int res = ast_queue_frame(s->chan, f);
+			ast_frfree(f);
+			return res;
+		}
 	}
 
 	/* no need to lock, this all runs in the same thread */
@@ -454,7 +459,6 @@
 	}
 
 	AST_LIST_HEAD_INIT(&p->read_frames);
-	p->t38_gw_chan = NULL;
 
 	if (s->details->caps & AST_FAX_TECH_RECEIVE) {
 		caller_mode = 0;
@@ -669,7 +673,6 @@
 		ast_channel_unlock(s->chan);
 		return -1;
 	}
-	p->t38_gw_chan = (t38state == T38_STATE_NEGOTIATED) ? s->chan : peer;
 	ast_activate_generator((t38state == T38_STATE_NEGOTIATED) ? peer : s->chan, &t30_gen , s);
 	ast_channel_unlock(s->chan);
 




More information about the asterisk-commits mailing list