@ -1017,26 +1017,59 @@ bool TagP25Data::isPeerPermitted(uint32_t peerId, lc::LC& control, DUID::E duid,
bool TagP25Data : : validate ( uint32_t peerId , lc : : LC & control , DUID : : E duid , const p25 : : lc : : TSBK * tsbk , uint32_t streamId )
bool TagP25Data : : validate ( uint32_t peerId , lc : : LC & control , DUID : : E duid , const p25 : : lc : : TSBK * tsbk , uint32_t streamId )
{
{
bool skipRidCheck = false ;
if ( ( control . getMFId ( ) = = MFG_MOT & & control . getSrcId ( ) = = 0U ) | | control . getSrcId ( ) > WUID_FNE ) {
skipRidCheck = true ;
}
LogDebug ( LOG_NET , " P25, duid = $%02X, mfId = $%02X, lco = $%02X, srcId = %u, dstId = %u " , duid , control . getMFId ( ) , control . getLCO ( ) , control . getSrcId ( ) , control . getDstId ( ) ) ;
// is the source ID a blacklisted ID?
// is the source ID a blacklisted ID?
lookups : : RadioId rid = m_network - > m_ridLookup - > find ( control . getSrcId ( ) ) ;
if ( ! skipRidCheck ) {
if ( ! rid . radioDefault ( ) ) {
lookups : : RadioId rid = m_network - > m_ridLookup - > find ( control . getSrcId ( ) ) ;
if ( ! rid . radioEnabled ( ) ) {
if ( ! rid . radioDefault ( ) ) {
// report error event to InfluxDB
if ( ! rid . radioEnabled ( ) ) {
if ( m_network - > m_enableInfluxDB ) {
// report error event to InfluxDB
influxdb : : QueryBuilder ( )
if ( m_network - > m_enableInfluxDB ) {
. meas ( " call_error_event " )
influxdb : : QueryBuilder ( )
. tag ( " peerId " , std : : to_string ( peerId ) )
. meas ( " call_error_event " )
. tag ( " streamId " , std : : to_string ( streamId ) )
. tag ( " peerId " , std : : to_string ( peerId ) )
. tag ( " srcId " , std : : to_string ( control . getSrcId ( ) ) )
. tag ( " streamId " , std : : to_string ( streamId ) )
. tag ( " dstId " , std : : to_string ( control . getDstId ( ) ) )
. tag ( " srcId " , std : : to_string ( control . getSrcId ( ) ) )
. field ( " message " , INFLUXDB_ERRSTR_DISABLED_SRC_RID )
. tag ( " dstId " , std : : to_string ( control . getDstId ( ) ) )
. timestamp ( std : : chrono : : duration_cast < std : : chrono : : nanoseconds > ( std : : chrono : : system_clock : : now ( ) . time_since_epoch ( ) ) . count ( ) )
. field ( " message " , INFLUXDB_ERRSTR_DISABLED_SRC_RID )
. request ( m_network - > m_influxServer ) ;
. timestamp ( std : : chrono : : duration_cast < std : : chrono : : nanoseconds > ( std : : chrono : : system_clock : : now ( ) . time_since_epoch ( ) ) . count ( ) )
. request ( m_network - > m_influxServer ) ;
}
// report In-Call Control to the peer sending traffic
m_network - > writePeerICC ( peerId , NET_SUBFUNC : : PROTOCOL_SUBFUNC_P25 , NET_ICC : : REJECT_TRAFFIC , control . getDstId ( ) ) ;
return false ;
}
}
}
else {
// if this is a default radio -- and we are rejecting undefined radios
// report call error
if ( m_network - > m_rejectUnknownRID ) {
// report error event to InfluxDB
if ( m_network - > m_enableInfluxDB ) {
influxdb : : QueryBuilder ( )
. meas ( " call_error_event " )
. tag ( " peerId " , std : : to_string ( peerId ) )
. tag ( " streamId " , std : : to_string ( streamId ) )
. tag ( " srcId " , std : : to_string ( control . getSrcId ( ) ) )
. tag ( " dstId " , std : : to_string ( control . getDstId ( ) ) )
. field ( " message " , INFLUXDB_ERRSTR_DISABLED_SRC_RID )
. timestamp ( std : : chrono : : duration_cast < std : : chrono : : nanoseconds > ( std : : chrono : : system_clock : : now ( ) . time_since_epoch ( ) ) . count ( ) )
. request ( m_network - > m_influxServer ) ;
}
// report In-Call Control to the peer sending traffic
LogWarning ( LOG_NET , " P25, illegal/unknown RID attempted access, srcId = %u, dstId = %u " , control . getSrcId ( ) , control . getDstId ( ) ) ;
m_network - > writePeerICC ( peerId , NET_SUBFUNC : : PROTOCOL_SUBFUNC_P25 , NET_ICC : : REJECT_TRAFFIC , control . getDstId ( ) ) ;
return false ;
// report In-Call Control to the peer sending traffic
m_network - > writePeerICC ( peerId , NET_SUBFUNC : : PROTOCOL_SUBFUNC_P25 , NET_ICC : : REJECT_TRAFFIC , control . getDstId ( ) ) ;
return false ;
}
}
}
}
}
@ -1072,6 +1105,30 @@ bool TagP25Data::validate(uint32_t peerId, lc::LC& control, DUID::E duid, const
return false ;
return false ;
}
}
}
}
else {
// if this is a default radio -- and we are rejecting undefined radios
// report call error
if ( m_network - > m_rejectUnknownRID ) {
// report error event to InfluxDB
if ( m_network - > m_enableInfluxDB ) {
influxdb : : QueryBuilder ( )
. meas ( " call_error_event " )
. tag ( " peerId " , std : : to_string ( peerId ) )
. tag ( " streamId " , std : : to_string ( streamId ) )
. tag ( " srcId " , std : : to_string ( control . getSrcId ( ) ) )
. tag ( " dstId " , std : : to_string ( control . getDstId ( ) ) )
. field ( " message " , INFLUXDB_ERRSTR_DISABLED_SRC_RID )
. timestamp ( std : : chrono : : duration_cast < std : : chrono : : nanoseconds > ( std : : chrono : : system_clock : : now ( ) . time_since_epoch ( ) ) . count ( ) )
. request ( m_network - > m_influxServer ) ;
}
LogWarning ( LOG_NET , " P25, illegal/unknown RID attempted access, srcId = %u, dstId = %u " , control . getSrcId ( ) , control . getDstId ( ) ) ;
// report In-Call Control to the peer sending traffic
m_network - > writePeerICC ( peerId , NET_SUBFUNC : : PROTOCOL_SUBFUNC_P25 , NET_ICC : : REJECT_TRAFFIC , control . getDstId ( ) ) ;
return false ;
}
}
return true ;
return true ;
}
}