[asterisk-commits] irroot: branch irroot/t38gateway-trunk r336162 - /team/irroot/t38gateway-trun...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 16 02:09:23 CDT 2011


Author: irroot
Date: Fri Sep 16 02:09:21 2011
New Revision: 336162

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=336162
Log:
Remove discarded gwtimeout changes in t38gateway-trunk

Modified:
    team/irroot/t38gateway-trunk/res/res_fax.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=336162&r1=336161&r2=336162
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax.c Fri Sep 16 02:09:21 2011
@@ -2443,7 +2443,7 @@
 	ast_dsp_set_faxmode(gateway->peer_dsp, DSP_FAXMODE_DETECT_V21);
 
 	details->caps = AST_FAX_TECH_GATEWAY;
-	if (!(gateway->s = fax_session_reserve(details, &gateway->token))) {
+	if (details->gateway_timeout && !(gateway->s = fax_session_reserve(details, &gateway->token))) {
 		details->caps |= ~AST_FAX_TECH_GATEWAY;
 		ast_log(LOG_ERROR, "Can't reserve a FAX session, gateway attempt failed.\n");
 		ao2_ref(gateway, -1);
@@ -2527,6 +2527,7 @@
 
 	gateway->t38_state = T38_STATE_NEGOTIATING;
 	gateway->timeout_start = ast_tvnow();
+	details->gateway_timeout = FAX_GATEWAY_TIMEOUT;
 
 	ast_debug(1, "requesting T.38 for gateway session for %s\n", chan->name);
 	return fp;
@@ -2619,6 +2620,7 @@
 			t38_parameters_ast_to_fax(&details->their_t38_parameters, control_params);
 			gateway->t38_state = T38_STATE_UNKNOWN;
 			gateway->timeout_start = ast_tvnow();
+			details->gateway_timeout = FAX_GATEWAY_TIMEOUT;
 			ao2_ref(details, -1);
 			return f;
 		} else if (state == T38_STATE_UNAVAILABLE || state == T38_STATE_REJECTED) {
@@ -2656,6 +2658,7 @@
 			t38_parameters_ast_to_fax(&details->their_t38_parameters, control_params);
 			gateway->t38_state = T38_STATE_UNKNOWN;
 			gateway->timeout_start = ast_tvnow();
+			details->gateway_timeout = FAX_GATEWAY_TIMEOUT;
 
 			ast_debug(1, "%s is attempting to negotiate T.38 after we already sent a negotiation request based on v21 preamble detection\n", active->name);
 			ao2_ref(details, -1);
@@ -2899,7 +2902,9 @@
 			return f;
 		}
 
-		gateway->timeout_start = ast_tvnow();
+		if (details->gateway_timeout) {
+			gateway->timeout_start = ast_tvnow();
+		}
 
 		/* we are bridged, change r/w formats to SLIN for v21 preamble
 		 * detection and T.30 */
@@ -2919,7 +2924,7 @@
 		gateway->bridged = 1;
 	}
 
-	if (details->gateway_timeout && gateway->bridged && !ast_tvzero(gateway->timeout_start)) {
+	if (gateway->bridged && !ast_tvzero(gateway->timeout_start)) {
 		if (ast_tvdiff_ms(ast_tvnow(), gateway->timeout_start) > details->gateway_timeout) {
 			ast_debug(1, "no fax activity between %s and %s after %d ms, disabling gateway\n", chan->name, peer->name, details->gateway_timeout);
 			ast_framehook_detach(chan, gateway->framehook);




More information about the asterisk-commits mailing list