[asterisk-commits] mnicholson: branch irroot/t38gateway-trunk r324485 - /team/irroot/t38gateway-...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 22 14:10:22 CDT 2011


Author: mnicholson
Date: Wed Jun 22 14:10:18 2011
New Revision: 324485

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=324485
Log:
don't allow ReceiveFAX or SendFAX to run on channels with a T.38 gateway
enabled

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=324485&r1=324484&r2=324485
==============================================================================
--- team/irroot/t38gateway-trunk/res/res_fax.c (original)
+++ team/irroot/t38gateway-trunk/res/res_fax.c Wed Jun 22 14:10:18 2011
@@ -1601,6 +1601,14 @@
 	ast_string_field_set(details, error, "INIT_ERROR");
 	set_channel_variables(chan, details);
 
+	if (details->caps & AST_FAX_TECH_GATEWAY) {
+		ast_string_field_set(details, resultstr, "can't receive a fax on a channel with a T.38 gateway");
+		set_channel_variables(chan, details);
+		ast_log(LOG_ERROR, "executing ReceiveFAX on a channel with a T.38 Gateway is not supported\n");
+		ao2_ref(details, -1);
+		return -1;
+	}
+
 	if (details->maxrate < details->minrate) {
 		ast_string_field_set(details, error, "INVALID_ARGUMENTS");
 		ast_string_field_set(details, resultstr, "maxrate is less than minrate");
@@ -2063,6 +2071,14 @@
 	ast_string_field_set(details, error, "INIT_ERROR");
 	set_channel_variables(chan, details);
 
+	if (details->caps & AST_FAX_TECH_GATEWAY) {
+		ast_string_field_set(details, resultstr, "can't send a fax on a channel with a T.38 gateway");
+		set_channel_variables(chan, details);
+		ast_log(LOG_ERROR, "executing SendFAX on a channel with a T.38 Gateway is not supported\n");
+		ao2_ref(details, -1);
+		return -1;
+	}
+
 	if (details->maxrate < details->minrate) {
 		ast_string_field_set(details, error, "INVALID_ARGUMENTS");
 		ast_string_field_set(details, resultstr, "maxrate is less than minrate");
@@ -2311,6 +2327,7 @@
 
 	if (gateway->s) {
 		fax_session_release(gateway->s, gateway->token);
+		gateway->s->details->caps |= ~AST_FAX_TECH_GATEWAY;
 		ao2_ref(gateway->s, -1);
 		gateway->s = NULL;
 		gateway->token = NULL;




More information about the asterisk-commits mailing list