From 8424d8d3eb61a208e3f4173c336304ec54170648 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Thu, 8 Aug 2024 17:52:21 -0700 Subject: [PATCH 1/5] radmin fixes --- radmin | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/radmin b/radmin index ba8f9be..8d76743 100755 --- a/radmin +++ b/radmin @@ -35,7 +35,7 @@ UninstallReflector () { } InstallReflector () { - if [ "$tcaddress" != none ]; then + if [ "$tcport" != 0 ]; then pushd ../tcd sudo make install || read -p " to continue: " ans popd @@ -63,22 +63,19 @@ InstallReflector () { urfserv='/etc/systemd/system/urfd.service' tcdserv='/etc/systemd/system/tcd.service' -# default values, we only need a few -tcaddress='none' - if [[ $# -eq 1 ]]; then if [ -e $1 ]; then echo $1 found - callsign=$(awk '$1 == "Callsign"{print $3}' $1) - tcaddress=$(awk '$1 == "Transcoder"{print $3}' $1) + callsign=$(awk '$1 == "Callsign"{print $3; exit}' $1) + tcport=$(awk '$1 == "Port"{print $3; exit}' $1) else echo "$1 not found" exit 1 fi else if [[ -e reflector/urfd.ini ]]; then - callsign=$(awk '$1 == "Callsign"{print $3}' reflector/urfd.ini) - tcaddress=$(awk '$1 == "Transcoder"{print $3}' reflector/urfd.ini) + callsign=$(awk '$1 == "Callsign"{print $3; exit}' reflector/urfd.ini) + tcport=$(awk '$1 == "Port"{print $3; exit}' reflector/urfd.ini) else echo "ERROR: could not find reflector/urfd.ini! You'll have to specify it." echo "Usage: ./radmin PATH-TO-INI-FILE" @@ -97,7 +94,7 @@ do ps -aux | grep -e urfd -e tcd | grep -v grep | grep -v radmin fi echo - echo " Reflector Administration, Version #230308" + echo " Reflector Administration, Version #240808" echo git status | head -1 echo @@ -116,13 +113,17 @@ do else if [[ "$callsign" == URF* ]]; then if [ -e reflector/urfd ]; then - if [[ "$tcaddress" == none ]]; then + if [[ "$tcport" == 0 ]]; then echo "is : Install URF reflector without transcoder" else if [ -e ../tcd/tcd ]; then echo "is : Install URF reflector and transcoder" + else + echo "HELP! Transcoder port is set, but tcd executable not found!" fi fi + else + echo "HELP! urfd executable not found!" fi fi fi From 6af8b0150f84b77539421002a9c0f7a99082720a Mon Sep 17 00:00:00 2001 From: Tom Early Date: Fri, 9 Aug 2024 07:39:02 -0700 Subject: [PATCH 2/5] fixed crash when no autolink module was specified --- config/urfd.ini | 4 ++-- reflector/Configure.cpp | 16 +++++++--------- reflector/Configure.h | 2 +- reflector/CurlGet.cpp | 2 +- reflector/Main.cpp | 2 +- reflector/NXDNProtocol.cpp | 2 +- reflector/P25Protocol.cpp | 2 +- reflector/Protocols.cpp | 2 +- reflector/Reflector.cpp | 6 +++--- reflector/YSFProtocol.cpp | 2 +- 10 files changed, 19 insertions(+), 21 deletions(-) diff --git a/config/urfd.ini b/config/urfd.ini index 77148a1..07d049e 100644 --- a/config/urfd.ini +++ b/config/urfd.ini @@ -37,7 +37,7 @@ IPv4Binding = 0.0.0.0 # Modules = ABCDEFGHIJKLMNOPQRSTUVWXYZ Modules = ADMSZ # Create Descriptions as needed... -DescriptionA = Transcoded +DescriptionA = All Modes DescriptionD = DMR Chat DescriptionM = M17 Chat DescriptionS = DStar Chat @@ -91,7 +91,7 @@ Port = 10017 [USRP] Enable = false -Callsign = ALLSTAR # set to NONE if you don't want to create this client +Callsign = ALLSTAR IPAddress = 1.2.3.4 # the IP address of the USRP client (the Allstar node) RxPort = 34000 TxPort = 32000 diff --git a/reflector/Configure.cpp b/reflector/Configure.cpp index 75e28d8..445e953 100644 --- a/reflector/Configure.cpp +++ b/reflector/Configure.cpp @@ -819,21 +819,19 @@ bool CConfigure::isDefined(ErrorLevel level, const std::string §ion, const s return false; } -void CConfigure::checkAutoLink(const std::string §ion, const std::string &pname, const std::string &key, bool &rval) +void CConfigure::checkAutoLink(const std::string §ion, const std::string &pname, const std::string &key, bool &rval) const { - if (data.contains(key)) + const auto autolinkModule = GetAutolinkModule(key); + if (' ' != autolinkModule) { auto ismods = data.contains(g_Keys.modules.modules); const auto mods(ismods ? data[g_Keys.modules.modules].get() : ""); - const auto c = data[key].get().at(0); - if (std::string::npos == mods.find(c)) + if (std::string::npos == mods.find(autolinkModule)) { - std::cerr << "ERROR: [" << section << ']' << pname << " module '" << c << "' not a configured module" << std::endl; + std::cerr << "ERROR: [" << section << ']' << pname << " module '" << autolinkModule << "' not a configured module" << std::endl; rval = true; } } - else - data[key] = nullptr; } std::string CConfigure::getDataRefreshType(ERefreshType type) const @@ -865,7 +863,7 @@ void CConfigure::badParam(const std::string &key) const bool CConfigure::checkModules(std::string &m) const { bool rval = false; // return true on error - for(unsigned i=0; i(Callsign, Ip); // aautolink, if enabled - if (m_AutolinkModule) + if (' ' != m_AutolinkModule) newclient->SetReflectorModule(m_AutolinkModule); // and append diff --git a/reflector/P25Protocol.cpp b/reflector/P25Protocol.cpp index c83e33c..0c52204 100644 --- a/reflector/P25Protocol.cpp +++ b/reflector/P25Protocol.cpp @@ -122,7 +122,7 @@ void CP25Protocol::Task(void) auto newclient = std::make_shared(Callsign, Ip); // aautolink, if enabled - if (m_AutolinkModule) + if (' ' != m_AutolinkModule) newclient->SetReflectorModule(m_AutolinkModule); // and append diff --git a/reflector/Protocols.cpp b/reflector/Protocols.cpp index 5109b93..65709fe 100644 --- a/reflector/Protocols.cpp +++ b/reflector/Protocols.cpp @@ -94,7 +94,7 @@ bool CProtocols::Init(void) if (g_Configure.GetBoolean(g_Keys.usrp.enable)) { m_Protocols.emplace_back(std::unique_ptr(new CUSRPProtocol)); - if (! m_Protocols.back()->Initialize("USRP", EProtocol::usrp, uint16_t(g_Configure.GetUnsigned(g_Keys.usrp.rxport)), USRP_IPV4, USRP_IPV6)) + if (! m_Protocols.back()->Initialize("USRP", EProtocol::usrp, uint16_t(g_Configure.GetUnsigned(g_Keys.usrp.rxport)), USRP_IPV4, USRP_IPV6)) return false; } diff --git a/reflector/Reflector.cpp b/reflector/Reflector.cpp index 4861ae8..4c19087 100644 --- a/reflector/Reflector.cpp +++ b/reflector/Reflector.cpp @@ -532,9 +532,9 @@ void CReflector::PutDHTConfig() std::ostringstream ss; ss << g_Version; cfg.version.assign(ss.str()); - cfg.almod[toUType(EUrfdAlMod::nxdn)] = g_Configure.GetString(g_Keys.nxdn.autolinkmod).at(0); - cfg.almod[toUType(EUrfdAlMod::p25)] = g_Configure.GetString(g_Keys.p25.autolinkmod).at(0); - cfg.almod[toUType(EUrfdAlMod::ysf)] = g_Configure.GetString(g_Keys.ysf.autolinkmod).at(0); + cfg.almod[toUType(EUrfdAlMod::nxdn)] = g_Configure.GetAutolinkModule(g_Keys.nxdn.autolinkmod); + cfg.almod[toUType(EUrfdAlMod::p25)] = g_Configure.GetAutolinkModule(g_Keys.p25.autolinkmod); + cfg.almod[toUType(EUrfdAlMod::ysf)] = g_Configure.GetAutolinkModule(g_Keys.ysf.autolinkmod); cfg.ysffreq[toUType(EUrfdTxRx::rx)] = g_Configure.GetUnsigned(g_Keys.ysf.defaultrxfreq); cfg.ysffreq[toUType(EUrfdTxRx::tx)] = g_Configure.GetUnsigned(g_Keys.ysf.defaulttxfreq); cfg.refid[toUType(EUrfdRefId::nxdn)] = g_Configure.GetUnsigned(g_Keys.nxdn.reflectorid); diff --git a/reflector/YSFProtocol.cpp b/reflector/YSFProtocol.cpp index 9439716..a3f6db6 100644 --- a/reflector/YSFProtocol.cpp +++ b/reflector/YSFProtocol.cpp @@ -164,7 +164,7 @@ void CYsfProtocol::Task(void) auto newclient = std::make_shared(Callsign, Ip); // aautolink, if enabled - if (m_AutolinkModule) + if (' ' != m_AutolinkModule) newclient->SetReflectorModule(m_AutolinkModule); // and append From 2bb22b2c30e4966afa3448da84f4fd055cd881b6 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Sat, 10 Aug 2024 11:58:32 -0700 Subject: [PATCH 3/5] fixes for dashboard --- dashboard/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard/index.php b/dashboard/index.php index f44a3d6..b3289ea 100644 --- a/dashboard/index.php +++ b/dashboard/index.php @@ -86,7 +86,7 @@ if ($CallingHome['Active']) { - <?php echo str_replace("XLX", "URF", $Reflector->GetReflectorName()); ?>Universal Reflector + <?php echo str_replace("XLX", "URF", $Reflector->GetReflectorName()); ?> Universal Reflector @@ -152,7 +152,7 @@ if ($CallingHome['Active']) { - GetReflectorName(); ?> Multiprotocol Reflector + GetReflectorName()); ?> Universal Reflector