From 34b2a4a2b926919d0e7787bfaddd3c7a2cd632b5 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Wed, 7 Nov 2007 04:30:23 +0000 Subject: [PATCH] reset DTMF detector on default git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@547 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmDtmfDetector.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/AmDtmfDetector.cpp b/core/AmDtmfDetector.cpp index 025b9510..be66df97 100644 --- a/core/AmDtmfDetector.cpp +++ b/core/AmDtmfDetector.cpp @@ -194,13 +194,18 @@ void AmDtmfDetector::setInbandDetector(Dtmf::InbandDetectorType t) { ERROR("trying to use spandsp DTMF detector without support for it" "recompile with -D USE_SPANDSP\n"); } + if (!m_inbandDetector.get()) + m_inbandDetector.reset(new AmSemsInbandDtmfDetector(this)); + return; #else - if (t != m_inband_type) { + if ((t != m_inband_type) || (!m_inbandDetector.get())) { if (t == Dtmf::SEMSInternal) { + DBG("Setting internal DTMF detector\n"); m_inbandDetector.reset(new AmSemsInbandDtmfDetector(this)); } else { // if t == SpanDSP + DBG("Setting spandsp DTMF detector\n"); m_inbandDetector.reset(new AmSpanDSPInbandDtmfDetector(this)); } m_inband_type = t;