[svn-commits] irroot: branch irroot/distrotech-customers-trunk r333477 - /team/irroot/distr...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Aug 27 02:52:54 CDT 2011


Author: irroot
Date: Sat Aug 27 02:52:51 2011
New Revision: 333477

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=333477
Log:
Fix gwtimeout for faxgateway

Modified:
    team/irroot/distrotech-customers-trunk/res/res_fax.c

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=333477&r1=333476&r2=333477
==============================================================================
--- team/irroot/distrotech-customers-trunk/res/res_fax.c (original)
+++ team/irroot/distrotech-customers-trunk/res/res_fax.c Sat Aug 27 02:52:51 2011
@@ -2446,7 +2446,7 @@
 	ast_dsp_set_faxmode(gateway->peer_dsp, DSP_FAXMODE_DETECT_V21);
 
 	details->caps = AST_FAX_TECH_GATEWAY;
-	if (details->gateway_timeout && !(gateway->s = fax_session_reserve(details, &gateway->token))) {
+	if (!(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);
@@ -2530,7 +2530,6 @@
 
 	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;
@@ -2623,7 +2622,6 @@
 			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) {
@@ -2661,7 +2659,6 @@
 			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);
@@ -2905,9 +2902,7 @@
 			return f;
 		}
 
-		if (details->gateway_timeout) {
-			gateway->timeout_start = ast_tvnow();
-		}
+		gateway->timeout_start = ast_tvnow();
 
 		/* we are bridged, change r/w formats to SLIN for v21 preamble
 		 * detection and T.30 */
@@ -2927,14 +2922,14 @@
 		gateway->bridged = 1;
 	}
 
-	if (gateway->bridged && !ast_tvzero(gateway->timeout_start)) {
+	if (details->gateway_timeout && 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, FAX_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);
 			details->gateway_id = -1;
 
 			ast_string_field_set(details, result, "FAILED");
-			ast_string_field_build(details, resultstr, "no fax activity after %d ms", FAX_GATEWAY_TIMEOUT);
+			ast_string_field_build(details, resultstr, "no fax activity after %d ms", details->gateway_timeout);
 			ast_string_field_set(details, error, "TIMEOUT");
 			set_channel_variables(chan, details);
 			ao2_ref(details, -1);




More information about the svn-commits mailing list