From fcad45df8dd89dd6893506e3f82ff0c253eb14d3 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Thu, 4 Oct 2007 20:11:07 +0000 Subject: [PATCH] maximum DTMF INFO key press length git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@510 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmDtmfDetector.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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; + } }