diff --git a/src/common/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp b/src/common/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp index 3cfe42ba..155a98e2 100644 --- a/src/common/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp +++ b/src/common/p25/lc/tdulc/LC_TEL_INT_VCH_USER.cpp @@ -44,9 +44,9 @@ bool LC_TEL_INT_VCH_USER::decode(const uint8_t* data) ulong64_t rsValue = TDULC::toValue(rs); m_group = false; - m_emergency = (rs[2U] & 0x80U) == 0x80U; // Emergency Flag - m_encrypted = (rs[2U] & 0x40U) == 0x40U; // Encryption Flag - m_priority = (rs[2U] & 0x07U); // Priority + m_emergency = (rs[1U] & 0x80U) == 0x80U; // Emergency Flag + m_encrypted = (rs[1U] & 0x40U) == 0x40U; // Encryption Flag + m_priority = (rs[1U] & 0x07U); // Priority m_callTimer = (uint32_t)((rsValue >> 24) & 0xFFFFU); // Call Timer // the single address is the subscriber unit in the call, which also identifies the call m_dstId = (uint32_t)(rsValue & 0xFFFFFFU); // Source/Target Address diff --git a/src/host/p25/packet/ControlSignaling.cpp b/src/host/p25/packet/ControlSignaling.cpp index 61cb4378..c8d1bdce 100644 --- a/src/host/p25/packet/ControlSignaling.cpp +++ b/src/host/p25/packet/ControlSignaling.cpp @@ -2601,7 +2601,7 @@ bool ControlSignaling::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_ json::object req = json::object(); req["dstId"].set(dstId); if (telInt) { - req["telInt"].set(true); + req["telInt"].set(telInt); } // send blocking RPC request diff --git a/src/host/p25/packet/ControlSignaling.h b/src/host/p25/packet/ControlSignaling.h index 1b035ba0..98cc0767 100644 --- a/src/host/p25/packet/ControlSignaling.h +++ b/src/host/p25/packet/ControlSignaling.h @@ -328,8 +328,8 @@ namespace p25 * @param telInt Flag indicating this grant is for a telephone interconnect call to the unit in dstId. * @returns True, if granted, otherwise false. */ - bool writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOptions, bool grp, bool net = false, bool skip = false, uint32_t chNo = 0U, - bool telInt = false); + bool writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOptions, bool grp, bool net = false, + bool skip = false, uint32_t chNo = 0U, bool telInt = false); /** * @brief Helper to write a grant update packet. */ diff --git a/tests/p25/TSBK_TeleInt_Tests.cpp b/tests/p25/TSBK_TeleInt_Tests.cpp index 8d8ce218..e955b937 100644 --- a/tests/p25/TSBK_TeleInt_Tests.cpp +++ b/tests/p25/TSBK_TeleInt_Tests.cpp @@ -108,7 +108,7 @@ TEST_CASE("TSBK Telephone Interconnect", "[p25][tsbk]") { isp.encode(raw, true, true); REQUIRE((raw[0U] & 0x3FU) == TSBKO::ISP_TELE_INT_PSTN_REQ); - REQUIRE(raw[2U] == 0x80U); // Service Options + REQUIRE(raw[2U] == 0x84U); // Service Options REQUIRE(raw[3U] == 0x00U); // Reserved REQUIRE(raw[4U] == 0x00U); REQUIRE(raw[5U] == 0x00U); @@ -123,6 +123,7 @@ TEST_CASE("TSBK Telephone Interconnect", "[p25][tsbk]") { ISP_TELE_INT_PSTN_REQ* decoded = dynamic_cast(tsbk.get()); REQUIRE(decoded != nullptr); REQUIRE(decoded->getEmergency() == true); + REQUIRE(decoded->getPriority() == 4U); REQUIRE(decoded->getPSTNAddress() == 0x07U); REQUIRE(decoded->getSrcId() == 0x00ABCDU); }