[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r339001 - /team/irroot/distr...

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


Author: irroot
Date: Mon Oct  3 10:13:50 2011
New Revision: 339001

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

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=339001&r1=339000&r2=339001
==============================================================================
--- team/irroot/distrotech-customers-trunk/res/res_fax.c (original)
+++ team/irroot/distrotech-customers-trunk/res/res_fax.c Mon Oct  3 10:13:50 2011
@@ -193,7 +193,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>
@@ -3209,7 +3209,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*/
@@ -3227,6 +3227,11 @@
 			break;
 		}
 		return f;
+	case AST_FRAME_DTMF:
+		if ((f->subclass.integer == 'f') || (f->subclass.integer == 'e')) {
+			break;
+		}
+		return f;
 	default:
 		return f;
 	}
@@ -3241,7 +3246,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:
@@ -3251,6 +3256,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