[asterisk-commits] irroot: branch irroot/distrotech-customers-10 r333481 - /team/irroot/distrote...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Aug 27 03:08:05 CDT 2011
Author: irroot
Date: Sat Aug 27 03:08:01 2011
New Revision: 333481
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=333481
Log:
T38 Gateway gwtimeout option fixup RB1385
Modified:
team/irroot/distrotech-customers-10/res/res_fax.c
Modified: team/irroot/distrotech-customers-10/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-10/res/res_fax.c?view=diff&rev=333481&r1=333480&r2=333481
==============================================================================
--- team/irroot/distrotech-customers-10/res/res_fax.c (original)
+++ team/irroot/distrotech-customers-10/res/res_fax.c Sat Aug 27 03:08:01 2011
@@ -2423,7 +2423,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);
@@ -2507,7 +2507,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;
@@ -2600,7 +2599,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) {
@@ -2638,7 +2636,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);
@@ -2882,9 +2879,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 */
@@ -2904,14 +2899,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 asterisk-commits
mailing list