diff --git a/src/svxlink/svxlink/LinkManager.cpp b/src/svxlink/svxlink/LinkManager.cpp index 5e0719ca..62dd23bc 100644 --- a/src/svxlink/svxlink/LinkManager.cpp +++ b/src/svxlink/svxlink/LinkManager.cpp @@ -548,6 +548,23 @@ void LinkManager::playTone(LogicBase *src_logic, int fq, int amp, int len) } /* LinkManager::playTone */ +void LinkManager::playDtmf(LogicBase *src_logic, const std::string& digits, int amp, int len) +{ + const Async::AudioSelector *selector = sinks[src_logic->name()].selector; + const ConMap& con_map = sinks[src_logic->name()].connectors; + for (ConMap::const_iterator it = con_map.begin(); it != con_map.end(); ++it) + { + const std::string& logic_name = it->first; + const Async::AudioSource *con = it->second; + LogicBase *logic = logic_map[logic_name].logic; + if ((logic != src_logic) && (selector->autoSelectEnabled(con))) + { + logic->playDtmf(digits, amp, len); + } + } +} /* LinkManager::playTone */ + + /**************************************************************************** * diff --git a/src/svxlink/svxlink/LinkManager.h b/src/svxlink/svxlink/LinkManager.h index f3e9cbe4..c6c4ab2b 100644 --- a/src/svxlink/svxlink/LinkManager.h +++ b/src/svxlink/svxlink/LinkManager.h @@ -260,6 +260,15 @@ class LinkManager : public sigc::trackable */ void playTone(LogicBase *src_logic, int fq, int amp, int len); + /** + * @brief Play DTMF digits + * @param src_logic The initiating logic, which will not play the digit + * @param digits The DTMF digits to play + * @param amp The amplitude of the individual DTMF tones (0-1000) + * @param len The length in milliseconds of the digit + */ + void playDtmf(LogicBase *src_logic, const std::string& digits, int amp, int len); + private: struct LogicProperties { diff --git a/src/svxlink/svxlink/LogicBase.h b/src/svxlink/svxlink/LogicBase.h index 092cb3f9..91f81194 100644 --- a/src/svxlink/svxlink/LogicBase.h +++ b/src/svxlink/svxlink/LogicBase.h @@ -221,6 +221,14 @@ class LogicBase : public sigc::trackable */ virtual void playTone(int fq, int amp, int len) {} + /** + * @brief Play DTMF digits + * @param digits The DTMF digits to play + * @param amp The amplitude of the individual DTMF tones (0-1000) + * @param len The length in milliseconds of the digit + */ + virtual void playDtmf(const std::string& digits, int amp, int len) {} + /** * @brief A linked logic has updated its recieved talk group * @param logic The pointer to the remote logic object diff --git a/src/svxlink/svxlink/ReflectorLogic.cpp b/src/svxlink/svxlink/ReflectorLogic.cpp index 75011880..589ab5b3 100644 --- a/src/svxlink/svxlink/ReflectorLogic.cpp +++ b/src/svxlink/svxlink/ReflectorLogic.cpp @@ -280,6 +280,8 @@ bool ReflectorLogic::initialize(void) mem_fun(LinkManager::instance(), &LinkManager::playSilence), this)); m_event_handler->playTone.connect(sigc::bind<0>( mem_fun(LinkManager::instance(), &LinkManager::playTone), this)); + m_event_handler->playDtmf.connect(sigc::bind<0>( + mem_fun(LinkManager::instance(), &LinkManager::playDtmf), this)); m_event_handler->setVariable("logic_name", name().c_str()); m_event_handler->processEvent("namespace eval Logic {}"); diff --git a/src/versions b/src/versions index 94987cb4..fc8184d1 100644 --- a/src/versions +++ b/src/versions @@ -11,7 +11,7 @@ LIBECHOLIB=1.3.3 LIBASYNC=1.6.0 # SvxLink versions -SVXLINK=1.7.99.0-reflector-tg +SVXLINK=1.7.99.1-reflector-tg MODULE_HELP=1.0.0 MODULE_PARROT=1.1.1 MODULE_ECHO_LINK=1.5.0