diff --git a/src/svxlink/reflector/MqttPublisher.cpp b/src/svxlink/reflector/MqttPublisher.cpp index 86ee561..7390477 100644 --- a/src/svxlink/reflector/MqttPublisher.cpp +++ b/src/svxlink/reflector/MqttPublisher.cpp @@ -266,6 +266,12 @@ void MqttPublisher::onPeerTalkerStart(const std::string& peer_id, uint32_t tg, const std::string& callsign) { + if (peer_id.empty()) + { + geulog::warn("mqtt", "Skipping onPeerTalkerStart with empty peer_id" + " (tg=", tg, " callsign='", callsign, "')"); + return; + } Json::Value payload; payload["callsign"] = callsign; payload["tg"] = static_cast(tg); @@ -280,6 +286,12 @@ void MqttPublisher::onPeerTalkerStop(const std::string& peer_id, uint32_t tg, const std::string& callsign) { + if (peer_id.empty()) + { + geulog::warn("mqtt", "Skipping onPeerTalkerStop with empty peer_id" + " (tg=", tg, " callsign='", callsign, "')"); + return; + } Json::Value payload; payload["callsign"] = callsign; payload["tg"] = static_cast(tg); diff --git a/src/svxlink/reflector/SatelliteClient.cpp b/src/svxlink/reflector/SatelliteClient.cpp index c093b9d..117824f 100644 --- a/src/svxlink/reflector/SatelliteClient.cpp +++ b/src/svxlink/reflector/SatelliteClient.cpp @@ -340,7 +340,8 @@ void SatelliteClient::handleMsgPeerTalkerStart(std::istream& is) // Register as trunk talker — fires trunkTalkerUpdated which // broadcasts MsgTalkerStart to local clients - TGHandler::instance()->setTrunkTalkerForTG(msg.tg(), msg.callsign()); + TGHandler::instance()->setTrunkTalkerForTGViaPeer(msg.tg(), msg.callsign(), + m_parent_id); } /* SatelliteClient::handleMsgPeerTalkerStart */ diff --git a/src/svxlink/reflector/SatelliteLink.cpp b/src/svxlink/reflector/SatelliteLink.cpp index 3e7fa8f..689bd26 100644 --- a/src/svxlink/reflector/SatelliteLink.cpp +++ b/src/svxlink/reflector/SatelliteLink.cpp @@ -339,7 +339,8 @@ void SatelliteLink::handleMsgPeerTalkerStart(std::istream& is) // local clients. Reflector::onTrunkTalkerUpdated also forwards to // other satellites and trunk peers. m_sat_active_tgs.insert(tg); - TGHandler::instance()->setTrunkTalkerForTG(tg, msg.callsign()); + TGHandler::instance()->setTrunkTalkerForTGViaPeer(tg, msg.callsign(), + m_satellite_id); // Forward to trunk peers m_reflector->forwardSatelliteAudioToTrunks(tg, msg.callsign());