Fix bidirectional trunk routing and monitoring client notifications
Two bugs prevented real-world trunk conversations from working: 1. onTrunkTalkerUpdated only notified clients selected on a TG, not clients monitoring it. SvxLink repeaters monitoring a foreign TG never received MsgTalkerStart and could not auto-switch. Fixed by adding TgMonitorFilter to trunk talker broadcasts, matching the existing behavior of onTalkerUpdated for local talkers. 2. Trunk TG routing was one-way: when a client visited a foreign TG, isSharedTG forwarded to the owner, but the owner had no return path. Added per-link peer interest tracking — when a peer sends MsgTrunkTalkerStart for a TG, the receiving side records interest and forwards local activity on that TG back. Interest refreshes on audio, expires after 10 minutes idle, clears on disconnect. New integration test verifies the full round-trip: client-A talks on a foreign TG, monitoring client-B receives the notification, client-B replies, and client-A receives audio back through the trunk.
This commit is contained in:
1 parent
8cf96f9ba5
commit
accb4b3686
7 files changed
+200
-17
No files matched your search
@@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
****************************************************************************/
|
||||
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sigc++/sigc++.h>
|
||||
@@ -155,6 +156,12 @@ class TrunkLink : public sigc::trackable
|
||||
// TGs currently held by this specific trunk peer (for scoped cleanup)
|
||||
std::set<uint32_t> m_peer_active_tgs;
|
||||
|
||||
// TGs the peer has shown interest in (sent TalkerStart for).
|
||||
// Maps TG number to last activity timestamp. Entries expire after
|
||||
// PEER_INTEREST_TIMEOUT_S seconds of inactivity.
|
||||
static const time_t PEER_INTEREST_TIMEOUT_S = 600; // 10 minutes
|
||||
std::map<uint32_t, time_t> m_peer_interested_tgs;
|
||||
|
||||
// Per-connection state
|
||||
bool m_ob_hello_received = false;
|
||||
unsigned m_ob_hb_tx_cnt = 0;
|
||||
@@ -170,6 +177,7 @@ class TrunkLink : public sigc::trackable
|
||||
bool isOutboundReady(void) const;
|
||||
bool isInboundReady(void) const;
|
||||
bool isOwnedTG(uint32_t tg) const;
|
||||
bool isPeerInterestedTG(uint32_t tg) const;
|
||||
|
||||
void onConnected(void);
|
||||
void onDisconnected(Async::TcpConnection* con,
|
||||
|
||||
Reference in new issue
Block a user