handle illegal call end properly;

pull/86/head
Bryan Biedenkapp 1 year ago
parent 1e8c266d8a
commit 07edd0dbff

@ -1256,13 +1256,19 @@ void HostBridge::processUDPAudio()
if (m_overrideSrcIdFromUDP) { if (m_overrideSrcIdFromUDP) {
uint32_t udpSrcId = __GET_UINT32(buffer, pcmLength + 8U); uint32_t udpSrcId = __GET_UINT32(buffer, pcmLength + 8U);
// if the UDP source ID now doesn't match the current call ID, reset call states if (udpSrcId != 0U) {
if (m_resetCallForSourceIdChange && (udpSrcId != m_udpSrcId)) { // if the UDP source ID now doesn't match the current call ID, reset call states
callEnd(m_udpSrcId, m_dstId); if (m_resetCallForSourceIdChange && (udpSrcId != m_udpSrcId)) {
m_udpDstId = m_dstId; callEnd(m_udpSrcId, m_dstId);
} m_udpDstId = m_dstId;
}
m_udpSrcId = udpSrcId; m_udpSrcId = udpSrcId;
} else {
if (m_udpSrcId == 0U) {
m_udpSrcId = m_srcId;
}
}
} }
} else { } else {
m_udpSrcId = m_srcId; m_udpSrcId = m_srcId;
@ -2557,6 +2563,11 @@ void HostBridge::callEnd(uint32_t srcId, uint32_t dstId)
trafficType = UDP_CALL; trafficType = UDP_CALL;
} }
if (srcId == 0U && !m_audioDetect && !m_dropTime.isRunning()) {
LogError(LOG_HOST, "%s, call end, ignoring invalid call end, srcId = %u, dstId = %u", trafficType.c_str(), srcId, dstId);
return;
}
LogMessage(LOG_HOST, "%s, call end, srcId = %u, dstId = %u", trafficType.c_str(), srcId, dstId); LogMessage(LOG_HOST, "%s, call end, srcId = %u, dstId = %u", trafficType.c_str(), srcId, dstId);
m_audioDetect = false; m_audioDetect = false;

Loading…
Cancel
Save

Powered by TurnKey Linux.