From 6622ed077c99ceacae243dbcbdec2e920665f46e Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 17 Oct 2022 21:19:26 +0200 Subject: [PATCH] q931: If we're the network, channelID in ALERTING/CALL_PROC/CONNECT is mandatory The user may suggest a given channel in the SETUP, but it's not legal for the network to return a non-mandatory ChannelID. See Q.931 Section 5.1.2 (B-channel selection - Originating): The selected B-channel is indicated in the Channel identification information element coded as "channel is indicated, no acceptable alternative" in the first message returned by the network in response to the SETUP message (i.e. a SETUP ACKNOWLEDGE or CALL PROCEEDING message) In an earlier commit I had only fixed SETUP ACK, but missed that this is a more general problem that needs addressing in whatever is the first message containing a channelID yate sends in response to the SETUP. --- libs/ysig/q931.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/ysig/q931.cpp b/libs/ysig/q931.cpp index dce54d93..a3c6c5cb 100644 --- a/libs/ysig/q931.cpp +++ b/libs/ysig/q931.cpp @@ -1471,6 +1471,8 @@ bool ISDNQ931Call::sendAlerting(SignallingMessage* sigMsg) return sendReleaseComplete("congestion"); } } + if (q931()->network()) + m_data.m_channelMandatory = true; m_data.processChannelID(msg,true,&q931()->parserData()); m_channelIDSent = true; } @@ -1491,6 +1493,8 @@ bool ISDNQ931Call::sendCallProceeding(SignallingMessage* sigMsg) m_rspBearerCaps = false; } if (!m_channelIDSent) { + if (q931()->network()) + m_data.m_channelMandatory = true; m_data.processChannelID(msg,true); m_channelIDSent = true; } @@ -1519,6 +1523,8 @@ bool ISDNQ931Call::sendConnect(SignallingMessage* sigMsg) m_data.m_channelByNumber = true; m_data.m_channelSelect = lookup(m_circuit->code(),Q931Parser::s_dict_channelIDSelect_BRI); } + if (q931()->network()) + m_data.m_channelMandatory = true; m_data.processChannelID(msg,true,&q931()->parserData()); m_channelIDSent = true; }