don't patch callsign in CG3Protocol::Initialize

pull/1/head
Tom Early 5 years ago
parent 0ef5e1e7f8
commit 357dd54179

@ -49,7 +49,7 @@ bool CG3Protocol::Initialize(const char */*type*/, const uint16 /*port*/, const
keep_running = true; keep_running = true;
// update the reflector callsign // update the reflector callsign
m_ReflectorCallsign.PatchCallsign(0, (const uint8 *)"XLX", 3); //m_ReflectorCallsign.PatchCallsign(0, (const uint8 *)"XLX", 3);
// create our sockets // create our sockets
CIp ip(AF_INET, G3_DV_PORT, g_Reflector.GetListenIPv4()); CIp ip(AF_INET, G3_DV_PORT, g_Reflector.GetListenIPv4());
@ -166,7 +166,7 @@ void CG3Protocol::PresenceTask(void)
Owner.SetCallsign(&Buffer.data()[16], 8); Owner.SetCallsign(&Buffer.data()[16], 8);
Terminal.SetCallsign(&Buffer.data()[24], 8); Terminal.SetCallsign(&Buffer.data()[24], 8);
std::cout << "Presence from " << Ip << " as " << Callsign << " on terminal " << Terminal << std::endl; std::cout << "Presence from owner " << Owner << " on " << Ip << " as " << Callsign << " on terminal " << Terminal << std::endl;
// accept // accept
Buffer.data()[2] = 0x80; // response Buffer.data()[2] = 0x80; // response
@ -200,13 +200,11 @@ void CG3Protocol::PresenceTask(void)
// do we already have a client with the same call (IP changed)? // do we already have a client with the same call (IP changed)?
while ( (extant = clients->FindNextClient(PROTOCOL_G3, it)) != nullptr ) while ( (extant = clients->FindNextClient(PROTOCOL_G3, it)) != nullptr )
{ {
if (extant->GetCallsign().HasSameCallsign(Terminal))
{ {
if (extant->GetCallsign().HasSameCallsign(Terminal)) //delete old client
{ clients->RemoveClient(extant);
//delete old client break;
clients->RemoveClient(extant);
break;
}
} }
} }
@ -690,7 +688,8 @@ char *CG3Protocol::TrimWhiteSpaces(char *str)
if (*str == 0) if (*str == 0)
return str; return str;
end = str + strlen(str) - 1; end = str + strlen(str) - 1;
while ((end > str) && ((*end == ' ') || (*end == '\t') || (*end == '\r'))) end --; while ((end > str) && ((*end == ' ') || (*end == '\t') || (*end == '\r')))
end--;
*(end + 1) = 0; *(end + 1) = 0;
return str; return str;
} }

@ -40,10 +40,10 @@
// //
// There are 3 steps in handling an incoming connection // There are 3 steps in handling an incoming connection
// //
// 1 - Notification of terminal call on port UDP 12346 // 1 - Notification of terminal call on port UDP 12346, Presence port, aCUdpSocket.
// - Call will be rejected if in blacklisted // - Call will be rejected if in blacklisted
// //
// 2 - Destination request on port UDP 12345 // 2 - Destination request on port UDP 12345, Config port, a CUdpMsgSocket.
// - Calls to specific callsigns will be accepted for a default module // - Calls to specific callsigns will be accepted for a default module
// - Repeater calls will be accepted for local modules // - Repeater calls will be accepted for local modules
// - All other calls are rejected // - All other calls are rejected

Loading…
Cancel
Save

Powered by TurnKey Linux.