[asterisk-commits] mnicholson: branch irroot/t38gateway-trunk r325737 - /team/irroot/t38gateway-...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jun 29 14:46:14 CDT 2011
Author: mnicholson
Date: Wed Jun 29 14:46:11 2011
New Revision: 325737
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=325737
Log:
Allow the receiving side to negotiate T.38 after we have done T.38 negotation based on CED detection
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=325737&r1=325736&r2=325737
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax.c Wed Jun 29 14:46:11 2011
@@ -2616,6 +2616,42 @@
ao2_ref(details, -1);
return &ast_null_frame;
+ } else if (gateway->t38_state == T38_STATE_NEGOTIATING) {
+ /* we got a request to negotiate T.38 after we already
+ * sent one to the other party based on CED tone
+ * detection. We'll just pretend we passed this request
+ * through in the first place. */
+
+ t38_parameters_ast_to_fax(&details->their_t38_parameters, control_params);
+ gateway->t38_state = T38_STATE_UNKNOWN;
+ gateway->bridge_start = ast_tvnow();
+
+ ast_debug(1, "%s is attempting to negotiate T.38 after we already sent a negotiation request based on CED detection\n", active->name);
+ ao2_ref(details, -1);
+ return &ast_null_frame;
+ } else if (gateway->t38_state == T38_STATE_NEGOTIATED) {
+ /* we got a request to negotiate T.38 after we already
+ * sent one to the other party based on CED tone
+ * detection and received a response. We need to
+ * respond to this and shut down the gateway. */
+
+ t38_parameters_fax_to_ast(control_params, &details->their_t38_parameters);
+ ast_framehook_detach(chan, details->gateway_id);
+ details->gateway_id = -1;
+
+ control_params->request_response = AST_T38_NEGOTIATED;
+
+ /* XXX check return value? */
+ fax_gateway_indicate_t38(chan, active, control_params);
+
+ ast_string_field_set(details, result, "SUCCESS");
+ ast_string_field_set(details, resultstr, "no gateway necessary");
+ ast_string_field_set(details, error, "NATIVE_T38");
+ set_channel_variables(chan, details);
+
+ ast_debug(1, "%s is attempting to negotiate T.38 after we already negotiated T.38 with %s, disabling the gateway\n", active->name, other->name);
+ ao2_ref(details, -1);
+ return &ast_null_frame;
} else {
ast_log(LOG_WARNING, "%s is attempting to negotiate T.38 while %s is in an unsupported state\n", active->name, other->name);
ao2_ref(details, -1);
More information about the asterisk-commits
mailing list