osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bsc/+/31549 )
Change subject: rsl_tx_ipacc_crcx/mdcx: omit speech mode for CSD
......................................................................
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
---
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/lchan_rtp_fsm.c
2 files changed, 58 insertions(+), 24 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/49/31549/1
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 76b245c..ae0bf31 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -2744,16 +2744,25 @@
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->abis_ip.rtp_payload == RTP_PT_CSDATA)
+ 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);
@@ -2787,7 +2796,8 @@
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->abis_ip.rtp_payload != RTP_PT_CSDATA)
+ 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);
@@ -2810,14 +2820,23 @@
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->abis_ip.rtp_payload == RTP_PT_CSDATA)
+ 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);
}
diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c
index 8b61f1e..d128463 100644
--- a/src/osmo-bsc/lchan_rtp_fsm.c
+++ b/src/osmo-bsc/lchan_rtp_fsm.c
@@ -307,15 +307,6 @@
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;
- }
- lchan->abis_ip.speech_mode = val;
-
val = ipacc_payload_type(lchan->activate.ch_mode_rate.chan_mode, lchan->type);
if (val < 0) {
lchan_rtp_fail("Cannot determine Abis/IP payload type for tch_mode=%s
type=%s",
@@ -325,6 +316,17 @@
}
lchan->abis_ip.rtp_payload = val;
+ if (lchan->abis_ip.rtp_payload != RTP_PT_CSDATA) {
+ 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;
+ }
+
/* recv-only */
ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, false);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/31549
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I6641b713177276bcf798f08123e1dd2e88ffdce6
Gerrit-Change-Number: 31549
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange