[svn-commits] mnicholson: branch irroot/t38gateway-trunk r324173 - /team/irroot/t38gateway-...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 17 13:08:22 CDT 2011


Author: mnicholson
Date: Fri Jun 17 13:08:18 2011
New Revision: 324173

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=324173
Log:
make spandsp_fax_gateway_process() return proper values and free frames written to gateway techs

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

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=324173&r1=324172&r2=324173
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax.c Fri Jun 17 13:08:18 2011
@@ -2648,13 +2648,11 @@
 				}
 			}
 		case T38_STATE_NEGOTIATED:
-			/*process the gateway packet*/
-			if (s->tech->write(s, f)) {
-				if (event == AST_FRAMEHOOK_EVENT_READ) {
-					ast_frfree(f);
-				}
-				f = &ast_null_frame;
-			}
+			/* XXX perhaps we should check the return value of
+			 * tech->write() */
+			s->tech->write(s, f);
+			ast_frfree(f);
+			f = &ast_null_frame;
 			break;
 		default:
 			ast_debug(1, "Incompatible T.38 State for gateway mode\n");

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=324173&r1=324172&r2=324173
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax_spandsp.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax_spandsp.c Fri Jun 17 13:08:18 2011
@@ -746,18 +746,17 @@
 
 	/*invalid frame*/
 	if (!f->data.ptr || !f->datalen) {
-		return 0;
+		return -1;
 	}
 
 	/* Process a IFP packet */
 	if ((f->frametype == AST_FRAME_MODEM) && (f->subclass.integer == AST_MODEM_T38)) {
-		t38_core_rx_ifp_packet(p->t38_core_state, f->data.ptr, f->datalen, f->seqno);
-		return 1;
+		return t38_core_rx_ifp_packet(p->t38_core_state, f->data.ptr, f->datalen, f->seqno);
 	} else if ((f->frametype == AST_FRAME_VOICE) && (f->subclass.format.id == AST_FORMAT_SLINEAR)) {
-		t38_gateway_rx(&p->t38_gw_state, f->data.ptr, f->samples);
-		return 1;
-	}
-	return 0;
+		return t38_gateway_rx(&p->t38_gw_state, f->data.ptr, f->samples);
+	}
+
+	return -1;
 }
 
 /*! \brief gather data and clean up after gateway ends




More information about the svn-commits mailing list