diff --git a/pc/dtmfsender.cc b/pc/dtmfsender.cc index 7a98bc32dd..8378eb9a07 100644 --- a/pc/dtmfsender.cc +++ b/pc/dtmfsender.cc @@ -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) { diff --git a/pc/dtmfsender_unittest.cc b/pc/dtmfsender_unittest.cc index a5d102b5f2..ddccc448f6 100644 --- a/pc/dtmfsender_unittest.cc +++ b/pc/dtmfsender_unittest.cc @@ -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)); }