[asterisk-commits] irroot: branch irroot/t38gateway-1.8 r319014 - /team/irroot/t38gateway-1.8/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun May 15 04:04:50 CDT 2011


Author: irroot
Date: Sun May 15 04:04:46 2011
New Revision: 319014

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319014
Log:
We dont need a T.38 gen as there is no timing dependancy.
Change the default of transmit on idle to FALSE this
needs to be configrable via FAXOPT perhaps.


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

Modified: team/irroot/t38gateway-1.8/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-1.8/res/res_fax_spandsp.c?view=diff&rev=319014&r1=319013&r2=319014
==============================================================================
--- team/irroot/t38gateway-1.8/res/res_fax_spandsp.c (original)
+++ team/irroot/t38gateway-1.8/res/res_fax_spandsp.c Sun May 15 04:04:46 2011
@@ -144,6 +144,7 @@
 
 	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;
@@ -199,6 +200,11 @@
 
 	if (!(f = ast_frisolate(f))) {
 		return -1;
+	}
+
+	if (p->t38_gw_chan) {
+		f->src = AST_GW_GEN_SRC;
+		return ast_write(p->t38_gw_chan, f);
 	}
 
 	/* no need to lock, this all runs in the same thread */
@@ -447,6 +453,7 @@
 	}
 
 	AST_LIST_HEAD_INIT(&p->read_frames);
+	p->t38_gw_chan = NULL;
 
 	if (s->details->caps & AST_FAX_TECH_RECEIVE) {
 		caller_mode = 0;
@@ -585,29 +592,6 @@
 	}
 }
 
-/*! \brief generate T.38 packets sent to the T.38 leg of gateway
- * \param chan T.38 channel
- * \param data fax session structure
- * \param len not used
- * \param samples not used
- * \return -1 on failure or 0 on sucess*/
-static int spandsp_fax_gw_t38_gen(struct ast_channel *chan, void *data, int len, int samples)
-{
-	struct ast_frame *f;
-	struct ast_fax_session *s = data;
-	struct spandsp_pvt *p = s->tech_pvt;
-
-	if ((f = AST_LIST_REMOVE_HEAD(&p->read_frames, frame_list))) {
-		f->src = AST_GW_GEN_SRC;
-		if (ast_write(chan, f) < 0) {
-			ast_frfree(f);
-			return -1;
-		}
-		return 0;
-	}
-	return 0;
-}
-
 /*! \brief generate T.30 packets sent to the T.30 leg of gateway
  * \param chan T.30 channel
  * \param data fax session structure
@@ -660,10 +644,6 @@
 	int i;
 	enum ast_t38_state t38state;
 	struct ast_channel *peer;
-	static struct ast_generator t38_gen = {
-		alloc: spandsp_fax_gw_gen_alloc,
-		generate: spandsp_fax_gw_t38_gen,
-	};
 	static struct ast_generator t30_gen = {
 		alloc: spandsp_fax_gw_gen_alloc,
 		generate: spandsp_fax_gw_t30_gen,
@@ -688,8 +668,8 @@
 		ast_channel_unlock(s->chan);
 		return -1;
 	}
-	ast_activate_generator((t38state == T38_STATE_NEGOTIATED)? s->chan : peer, &t38_gen , s);
-	ast_activate_generator((t38state == T38_STATE_NEGOTIATED)? peer : s->chan, &t30_gen , s);
+	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);
 
 	span_log_set_message_handler(&p->t38_gw_state.logging, spandsp_log);
@@ -708,7 +688,7 @@
 			(t38_param->rate_management == AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF)? 1 : 2);
 
 	/* need to be configrable FAXOPT ??*/
-	t38_gateway_set_transmit_on_idle(&p->t38_gw_state, TRUE);
+	t38_gateway_set_transmit_on_idle(&p->t38_gw_state, FALSE);
 	t38_set_sequence_number_handling(p->t38_core_state, TRUE);
 	t38_gateway_set_supported_modems(&p->t38_gw_state, T30_SUPPORT_V27TER | T30_SUPPORT_V17 | T30_SUPPORT_V29);
 




More information about the asterisk-commits mailing list