Adjust DTMF min inter-tone gap to 30 ms

This brings it in line with the WEBRTC specification:
https://w3c.github.io/webrtc-pc/#dom-rtcdtmfsender-insertdtmf

Bug: chromium:812587
Change-Id: I705ac35cc94922f405e4951cfec813b74ed5dcab
Reviewed-on: https://webrtc-review.googlesource.com/55260
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22096}
This commit is contained in:
Harald Alvestrand 2018-02-20 08:15:36 +01:00 committed by Commit Bot
parent b824b5521a
commit 52e58524b6
2 changed files with 4 additions and 2 deletions

View File

@ -41,11 +41,13 @@ static const char kDtmfValidTones[] = ",0123456789*#ABCDabcd";
static const char kDtmfTonesTable[] = ",0123456789*#ABCD";
// The duration cannot be more than 6000ms or less than 40ms. The gap between
// tones must be at least 50 ms.
// Source for values: W3C WEBRTC specification.
// https://w3c.github.io/webrtc-pc/#dom-rtcdtmfsender-insertdtmf
static const int kDtmfDefaultDurationMs = 100;
static const int kDtmfMinDurationMs = 40;
static const int kDtmfMaxDurationMs = 6000;
static const int kDtmfDefaultGapMs = 50;
static const int kDtmfMinGapMs = 50;
static const int kDtmfMinGapMs = 30;
// Get DTMF code from the DTMF event character.
bool GetDtmfCode(char tone, int* code) {

View File

@ -331,7 +331,7 @@ TEST_F(DtmfSenderTest, InsertDtmfWithInvalidDurationOrGap) {
EXPECT_FALSE(dtmf_->InsertDtmf(tones, 6001, inter_tone_gap));
EXPECT_FALSE(dtmf_->InsertDtmf(tones, 39, inter_tone_gap));
EXPECT_FALSE(dtmf_->InsertDtmf(tones, duration, 49));
EXPECT_FALSE(dtmf_->InsertDtmf(tones, duration, 29));
EXPECT_TRUE(dtmf_->InsertDtmf(tones, duration, inter_tone_gap));
}