Added DTMF detection method to chan.dtmf messages.

git-svn-id: http://yate.null.ro/svn/yate/trunk@1943 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2008-04-23 22:50:20 +00:00
parent 4d75a65c54
commit b5f010dfc3
6 changed files with 9 additions and 2 deletions

View File

@ -877,11 +877,13 @@ void SigChannel::evInfo(SignallingEvent* event)
// Check DTMF
String tmp = msg->params().getValue("tone");
if (!tmp.null()) {
bool inband = msg->params().getBoolValue("inband");
DDebug(this,DebugCall,"Event: '%s'. DTMF: '%s'. In band: %s [%p]",
event->name(),tmp.c_str(),
String::boolText(msg->params().getBoolValue("inband")),this);
String::boolText(inband),this);
Message* m = message("chan.dtmf");
m->addParam("text",tmp);
m->addParam("detected",inband ? "inband" : "signal");
Engine::enqueue(m);
}
}

View File

@ -327,6 +327,7 @@ void ToneConsumer::checkDtmf()
m->addParam("id",m_id);
m->addParam("message","chan.dtmf");
m->addParam("text",buf);
m->addParam("detected","inband");
Engine::enqueue(m);
}
}

View File

@ -1562,6 +1562,7 @@ void YIAXConnection::handleEvent(IAXEvent* event)
DDebug(this,DebugCall,"DTMF: %s [%p]",dtmf.safe(),this);
Message* m = message("chan.dtmf");
m->addParam("text",dtmf);
m->addParam("detected","iax-event");
Engine::enqueue(m);
}
break;

View File

@ -1335,6 +1335,7 @@ void YJGConnection::handleEvent(JGEvent* event)
if (event->reason() == "button-up" && event->text()) {
Message* m = message("chan.dtmf");
m->addParam("text",event->text());
m->addParam("detected","jingle");
Engine::enqueue(m);
}
break;

View File

@ -496,6 +496,7 @@ void YRTPWrapper::gotDTMF(char tone)
m->addParam("id",m_master);
m->addParam("message","chan.dtmf");
m->addParam("text",buf);
m->addParam("detected","rfc2833");
Engine::enqueue(m);
}

View File

@ -3271,6 +3271,7 @@ void YateSIPConnection::doInfo(SIPTransaction* t)
Message* msg = message("chan.dtmf");
copySipHeaders(*msg,*t->initialMessage());
msg->addParam("text",tmp);
msg->addParam("detected","sip-info");
Engine::enqueue(msg);
}
}
@ -3404,7 +3405,7 @@ bool YateSIPConnection::msgTone(Message& msg, const char* tone)
bool inband = m_inband;
const String* method = msg.getParam("method");
if (method) {
if (*method == "info") {
if ((*method == "info") || (*method == "sip-info")) {
info = true;
inband = false;
}