fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/33912 )
Change subject: fix send_assignment_complete(): proper SCE encoding for CSD ......................................................................
fix send_assignment_complete(): proper SCE encoding for CSD
As stated in 3GPP TS 48.008, section 3.2.2.103, coding of the Speech Codec Element for the CSData Codec Type differs from coding for the actual speech codecs like FR/HR/AMR/etc. However, osmo-bsc currently encodes the "Speech Codec (Choosen)" IE regardless of the channel mode, be it GSM0808_CHAN_SPEECH or GSM0808_CHAN_DATA. This causes failures at the establishment stage of modem-to-modem data calls.
Change-Id: I8b94c0292964f6d5f5ffa98ad8da03728f8bf6a0 Related: OS#6110, OS#4393 --- M src/osmo-bsc/assignment_fsm.c 1 file changed, 55 insertions(+), 19 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/12/33912/1
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 037c256..fbc2b1d 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -200,21 +200,26 @@ return; }
+ if (gscon_is_aoip(conn) && bsc_chan_ind_requires_rtp_stream(conn->assignment.ch_indctr)) { + if (!osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(conn->user_plane.mgw_endpoint_ci_msc, + &addr_local)) { + assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE, + "Unable to compose RTP address of MGW -> MSC"); + return; + } + addr_local_p = &addr_local; + } + /* Generate rtp related fields */ - if (bsc_chan_ind_requires_rtp_stream(conn->assignment.ch_indctr)) { + switch (conn->assignment.ch_indctr) { + case GSM0808_CHAN_SPEECH: perm_spch = gsm0808_permitted_speech(lchan->type, lchan->current_ch_mode_rate.chan_mode);
- if (gscon_is_aoip(conn)) { - if (!osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(conn->user_plane.mgw_endpoint_ci_msc, - &addr_local)) { - assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE, - "Unable to compose RTP address of MGW -> MSC"); - return; - } - addr_local_p = &addr_local; - } + /* below is AoIP specific logic */ + if (!gscon_is_aoip(conn)) + break;
- if (gscon_is_aoip(conn) && conn->assignment.req.use_osmux) { + if (conn->assignment.req.use_osmux) { if (!osmo_mgcpc_ep_ci_get_crcx_info_to_osmux_cid(conn->user_plane.mgw_endpoint_ci_msc, &osmux_cid)) { assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE, @@ -223,14 +228,28 @@ } }
- /* Only AoIP networks include a speech codec (chosen) in the - * assignment complete message. */ - if (gscon_is_aoip(conn)) { - /* Extrapolate speech codec from speech mode */ - gsm0808_speech_codec_from_chan_type(&sc, perm_spch); - sc.cfg = conn->lchan->current_ch_mode_rate.s15_s0; - sc_ptr = ≻ - } + /* Extrapolate speech codec from speech mode */ + gsm0808_speech_codec_from_chan_type(&sc, perm_spch); + sc.cfg = conn->lchan->current_ch_mode_rate.s15_s0; + sc_ptr = ≻ + break; + case GSM0808_CHAN_DATA: + /* below is AoIP specific logic */ + if (!gscon_is_aoip(conn)) + break; + + /* The coding of Speech Codec Element for the CSData Codec Type + * is defined in 3GPP TS 48.008 section 3.2.2.103 */ + sc = (struct gsm0808_speech_codec) { + .pi = true, /* PI indicates CSDoIP is supported */ + .pt = true, /* PT indicates CSDoTDM is supported */ + .type = GSM0808_SCT_CSD, + .cfg = 0, /* R2/R3 not set (redundancy not supported) */ + }; + sc_ptr = ≻ + break; + default: + break; }
resp = gsm0808_create_ass_compl2(lchan->abis_ip.ass_compl.rr_cause,