rsl_tx_ipacc_crcx/mdcx: omit speech mode for CSD

Omit the A-bis/IP specific RSL_IE_IPAC_SPEECH_MODE, as it doesn't make
sense for circuit switched data.

Related: OS#4393
Change-Id: I6641b713177276bcf798f08123e1dd2e88ffdce6
This commit is contained in:
Oliver Smith 2023-02-16 17:46:52 +01:00
parent d5eb0f1b57
commit d5ca920cc3
2 changed files with 43 additions and 22 deletions

View File

@ -2755,16 +2755,25 @@ int rsl_tx_ipacc_crcx(const struct gsm_lchan *lchan)
dh->c.msg_discr = ABIS_RSL_MDISC_IPACCESS;
dh->chan_nr = chan_nr;
/* 0x1- == receive-only, 0x-1 == EFR codec */
msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode);
if (lchan->current_ch_indctr == GSM0808_CHAN_DATA) {
LOG_LCHAN(lchan, LOGL_DEBUG,
"Sending IPACC CRCX to BTS: RTP_PAYLOAD=%d (CSD) osmux_use=%d osmux_loc_cid=%d\n",
lchan->abis_ip.rtp_payload,
lchan->abis_ip.osmux.use, lchan->abis_ip.osmux.local_cid);
} else {
/* 0x1- == receive-only, 0x-1 == EFR codec */
msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode);
LOG_LCHAN(lchan, LOGL_DEBUG,
"Sending IPACC CRCX to BTS: speech_mode=0x%02x RTP_PAYLOAD=%d osmux_use=%d osmux_loc_cid=%d\n",
lchan->abis_ip.speech_mode, lchan->abis_ip.rtp_payload,
lchan->abis_ip.osmux.use, lchan->abis_ip.osmux.local_cid);
}
msgb_tv_put(msg, RSL_IE_IPAC_RTP_PAYLOAD, lchan->abis_ip.rtp_payload);
if (lchan->abis_ip.osmux.use)
msgb_tlv_put(msg, RSL_IE_OSMO_OSMUX_CID, 1, &lchan->abis_ip.osmux.local_cid);
LOG_LCHAN(lchan, LOGL_DEBUG,
"Sending IPACC CRCX to BTS: speech_mode=0x%02x RTP_PAYLOAD=%d osmux_use=%d osmux_loc_cid=%d\n",
lchan->abis_ip.speech_mode, lchan->abis_ip.rtp_payload,
lchan->abis_ip.osmux.use, lchan->abis_ip.osmux.local_cid);
msg->dst = rsl_chan_link(lchan);
@ -2798,7 +2807,8 @@ struct msgb *rsl_make_ipacc_mdcx(const struct gsm_lchan *lchan, uint32_t dest_ip
att_ip = (uint32_t *)msgb_put(msg, sizeof(uint32_t));
*att_ip = htonl(dest_ip);
msgb_tv16_put(msg, RSL_IE_IPAC_REMOTE_PORT, dest_port);
msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode);
if (lchan->current_ch_indctr == GSM0808_CHAN_SPEECH)
msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode);
msgb_tv_put(msg, RSL_IE_IPAC_RTP_PAYLOAD, lchan->abis_ip.rtp_payload);
if (lchan->abis_ip.rtp_payload2)
msgb_tv_put(msg, RSL_IE_IPAC_RTP_PAYLOAD2, lchan->abis_ip.rtp_payload2);
@ -2821,14 +2831,23 @@ int rsl_tx_ipacc_mdcx(const struct gsm_lchan *lchan)
if (!msg)
return -EINVAL;
LOG_LCHAN(lchan, LOGL_DEBUG, "Sending IPACC MDCX to BTS:"
" %s:%u rtp_payload=%u rtp_payload2=%u conn_id=%u speech_mode=0x%02x\n",
ip_to_a(lchan->abis_ip.connect_ip),
lchan->abis_ip.connect_port,
lchan->abis_ip.rtp_payload,
lchan->abis_ip.rtp_payload2,
lchan->abis_ip.conn_id,
lchan->abis_ip.speech_mode);
if (lchan->current_ch_indctr == GSM0808_CHAN_DATA)
LOG_LCHAN(lchan, LOGL_DEBUG, "Sending IPACC MDCX to BTS:"
" %s:%u rtp_payload=%u (CSD) rtp_payload2=%u conn_id=%u\n",
ip_to_a(lchan->abis_ip.connect_ip),
lchan->abis_ip.connect_port,
lchan->abis_ip.rtp_payload,
lchan->abis_ip.rtp_payload2,
lchan->abis_ip.conn_id);
else
LOG_LCHAN(lchan, LOGL_DEBUG, "Sending IPACC MDCX to BTS:"
" %s:%u rtp_payload=%u rtp_payload2=%u conn_id=%u speech_mode=0x%02x\n",
ip_to_a(lchan->abis_ip.connect_ip),
lchan->abis_ip.connect_port,
lchan->abis_ip.rtp_payload,
lchan->abis_ip.rtp_payload2,
lchan->abis_ip.conn_id,
lchan->abis_ip.speech_mode);
return abis_rsl_sendmsg(msg);
}

View File

@ -307,14 +307,16 @@ static void lchan_rtp_fsm_wait_ipacc_crcx_ack_onenter(struct osmo_fsm_inst *fi,
return;
}
val = ipacc_speech_mode(lchan->activate.ch_mode_rate.chan_mode, lchan->type);
if (val < 0) {
lchan_rtp_fail("Cannot determine Abis/IP speech mode for tch_mode=%s type=%s",
get_value_string(gsm48_chan_mode_names, lchan->activate.ch_mode_rate.chan_mode),
gsm_chan_t_name(lchan->type));
return;
if (lchan->current_ch_indctr == GSM0808_CHAN_SPEECH) {
val = ipacc_speech_mode(lchan->activate.ch_mode_rate.chan_mode, lchan->type);
if (val < 0) {
lchan_rtp_fail("Cannot determine Abis/IP speech mode for tch_mode=%s type=%s",
get_value_string(gsm48_chan_mode_names, lchan->activate.ch_mode_rate.chan_mode),
gsm_chan_t_name(lchan->type));
return;
}
lchan->abis_ip.speech_mode = val;
}
lchan->abis_ip.speech_mode = val;
val = ipacc_payload_type(lchan->activate.ch_mode_rate.chan_mode, lchan->type);
if (val < 0) {