diff --git a/core/AmDtmfDetector.cpp b/core/AmDtmfDetector.cpp index 62b574ac..63eabcf8 100644 --- a/core/AmDtmfDetector.cpp +++ b/core/AmDtmfDetector.cpp @@ -33,6 +33,11 @@ #include #include +// per RFC this is 5000ms, but in reality then +// one needs to wait 5 sec on the first keypress +// (e.g. due to a bug on recent snoms) +#define MAX_INFO_DTMF_LENGTH 1000 + // // AmDtmfEventQueue methods // @@ -119,6 +124,9 @@ void AmSipDtmfEvent::parseLine(const string& line) line.substr(0, KeyDuration.length()) == KeyDuration) { m_duration_msec = atol(line.substr(KeyDuration.length(), string::npos).c_str()); + if (m_duration_msec > MAX_INFO_DTMF_LENGTH) + m_duration_msec = MAX_INFO_DTMF_LENGTH; + } }