add telephoneInterconnect control channel option; forward P25 telephone interconnect PSTN requests, answer responses and interconnect cancels to the network, and only transmit network answer requests for units registered to the site;

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pull/133/head
majmongoose 1 month ago
parent 6430e78e08
commit 4a201b3380

@ -343,6 +343,9 @@ protocols:
noMessageAck: true
# Flag indicating that unit-to-unit availiability checks should be performed for a private call.
unitToUnitAvailCheck: false
# Flag indicating telephone interconnect requests are forwarded to the network for a telephone
# interconnect gateway peer to service. (If disabled, telephone interconnect requests are denied.)
telephoneInterconnect: false
# Flag indicating explicit source ID support is enabled.
allowExplicitSourceId: false
# Flag indicating whether or not the host will disable sending deny responses when operating in conventional.

@ -271,6 +271,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw
m_control->m_noStatusAck = p25Protocol["noStatusAck"].as<bool>(false);
m_control->m_noMessageAck = p25Protocol["noMessageAck"].as<bool>(true);
m_control->m_unitToUnitAvailCheck = p25Protocol["unitToUnitAvailCheck"].as<bool>(true);
m_control->m_telephoneInterconnect = p25Protocol["telephoneInterconnect"].as<bool>(false);
m_sndcpSupport = p25Protocol["sndcpSupport"].as<bool>(false);
@ -531,6 +532,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw
LogInfo(" No Status ACK: %s", m_control->m_noStatusAck ? "yes" : "no");
LogInfo(" No Message ACK: %s", m_control->m_noMessageAck ? "yes" : "no");
LogInfo(" Unit-to-Unit Availability Check: %s", m_control->m_unitToUnitAvailCheck ? "yes" : "no");
LogInfo(" Telephone Interconnect: %s", m_control->m_telephoneInterconnect ? "yes" : "no");
LogInfo(" Explicit Source ID Support: %s", m_allowExplicitSourceId ? "yes" : "no");
LogInfo(" Conventional Network Grant Demand: %s", m_convNetGrantDemand ? "yes" : "no");
LogInfo(" Demand Unit Registration for Refused Affiliation: %s", m_demandUnitRegForRefusedAff ? "yes" : "no");

@ -310,6 +310,37 @@ bool ControlSignaling::process(uint8_t* data, uint32_t len, std::unique_ptr<lc::
}
}
break;
case TSBKO::ISP_TELE_INT_PSTN_REQ:
{
// make sure control data is supported
IS_SUPPORT_CONTROL_CHECK(tsbk->toString(true), TSBKO::ISP_TELE_INT_PSTN_REQ, srcId);
// validate the source RID
VALID_SRCID(tsbk->toString(true), TSBKO::ISP_TELE_INT_PSTN_REQ, srcId);
if (!m_telephoneInterconnect || m_p25->m_network == nullptr) {
LogWarning(LOG_RF, P25_TSDU_STR ", %s denial, unsupported service, srcId = %u", tsbk->toString(true).c_str(), srcId);
writeRF_TSDU_Deny(srcId, WUID_FNE, ReasonCode::DENY_SYS_UNSUPPORTED_SVC, TSBKO::ISP_TELE_INT_PSTN_REQ);
m_p25->m_rfState = RS_RF_REJECTED;
return false;
}
// verify the source RID is registered
VERIFY_SRCID_REG(tsbk->toString(true), TSBKO::ISP_TELE_INT_PSTN_REQ, srcId);
ISP_TELE_INT_PSTN_REQ* isp = static_cast<ISP_TELE_INT_PSTN_REQ*>(tsbk.get());
if (m_verbose) {
LogInfoEx(LOG_RF, P25_TSDU_STR ", %s, pstnAddress = %u, srcId = %u",
tsbk->toString(true).c_str(), isp->getPSTNAddress(), srcId);
}
::ActivityLog("P25", true, "telephone interconnect request from %u to PSTN address %u", srcId, isp->getPSTNAddress());
// the telephone interconnect gateway places the call and demands the channel grant
RF_TO_WRITE_NET(isp);
writeRF_TSDU_ACK_FNE(srcId, TSBKO::ISP_TELE_INT_PSTN_REQ, false, true);
}
break;
case TSBKO::IOSP_TELE_INT_ANS:
{
// make sure control data is supported
@ -318,7 +349,23 @@ bool ControlSignaling::process(uint8_t* data, uint32_t len, std::unique_ptr<lc::
// validate the source RID
VALID_SRCID(tsbk->toString(true), TSBKO::IOSP_TELE_INT_ANS, srcId);
writeRF_TSDU_Deny(srcId, WUID_FNE, ReasonCode::DENY_SYS_UNSUPPORTED_SVC, TSBKO::IOSP_TELE_INT_ANS);
if (!m_telephoneInterconnect || m_p25->m_network == nullptr) {
LogWarning(LOG_RF, P25_TSDU_STR ", %s denial, unsupported service, srcId = %u", tsbk->toString(true).c_str(), srcId);
writeRF_TSDU_Deny(srcId, WUID_FNE, ReasonCode::DENY_SYS_UNSUPPORTED_SVC, TSBKO::IOSP_TELE_INT_ANS);
m_p25->m_rfState = RS_RF_REJECTED;
return false;
}
IOSP_TELE_INT_ANS* iosp = static_cast<IOSP_TELE_INT_ANS*>(tsbk.get());
if (m_verbose) {
LogInfoEx(LOG_RF, P25_TSDU_STR ", %s, response = $%02X, srcId = %u",
tsbk->toString(true).c_str(), iosp->getResponse(), srcId);
}
::ActivityLog("P25", true, "telephone interconnect answer response from %u", srcId);
// forward the received frame as-is; re-encoding would produce the OSP (answer request) layout
writeNetworkRF(iosp, data + 2U, true);
}
break;
case TSBKO::ISP_SNDCP_CH_REQ:
@ -475,6 +522,13 @@ bool ControlSignaling::process(uint8_t* data, uint32_t len, std::unique_ptr<lc::
::ActivityLog("P25", true, "cancel service request from %u", srcId);
// the telephone interconnect gateway must release the call
uint8_t service = isp->getService();
if (m_telephoneInterconnect && (service == TSBKO::IOSP_TELE_INT_DIAL || service == TSBKO::ISP_TELE_INT_PSTN_REQ ||
service == TSBKO::IOSP_TELE_INT_ANS)) {
RF_TO_WRITE_NET(isp);
}
writeRF_TSDU_ACK_FNE(srcId, isp->getService(), false, true);
}
break;
@ -872,6 +926,32 @@ bool ControlSignaling::processNetwork(uint8_t* data, uint32_t len, lc::LC& contr
}
}
break;
case TSBKO::IOSP_TELE_INT_DIAL:
case TSBKO::ISP_TELE_INT_PSTN_REQ:
return true; // don't allow this to write to the air
case TSBKO::IOSP_TELE_INT_ANS:
{
if (!m_telephoneInterconnect) {
return true; // don't allow this to write to the air
}
// validate the target RID
VALID_DSTID_NET(tsbk->toString(), dstId);
// only alert units registered to this site
if (!m_p25->m_affiliations->isUnitReg(dstId)) {
return true; // don't allow this to write to the air
}
IOSP_TELE_INT_ANS* iosp = static_cast<IOSP_TELE_INT_ANS*>(tsbk.get());
if (m_verbose) {
LogInfoEx(LOG_NET, P25_TSDU_STR ", %s, digits = %s, dstId = %u",
tsbk->toString().c_str(), iosp->getDigits().c_str(), dstId);
}
::ActivityLog("P25", false, "telephone interconnect answer request to %u", dstId);
}
break;
case TSBKO::IOSP_STS_UPDT:
{
// validate the source RID
@ -1295,6 +1375,7 @@ ControlSignaling::ControlSignaling(Control* p25, bool dumpTSBKData, bool debug,
m_noStatusAck(false),
m_noMessageAck(true),
m_unitToUnitAvailCheck(true),
m_telephoneInterconnect(false),
m_convFallbackPacketDelay(0U),
m_convFallback(false),
m_adjSiteUpdateTimer(1000U),

@ -189,6 +189,7 @@ namespace p25
bool m_noStatusAck;
bool m_noMessageAck;
bool m_unitToUnitAvailCheck;
bool m_telephoneInterconnect;
uint8_t m_convFallbackPacketDelay;
bool m_convFallback;

Loading…
Cancel
Save

Powered by TurnKey Linux.