[Asterisk-code-review] dsp.c: Fix dsp.conf DTMF twist tolerance config options. (asterisk[14])

Richard Mudgett asteriskteam at digium.com
Tue Jul 26 12:18:45 CDT 2016


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/3342

Change subject: dsp.c: Fix dsp.conf DTMF twist tolerance config options.
......................................................................

dsp.c: Fix dsp.conf DTMF twist tolerance config options.

The twist options were applied backwards where normal was reversed
and reversed was normal.

Change-Id: Idf97e3a72f1edc5fca58f2fa7b20785922be0cae
---
M CHANGES
M configs/samples/dsp.conf.sample
M main/dsp.c
3 files changed, 19 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/42/3342/1

diff --git a/CHANGES b/CHANGES
index 289d217..c9d33bc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -370,6 +370,11 @@
 --- Functionality changes from Asterisk 13.10.0 to Asterisk 13.11.0 ----------
 ------------------------------------------------------------------------------
 
+Core
+------------------
+ * The dsp.conf DTMF normal and reverse twist tolerances were applied
+   backwards before.
+
 chan_dahdi
 ------------------
  * Added "faxdetect_timeout" option.
diff --git a/configs/samples/dsp.conf.sample b/configs/samples/dsp.conf.sample
index 08c5a57..04eec9d 100644
--- a/configs/samples/dsp.conf.sample
+++ b/configs/samples/dsp.conf.sample
@@ -12,24 +12,24 @@
 ; Reverse Twist is where the Row energy is greater.
 ;
 ; Power level difference between frequencies for different Administrations/RPOAs
-;		Power Gain		equiv
-;		normal	reverse		dB's
-; AT&T(default) 6.31	2.51		8dB(normal), 4dB(reverse)
-; NTT		3.16	3.16		Max. 5dB
-; Danish	3.98	3.98		Max. 6dB
-; Australian	10.0	10.0		Max. 10dB
-; Brazilian	7.94	7.94		Max. 9dB
-; ETSI		3.98	3.98		Max. 6dB
+;               Power Gain              equiv
+;               normal  reverse         dB's
+; AT&T(default) 6.31    2.51            8dB(normal), 4dB(reverse)
+; NTT           3.16    3.16            Max. 5dB
+; Danish        3.98    3.98            Max. 6dB
+; Australian    10.0    10.0            Max. 10dB
+; Brazilian     7.94    7.94            Max. 9dB
+; ETSI          3.98    3.98            Max. 6dB
 
 ;previous version compatible AT&T values
 ; RADIO_RELAX disabled, and relaxdtmf=no
-;		6.30	2.50		7.99dB(normal), 3.98dB(reverse)
+;               6.30    2.50            7.99dB(normal), 3.98dB(reverse)
 ; RADIO_RELAX disabled, and relaxdtmf=yes
-;		6.30	4.00		7.99dB(normal), 6.02dB(reverse)
+;               6.30    4.00            7.99dB(normal), 6.02dB(reverse)
 ; RADIO_RELAX enabled, and relaxdtmf=no
-;		6.30	2.50		7.99dB(normal), 3.984dB(reverse)
+;               6.30    2.50            7.99dB(normal), 3.984dB(reverse)
 ; RADIO_RELAX enabled, and relaxdtmf=yes
-;		6.30	6.50		7.99dB(normal), 8.13dB(reverse)
+;               6.30    6.50            7.99dB(normal), 8.13dB(reverse)
 
 ;If you don't know what these mean, don't change them.
 ;dtmf_normal_twist=6.31
diff --git a/main/dsp.c b/main/dsp.c
index f043ff9..0961ead 100644
--- a/main/dsp.c
+++ b/main/dsp.c
@@ -718,8 +718,8 @@
 		/* Basic signal level test and the twist test */
 		if (row_energy[best_row] >= DTMF_THRESHOLD &&
 		    col_energy[best_col] >= DTMF_THRESHOLD &&
-		    col_energy[best_col] < row_energy[best_row] * (relax ? relax_dtmf_reverse_twist : dtmf_reverse_twist) &&
-		    row_energy[best_row] < col_energy[best_col] * (relax ? relax_dtmf_normal_twist : dtmf_normal_twist)) {
+		    col_energy[best_col] < row_energy[best_row] * (relax ? relax_dtmf_normal_twist : dtmf_normal_twist) &&
+		    row_energy[best_row] < col_energy[best_col] * (relax ? relax_dtmf_reverse_twist : dtmf_reverse_twist)) {
 			/* Relative peak test */
 			for (i = 0; i < 4; i++) {
 				if ((i != best_col &&

-- 
To view, visit https://gerrit.asterisk.org/3342
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf97e3a72f1edc5fca58f2fa7b20785922be0cae
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list