Module: sems
Branch: master
Commit: a83215d3c1c10946b818f0bf54f783ea49a27d48
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=a83215d3c1c10946b818f0bf54f783ea49a27d48

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Tue Oct 15 15:10:48 2013 +0200

b/f:DTMF:don't try to put audio into non-initialized DTMF detector

as safety precaution, test DTMF detector whether it's initialized before
trying to write audio into it

---

 core/AmDtmfDetector.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/core/AmDtmfDetector.cpp b/core/AmDtmfDetector.cpp
index 489a23f..dc626b4 100644
--- a/core/AmDtmfDetector.cpp
+++ b/core/AmDtmfDetector.cpp
@@ -384,7 +384,11 @@ void AmDtmfDetector::reportEvent()
 
 void AmDtmfDetector::putDtmfAudio(const unsigned char *buf, int size, unsigned 
long long system_ts)
 {
-  m_inbandDetector->streamPut(buf, size, system_ts);
+  if (m_inbandDetector->get()) {
+    m_inbandDetector->streamPut(buf, size, system_ts);
+  } else {
+    DBG("warning: trying to put DTMF into non-initialized DTMF detector\n");
+  }
 }
 
 // AmRtpDtmfDetector methods

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to