[asterisk-commits] jrose: branch 1.8 r319261 - /branches/1.8/main/dsp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 16 16:00:59 CDT 2011


Author: jrose
Date: Mon May 16 16:00:55 2011
New Revision: 319261

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319261
Log:
Makes busy detection in dsp.c always allow for at least one frame (20ms) of error so that 200ms tone lengths don't get ignored by single frame error lengths.

Modified:
    branches/1.8/main/dsp.c

Modified: branches/1.8/main/dsp.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/dsp.c?view=diff&rev=319261&r1=319260&r2=319261
==============================================================================
--- branches/1.8/main/dsp.c (original)
+++ branches/1.8/main/dsp.c Mon May 16 16:00:55 2011
@@ -1239,7 +1239,7 @@
 	}
 	/* If we know the expected busy tone length, check we are in the range */
 	if (res && (dsp->busy_tonelength > 0)) {
-		if (abs(avgtone - dsp->busy_tonelength) > (dsp->busy_tonelength*BUSY_PAT_PERCENT/100)) {
+		if (abs(avgtone - dsp->busy_tonelength) > MAX(dsp->busy_tonelength*BUSY_PAT_PERCENT/100, 20)) {
 #ifdef BUSYDETECT_DEBUG
 			ast_debug(5, "busy detector: avgtone of %d not close enough to desired %d\n",
 				avgtone, dsp->busy_tonelength);
@@ -1250,7 +1250,7 @@
 #ifndef BUSYDETECT_TONEONLY
 	/* If we know the expected busy tone silent-period length, check we are in the range */
 	if (res && (dsp->busy_quietlength > 0)) {
-		if (abs(avgsilence - dsp->busy_quietlength) > (dsp->busy_quietlength*BUSY_PAT_PERCENT/100)) {
+		if (abs(avgsilence - dsp->busy_quietlength) > MAX(dsp->busy_quietlength*BUSY_PAT_PERCENT/100, 20)) {
 #ifdef BUSYDETECT_DEBUG
 		ast_debug(5, "busy detector: avgsilence of %d not close enough to desired %d\n",
 			avgsilence, dsp->busy_quietlength);




More information about the asterisk-commits mailing list