Merge branch 'match'

pull/3/head
Tom Early 2 years ago
commit 381268fb0b

@ -43,7 +43,7 @@ class xReflector {
fclose($handle); fclose($handle);
$this->ServiceName = substr($this->XMLContent, strpos($this->XMLContent, "<XLX")+4, 3); $this->ServiceName = substr($this->XMLContent, strpos($this->XMLContent, "<XLX")+4, 3);
if (!is_numeric($this->ServiceName)) { if (preg_match('/[^a-zA-Z0-9]/', $this->ServiceName) == 1) {
$this->ServiceName = null; $this->ServiceName = null;
return false; return false;
} }

@ -143,16 +143,11 @@ void CCodecStream::Task(void)
{ {
// pop the original packet // pop the original packet
auto Packet = m_LocalQueue.Pop(); auto Packet = m_LocalQueue.Pop();
auto Frame = (CDvFramePacket *)Packet.get(); auto Frame = static_cast<CDvFramePacket *>(Packet.get());
// do things look okay?
if (pack.module != m_CSModule)
std::cerr << "CodecStream '" << m_CSModule << "' received a transcoded packet from module '" << pack.module << "'" << std::dec << std::noshowbase << std::endl;
if (pack.sequence != Frame->GetCodecPacket()->sequence)
std::cerr << "Sequence mismatch: this voice frame=" << Frame->GetCodecPacket()->sequence << " returned transcoder packet=" << pack.sequence << std::endl;
if (pack.streamid != Frame->GetCodecPacket()->streamid)
std::cerr << std::hex << std::showbase << "StreamID mismatch: this voice frame=" << ntohs(Frame->GetCodecPacket()->streamid) << " returned transcoder packet=" << ntohs(pack.streamid) << std::dec << std::noshowbase << std::endl;
// make sure this is the correct packet
if ((pack.streamid == Frame->GetCodecPacket()->streamid) && (pack.sequence == Frame->GetCodecPacket()->sequence))
{
// update content with transcoded data // update content with transcoded data
Frame->SetCodecData(&pack); Frame->SetCodecData(&pack);
// mark the DStar sync frames if the source isn't dstar // mark the DStar sync frames if the source isn't dstar
@ -167,6 +162,17 @@ void CCodecStream::Task(void)
} }
else else
{ {
// Not the correct packet! It will be ignored
// Report it
if (pack.streamid != Frame->GetCodecPacket()->streamid)
std::cerr << std::hex << std::showbase << "StreamID mismatch: this voice frame=" << ntohs(Frame->GetCodecPacket()->streamid) << " returned transcoder packet=" << ntohs(pack.streamid) << std::dec << std::noshowbase << std::endl;
if (pack.sequence != Frame->GetCodecPacket()->sequence)
std::cerr << "Sequence mismatch: this voice frame=" << Frame->GetCodecPacket()->sequence << " returned transcoder packet=" << pack.sequence << std::endl;
}
}
else
{
// Likewise, this packet will be ignored
std::cout << "Transcoder packet received but CodecStream[" << m_CSModule << "] is closed: Module='" << pack.module << "' StreamID=" << std::hex << std::showbase << ntohs(pack.streamid) << std::endl; std::cout << "Transcoder packet received but CodecStream[" << m_CSModule << "] is closed: Module='" << pack.module << "' StreamID=" << std::hex << std::showbase << ntohs(pack.streamid) << std::endl;
} }
} }

@ -90,17 +90,6 @@ CDvHeaderPacket::CDvHeaderPacket(const struct dstar_header *buffer, uint16_t sid
m_uiFlag2 = buffer->Flag2; m_uiFlag2 = buffer->Flag2;
m_uiFlag3 = buffer->Flag3; m_uiFlag3 = buffer->Flag3;
m_csUR.SetCallsign(buffer->UR, CALLSIGN_LEN); m_csUR.SetCallsign(buffer->UR, CALLSIGN_LEN);
if((buffer->RPT1)[7] == 0x20){
char rptr1[8];
memcpy(rptr1, buffer->RPT1, 8);
rptr1[7] = DPLUS_DEFAULT_RPTR1_SUFFIX;
m_csRPT1.SetCallsign(rptr1, CALLSIGN_LEN);
}
else{
m_csRPT1.SetCallsign(buffer->RPT1, CALLSIGN_LEN);
}
m_csRPT1.SetCallsign(buffer->RPT1, CALLSIGN_LEN); m_csRPT1.SetCallsign(buffer->RPT1, CALLSIGN_LEN);
m_csRPT2.SetCallsign(buffer->RPT2, CALLSIGN_LEN); m_csRPT2.SetCallsign(buffer->RPT2, CALLSIGN_LEN);
m_csMY.SetCallsign(buffer->MY, CALLSIGN_LEN); m_csMY.SetCallsign(buffer->MY, CALLSIGN_LEN);

@ -28,7 +28,7 @@ SJsonKeys g_Keys;
CReflector g_Reflector; CReflector g_Reflector;
CGateKeeper g_GateKeeper; CGateKeeper g_GateKeeper;
CConfigure g_Configure; CConfigure g_Configure;
CVersion g_Version(3,1,1); // The major byte should only change if the interlink packet changes! CVersion g_Version(3,1,2); // The major byte should only change if the interlink packet changes!
CLookupDmr g_LDid; CLookupDmr g_LDid;
CLookupNxdn g_LNid; CLookupNxdn g_LNid;
CLookupYsf g_LYtr; CLookupYsf g_LYtr;

@ -60,7 +60,7 @@ bool CReflector::Start(void)
#ifndef NO_DHT #ifndef NO_DHT
// start the dht instance // start the dht instance
refhash = dht::InfoHash::get(cs); refhash = dht::InfoHash::get(cs);
node.run(17171, dht::crypto::generateIdentity(cs), true); node.run(17171, dht::crypto::generateIdentity(cs), true, 59973);
node.bootstrap(g_Configure.GetString(g_Keys.names.bootstrap), "17171"); node.bootstrap(g_Configure.GetString(g_Keys.names.bootstrap), "17171");
#endif #endif
@ -595,7 +595,7 @@ void CReflector::PutDHTClients()
#else #else
[](bool success){ if (! success) std::cout << "PutDHTClients() unsuccessful" << std::endl; }, [](bool success){ if (! success) std::cout << "PutDHTClients() unsuccessful" << std::endl; },
#endif #endif
true // permanent! false // not permanent!
); );
} }
@ -624,7 +624,7 @@ void CReflector::PutDHTUsers()
#else #else
[](bool success){ if (! success) std::cout << "PutDHTUsers() unsuccessful" << std::endl; }, [](bool success){ if (! success) std::cout << "PutDHTUsers() unsuccessful" << std::endl; },
#endif #endif
true // permanent! false // not permanent
); );
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.