[asterisk-commits] irroot: branch irroot/distrotech-customers-1.8 r338999 - /team/irroot/distrot...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 3 10:13:35 CDT 2011


Author: irroot
Date: Mon Oct  3 10:13:32 2011
New Revision: 338999

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=338999
Log:
Fix faxdetect framehook
T38 was ignored completely
Add DTMF support if a e/f tone arrives

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

Modified: team/irroot/distrotech-customers-1.8/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/res/res_fax.c?view=diff&rev=338999&r1=338998&r2=338999
==============================================================================
--- team/irroot/distrotech-customers-1.8/res/res_fax.c (original)
+++ team/irroot/distrotech-customers-1.8/res/res_fax.c Mon Oct  3 10:13:32 2011
@@ -187,7 +187,7 @@
 						<para>R/W T38 fax gateway, with optional fax activity timeout in seconds (yes[,timeout]/no)</para>
 					</enum>
 					<enum name="faxdetect">
-						<para>R/W Enable FAX detect with optional timeout in seconds seconds (yes[,timeout]/no)</para>
+						<para>R/W Enable FAX detect with optional timeout in seconds (yes[,timeout]/no)</para>
 					</enum>
 					<enum name="pages">
 						<para>R/O Number of pages transferred.</para>
@@ -3272,7 +3272,7 @@
 		return f;
 	}
 
-	/* only handle VOICE and CONTROL frames*/
+	/* only handle VOICE/DTMF and CONTROL frames*/
 	switch (f->frametype) {
 	case AST_FRAME_VOICE:
 		/* We can only process some formats*/
@@ -3285,6 +3285,11 @@
 		break;
 	case AST_FRAME_CONTROL:
 		if (f->subclass.integer == AST_CONTROL_T38_PARAMETERS) {
+			break;
+		}
+		return f;
+	case AST_FRAME_DTMF:
+		if ((f->subclass.integer == 'f') || (f->subclass.integer == 'e')) {
 			break;
 		}
 		return f;
@@ -3302,7 +3307,7 @@
 				faxdetect->result = 'n';
 			}
 		}
-	} else if ((f->frametype == AST_FRAME_CONTROL) && (f->datalen != sizeof(struct ast_control_t38_parameters))) {
+	} else if ((f->frametype == AST_FRAME_CONTROL) && (f->datalen == sizeof(struct ast_control_t38_parameters))) {
 		control_params = f->data.ptr;
 		switch (control_params->request_response) {
 		case AST_T38_NEGOTIATED:
@@ -3312,6 +3317,8 @@
 		default:
 			break;
 		}
+	} else if (f->frametype == AST_FRAME_DTMF) {
+		faxdetect->result = f->subclass.integer;
 	}
 
 	if (faxdetect->result) {




More information about the asterisk-commits mailing list