[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r321552 - in /team/irroot/di...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 2 04:31:39 CDT 2011


Author: irroot
Date: Thu Jun  2 04:31:33 2011
New Revision: 321552

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321552
Log:
Merge Changes Made by mnicholson T.38 Gw

Modified:
    team/irroot/distrotech-customers-trunk/cel/cel_odbc.c   (props changed)
    team/irroot/distrotech-customers-trunk/configs/cel_odbc.conf.sample   (props changed)
    team/irroot/distrotech-customers-trunk/include/asterisk/res_fax.h
    team/irroot/distrotech-customers-trunk/main/frame.c
    team/irroot/distrotech-customers-trunk/res/res_fax.c
    team/irroot/distrotech-customers-trunk/res/res_fax_spandsp.c
    team/irroot/distrotech-customers-trunk/sounds/Makefile   (props changed)

Propchange: team/irroot/distrotech-customers-trunk/cel/cel_odbc.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun  2 04:31:33 2011
@@ -2,4 +2,4 @@
 /team/irroot/app_queue-trunk/cel/cel_odbc.c:318983-319002
 /team/irroot/distrotech-customers/cel/cel_odbc.c:318992-319000
 /team/irroot/distrotech-customers-1.8/cel/cel_odbc.c:319062,319075,321526,321549-321550
-/team/irroot/t38gateway-trunk/cel/cel_odbc.c:318974-319016,319064,319067,319071,319361,320879,321513
+/team/irroot/t38gateway-trunk/cel/cel_odbc.c:318974-319016,319064,319067,319071,319361,320879-321541

Propchange: team/irroot/distrotech-customers-trunk/configs/cel_odbc.conf.sample
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun  2 04:31:33 2011
@@ -2,4 +2,4 @@
 /team/irroot/app_queue-trunk/configs/cel_odbc.conf.sample:318983-319002
 /team/irroot/distrotech-customers/configs/cel_odbc.conf.sample:318992-319000
 /team/irroot/distrotech-customers-1.8/configs/cel_odbc.conf.sample:319062,319075,321526,321549-321550
-/team/irroot/t38gateway-trunk/configs/cel_odbc.conf.sample:318974-319016,319064,319067,319071,319361,320879,321513
+/team/irroot/t38gateway-trunk/configs/cel_odbc.conf.sample:318974-319016,319064,319067,319071,319361,320879-321541

Modified: team/irroot/distrotech-customers-trunk/include/asterisk/res_fax.h
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/include/asterisk/res_fax.h?view=diff&rev=321552&r1=321551&r2=321552
==============================================================================
--- team/irroot/distrotech-customers-trunk/include/asterisk/res_fax.h (original)
+++ team/irroot/distrotech-customers-trunk/include/asterisk/res_fax.h Thu Jun  2 04:31:33 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/distrotech-customers-trunk/main/frame.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/main/frame.c?view=diff&rev=321552&r1=321551&r2=321552
==============================================================================
--- team/irroot/distrotech-customers-trunk/main/frame.c (original)
+++ team/irroot/distrotech-customers-trunk/main/frame.c Thu Jun  2 04:31:33 2011
@@ -381,7 +381,7 @@
 		out->samples = fr->samples;
 		out->offset = fr->offset;
 		/* Copy the timing data */
-		ast_copy_flags(out, fr, AST_FRFLAG_HAS_TIMING_INFO);
+		ast_copy_flags(out, fr, AST_FLAGS_ALL);
 		if (ast_test_flag(fr, AST_FRFLAG_HAS_TIMING_INFO)) {
 			out->ts = fr->ts;
 			out->len = fr->len;
@@ -505,7 +505,7 @@
 		/* Must have space since we allocated for it */
 		strcpy(src, f->src);
 	}
-	ast_copy_flags(out, f, AST_FRFLAG_HAS_TIMING_INFO);
+	ast_copy_flags(out, f, AST_FLAGS_ALL);
 	out->ts = f->ts;
 	out->len = f->len;
 	out->seqno = f->seqno;

Modified: team/irroot/distrotech-customers-trunk/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/res/res_fax.c?view=diff&rev=321552&r1=321551&r2=321552
==============================================================================
--- team/irroot/distrotech-customers-trunk/res/res_fax.c (original)
+++ team/irroot/distrotech-customers-trunk/res/res_fax.c Thu Jun  2 04:31:33 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/distrotech-customers-trunk/res/res_fax_spandsp.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/res/res_fax_spandsp.c?view=diff&rev=321552&r1=321551&r2=321552
==============================================================================
--- team/irroot/distrotech-customers-trunk/res/res_fax_spandsp.c (original)
+++ team/irroot/distrotech-customers-trunk/res/res_fax_spandsp.c Thu Jun  2 04:31:33 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;
@@ -183,7 +182,8 @@
  */
 static int t38_tx_packet_handler(t38_core_state_t *t38_core_state, void *data, const uint8_t *buf, int len, int count)
 {
-	struct spandsp_pvt *p = data;
+	struct ast_fax_session *s = data;
+	struct spandsp_pvt *p = s->tech_pvt;
 	struct ast_frame fax_frame = {
 		.frametype = AST_FRAME_MODEM,
 		.subclass.integer = AST_MODEM_T38,
@@ -202,9 +202,15 @@
 		return -1;
 	}
 
-	if (p->t38_gw_chan) {
-		f->src = AST_GW_GEN_SRC;
-		return ast_write(p->t38_gw_chan, f);
+	if (s->details->caps & AST_FAX_TECH_GATEWAY) {
+		ast_set_flag(f, AST_FAX_FRFLAG_GATEWAY);
+		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 */
@@ -453,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;
@@ -483,7 +488,7 @@
 		}
 
 		/* init t38 stuff */
-		t38_terminal_init(&p->t38_state, caller_mode, t38_tx_packet_handler, p);
+		t38_terminal_init(&p->t38_state, caller_mode, t38_tx_packet_handler, s);
 		set_logging(&p->t38_state.logging, s->details);
 	}
 
@@ -605,8 +610,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));
@@ -656,7 +662,7 @@
 	p->t38_core_state=&p->t38_gw_state.t38;
 #endif
 
-	if (! t38_gateway_init(&p->t38_gw_state, t38_tx_packet_handler, p)) {
+	if (! t38_gateway_init(&p->t38_gw_state, t38_tx_packet_handler, s)) {
 		return -1;
 	}
 
@@ -667,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);
 

Propchange: team/irroot/distrotech-customers-trunk/sounds/Makefile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun  2 04:31:33 2011
@@ -2,4 +2,4 @@
 /team/irroot/app_queue-trunk/sounds/Makefile:318983-319002
 /team/irroot/distrotech-customers/sounds/Makefile:318992-319000
 /team/irroot/distrotech-customers-1.8/sounds/Makefile:319062,319075,321526,321549-321550
-/team/irroot/t38gateway-trunk/sounds/Makefile:318974-319016,319064,319067,319071,319361,320879,321513
+/team/irroot/t38gateway-trunk/sounds/Makefile:318974-319016,319064,319067,319071,319361,320879-321541




More information about the asterisk-commits mailing list