fix for CCodecStream mismatch, fixed class.reflector.php, DHT Users and Clients are not permanent, fix CDvHeaderPacket DStar ctor

pull/3/head
Tom Early 2 years ago
parent 6aa57a784d
commit 4d6928c647

@ -43,10 +43,6 @@ class xReflector {
fclose($handle);
$this->ServiceName = substr($this->XMLContent, strpos($this->XMLContent, "<XLX")+4, 3);
if (!is_numeric($this->ServiceName)) {
$this->ServiceName = null;
return false;
}
$this->ReflectorName = "XLX".$this->ServiceName;

@ -143,30 +143,36 @@ void CCodecStream::Task(void)
{
// pop the original packet
auto Packet = m_LocalQueue.Pop();
auto Frame = (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;
// update content with transcoded data
Frame->SetCodecData(&pack);
// mark the DStar sync frames if the source isn't dstar
if (ECodecType::dstar!=Frame->GetCodecIn() && 0==Frame->GetPacketId()%21)
auto Frame = static_cast<CDvFramePacket *>(Packet.get());
// make sure this is the correct packet
if ((pack.streamid == Frame->GetCodecPacket()->streamid) && (pack.sequence == Frame->GetCodecPacket()->sequence))
{
const uint8_t DStarSync[] = { 0x55, 0x2D, 0x16 };
Frame->SetDvData(DStarSync);
// update content with transcoded data
Frame->SetCodecData(&pack);
// mark the DStar sync frames if the source isn't dstar
if (ECodecType::dstar!=Frame->GetCodecIn() && 0==Frame->GetPacketId()%21)
{
const uint8_t DStarSync[] = { 0x55, 0x2D, 0x16 };
Frame->SetDvData(DStarSync);
}
// and push it back to client
m_PacketStream->ReturnPacket(std::move(Packet));
}
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;
}
// and push it back to client
m_PacketStream->ReturnPacket(std::move(Packet));
}
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;
}
}

@ -90,17 +90,6 @@ CDvHeaderPacket::CDvHeaderPacket(const struct dstar_header *buffer, uint16_t sid
m_uiFlag2 = buffer->Flag2;
m_uiFlag3 = buffer->Flag3;
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_csRPT2.SetCallsign(buffer->RPT2, CALLSIGN_LEN);
m_csMY.SetCallsign(buffer->MY, CALLSIGN_LEN);

@ -28,7 +28,7 @@ SJsonKeys g_Keys;
CReflector g_Reflector;
CGateKeeper g_GateKeeper;
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;
CLookupNxdn g_LNid;
CLookupYsf g_LYtr;

@ -595,7 +595,7 @@ void CReflector::PutDHTClients()
#else
[](bool success){ if (! success) std::cout << "PutDHTClients() unsuccessful" << std::endl; },
#endif
true // permanent!
false // not permanent!
);
}
@ -624,7 +624,7 @@ void CReflector::PutDHTUsers()
#else
[](bool success){ if (! success) std::cout << "PutDHTUsers() unsuccessful" << std::endl; },
#endif
true // permanent!
false // not permanent
);
}

Loading…
Cancel
Save

Powered by TurnKey Linux.