From 6a6a34c21b45e60d190f20e68af7f0170c25c282 Mon Sep 17 00:00:00 2001 From: paulc Date: Sun, 13 May 2007 21:55:14 +0000 Subject: [PATCH] Allow to override DTMF sending method from the chan.dtmf "method" parameter. git-svn-id: http://yate.null.ro/svn/yate/trunk@1315 acf43c95-373e-0410-b603-e72c3f656dc1 --- modules/ysipchan.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/modules/ysipchan.cpp b/modules/ysipchan.cpp index 28c632a1..3850b827 100644 --- a/modules/ysipchan.cpp +++ b/modules/ysipchan.cpp @@ -3004,7 +3004,24 @@ bool YateSIPConnection::msgAnswered(Message& msg) bool YateSIPConnection::msgTone(Message& msg, const char* tone) { - if (m_info) { + bool info = m_info; + bool inband = m_inband; + const String* method = msg.getParam("method"); + if (method) { + if (*method == "info") { + info = true; + inband = false; + } + else if (*method == "rfc2833") { + info = false; + inband = false; + } + else if (*method == "inband") { + info = false; + inband = true; + } + } + if (info) { for (; tone && *tone; tone++) { char c = *tone; for (int i = 0; i <= 16; i++) { @@ -3027,7 +3044,7 @@ bool YateSIPConnection::msgTone(Message& msg, const char* tone) ObjList* l = m_rtpMedia->find("audio"); const NetMedia* m = static_cast(l ? l->get() : 0); if (m) { - if (m_inband && dtmfInband(tone)) + if (inband && dtmfInband(tone)) return true; msg.setParam("targetid",m->id()); return false;