falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/44192?usp=email ) Change subject: gsm: new struct and en/decoding functions for BC-IE ...................................................................... gsm: new struct and en/decoding functions for BC-IE Legacy struct gsm_mncc_bearer_cap is unable to represent 14.4 kbit/s mode of CSD, which is now supported by Osmocom BSS, and even for the mandatory set of BC-IE octets for all data modes, it lacks some of the bits. Introduce a new set of structures to serve as a replacement, as well as new encoding and decoding functions using the new structs. These new structures and functions were originally developed by American 2G Cooperative as part of Hera MSC back end, interfacing to OsmoMSC via the proposed MNCC raw mode and doing our own encoding and decoding of GSM 04.08 CC messages. The present patch is a small step toward making these ThemWi functional improvements available in pure Osmocom, in addition to Osmocom+ThemWi hybrid. The structures and functions have also been extended to be usable on the mobile side of GSM, in addition to the network side. Change-Id: Ie864734fe1dfd1587bafddd4248ce69a7e066525 --- M include/osmocom/gsm/gsm48_ie.h M src/gsm/gsm48_ie.c M src/gsm/libosmogsm.map 3 files changed, 543 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/44192/1 diff --git a/include/osmocom/gsm/gsm48_ie.h b/include/osmocom/gsm/gsm48_ie.h index 4768283..df733fe 100644 --- a/include/osmocom/gsm/gsm48_ie.h +++ b/include/osmocom/gsm/gsm48_ie.h @@ -2,16 +2,128 @@ #pragma once +#include <stdbool.h> #include <stdint.h> #include <string.h> #include <errno.h> +#include <osmocom/core/bits.h> #include <osmocom/core/msgb.h> #include <osmocom/core/defs.h> #include <osmocom/gsm/tlv.h> #include <osmocom/gsm/mncc.h> #include <osmocom/gsm/protocol/gsm_04_08.h> +/* The following structures are intended as a replacement for + * legacy struct gsm_mncc_bearer_cap. */ + +/* Versions of 3GPP TS 24.008 that correspond to the final round + * of enhancements to GSM define a total of 9 different GSM speech + * versions - see Table 10.5.103/3GPP TS 24.008. Therefore, + * we should support this many speech versions in our decoded + * BC-IE data structure. */ +#define OSMO_BCAP_MAX_SPEECH_VER 9 + +struct osmo_bcap_speech { + bool ctm; + uint8_t vers[OSMO_BCAP_MAX_SPEECH_VER]; + uint8_t num_vers; +}; + +/* Low-level decoding of BC-IE data portion */ + +#define OSMO_BCAP_OCT5_MAX_EXT 2 +#define OSMO_BCAP_OCT6_MAX_EXT 7 + +struct osmo_bcap_data_ll { + uint8_t octet_4; + uint8_t octet_5; + uint8_t octet_5_ext[OSMO_BCAP_OCT5_MAX_EXT]; + uint8_t octet_6; + uint8_t octet_6_ext[OSMO_BCAP_OCT6_MAX_EXT]; + uint8_t octet_7; + uint8_t extent_of_5; + uint8_t extent_of_6; + bool have_octet_7; +}; + +/* High-level decoding of BC-IE data portion */ + +struct osmo_bcap_data_hl { + /* fields from octet 4 */ + ubit_t compress; + uint8_t structure; + ubit_t duplex; + ubit_t nirr; + /* fields from octet 5 */ + uint8_t rate_adaption; + uint8_t sig_access; + /* fields from octet 5a */ + uint8_t other_itc; + uint8_t other_ra; + /* fields from octet 5b */ + uint8_t v120_params; + /* fields from octet 6 */ + ubit_t async; + /* fields from octet 6a */ + ubit_t stop_bits_ind; + ubit_t data_bits_ind; + uint8_t user_rate; + /* fields from octet 6b */ + uint8_t interm_rate; + ubit_t nic_tx; + ubit_t nic_rx; + uint8_t parity; + /* fields from octet 6c */ + uint8_t transp; + uint8_t modem_type; + /* fields from octet 6d */ + uint8_t other_modem_type; + uint8_t fnur; + /* fields from octet 6e */ + ubit_t accept_tchf144; + ubit_t accept_tchf96; + ubit_t accept_tchf48; + uint8_t max_tch_minus1; + /* fields from octet 6f */ + uint8_t uimi; + uint8_t waiur; + /* fields from octet 6g */ + ubit_t accept_tch288; + ubit_t accept_tch320; + ubit_t accept_tch432; + uint8_t asymmetry; + /* fields from octet 7 */ + uint8_t uil2p; + bool have_uil2p; +}; + +/* Low-level decoding of the complete BC-IE */ + +struct osmo_bcap_ll { + uint8_t itc; + ubit_t tmod; + ubit_t coding; + uint8_t rrq; + union { + struct osmo_bcap_speech speech; + struct osmo_bcap_data_ll data; + }; +}; + +/* High-level decoding of the complete BC-IE */ + +struct osmo_bcap_hl { + uint8_t itc; + ubit_t tmod; + ubit_t coding; + uint8_t rrq; + union { + struct osmo_bcap_speech speech; + struct osmo_bcap_data_hl data; + }; +}; + /* decode a 'called/calling/connect party BCD number' as in 10.5.4.7 */ int gsm48_decode_bcd_number(char *output, int output_len, const uint8_t *bcd_lv, int h_len) @@ -26,9 +138,18 @@ /* decode 'bearer capability' */ int gsm48_decode_bearer_cap(struct gsm_mncc_bearer_cap *bcap, const uint8_t *lv); +int osmo_gsm48_decode_bcap_ll(struct osmo_bcap_ll *lld, uint8_t ie_len, + const uint8_t *ie_val); +int osmo_gsm48_decode_bcap_hl(struct osmo_bcap_hl *bc, uint8_t ie_len, + const uint8_t *ie_val); /* encode 'bearer capability' */ int gsm48_encode_bearer_cap(struct msgb *msg, int lv_only, const struct gsm_mncc_bearer_cap *bcap); +int osmo_gsm48_encode_bcap_ll(struct msgb *msg, bool lv_only, + const struct osmo_bcap_ll *lld); +int osmo_gsm48_encode_bcap_hl(struct msgb *msg, bool lv_only, + const struct osmo_bcap_hl *bc, + bool ms_rules_6d_6e); /* decode 'call control cap' */ int gsm48_decode_cccap(struct gsm_mncc_cccap *ccap, const uint8_t *lv); /* encode 'call control cap' */ diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index 866e0da..4fc5426 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -185,7 +185,7 @@ return (bcd_cur - bcd_lv); } -/*! Decode TS 04.08 Bearer Capability IE (10.5.4.5) +/*! Decode TS 04.08 Bearer Capability IE (10.5.4.5), legacy version. * \param[out] bcap Caller-provided memory for decoded output * \param[in] lv LV portion of TS 04.08 Bearer Capability * \returns 0 on success; negative on error */ @@ -315,7 +315,222 @@ return 0; } -/*! Encode TS 04.08 Bearer Capability IE (10.5.4.5) +/*! Low-level decode bearer capability IE of 3GPP TS 24.008 section 10.5.4.5. + * \param[out] lld Caller-provided memory for decoded output. + * \param[in] ie_len Length of the received BC-IE value part. + * \param[in] ie_val Value part of the received BC-IE. + * \returns 0 on success; negative on error. + */ +int osmo_gsm48_decode_bcap_ll(struct osmo_bcap_ll *lld, uint8_t ie_len, + const uint8_t *ie_val) +{ + const uint8_t *cp = ie_val; + const uint8_t *endp = ie_val + ie_len; + + memset(&lld, 0, sizeof(struct osmo_bcap_ll)); + if (cp >= endp) /* octet 3 is always mandatory */ + return -EINVAL; + lld->rrq = (*cp & 0x60) >> 5; + lld->coding = (*cp & 0x10) >> 4; + lld->tmod = (*cp & 0x08) >> 3; + lld->itc = *cp & 0x07; + switch (lld->itc) { + case GSM48_BCAP_ITCAP_SPEECH: + while (!(*cp & 0x80)) { + cp++; + if (cp >= endp) + return -EINVAL; + if ((cp == ie_val + 1) && (*cp & 0x20)) + lld->speech.ctm = true; + if (lld->speech.num_vers >= OSMO_BCAP_MAX_SPEECH_VER) + break; + lld->speech.vers[lld->speech.num_vers++] = *cp & 0x0F; + } + break; + case GSM48_BCAP_ITCAP_UNR_DIG_INF: + case GSM48_BCAP_ITCAP_3k1_AUDIO: + case GSM48_BCAP_ITCAP_FAX_G3: + case GSM48_BCAP_ITCAP_OTHER: + if (!(*cp & 0x80)) /* no octets 3a etc for data */ + return -EINVAL; + cp++; + if (cp >= endp) /* octet 4 is mandatory for data */ + return -EINVAL; + if (!(*cp & 0x80)) /* ... and does not allow extension */ + return -EINVAL; + lld->data.octet_4 = *cp++; + if (cp >= endp) /* octet 5 is mandatory too */ + return -EINVAL; + if ((*cp & 0x60) != 0x00) /* verify that it really is octet 5 */ + return -EINVAL; + lld->data.octet_5 = *cp; + while (!(*cp & 0x80)) { + cp++; + if (cp >= endp) + return -EINVAL; + if (lld->data.extent_of_5 >= OSMO_BCAP_OCT5_MAX_EXT) + return -EINVAL; + lld->data.octet_5_ext[lld->data.extent_of_5++] = *cp; + } + cp++; + if (cp >= endp) /* octet 6 is mandatory */ + return -EINVAL; + if ((*cp & 0x60) != 0x20) /* verify that it really is octet 6 */ + return -EINVAL; + lld->data.octet_6 = *cp; + while (!(*cp & 0x80)) { + cp++; + if (cp >= endp) + return -EINVAL; + if (lld->data.extent_of_6 >= OSMO_BCAP_OCT6_MAX_EXT) + return -EINVAL; + lld->data.octet_6_ext[lld->data.extent_of_6++] = *cp; + } + cp++; + if (cp >= endp) /* octet 7 is optional */ + break; + if ((*cp & 0x60) != 0x40) /* verify that it really is octet 7 */ + return -EINVAL; + if (!(*cp & 0x80)) /* it does not allow extension */ + return -EINVAL; + lld->data.have_octet_7 = true; + lld->data.octet_7 = *cp; + break; + default: + return -EOPNOTSUPP; + } + return 0; +} + +static void bcap_speech_dec_phase1_logic(struct osmo_bcap_hl *bc) +{ + switch (bc->rrq) { + case GSM48_BCAP_RRQ_FR_ONLY: + bc->speech.vers[0] = GSM48_BCAP_SV_FR; + bc->speech.num_vers = 1; + break; + case GSM48_BCAP_RRQ_DUAL_HR: + bc->speech.vers[0] = GSM48_BCAP_SV_HR; + bc->speech.vers[1] = GSM48_BCAP_SV_FR; + bc->speech.num_vers = 2; + break; + case GSM48_BCAP_RRQ_DUAL_FR: + bc->speech.vers[0] = GSM48_BCAP_SV_FR; + bc->speech.vers[1] = GSM48_BCAP_SV_HR; + bc->speech.num_vers = 2; + break; + } +} + +static void bcap_hl_decode_data(struct osmo_bcap_data_hl *hld, + const struct osmo_bcap_data_ll *lld) +{ + /* fields from octet 4 */ + hld->compress = (lld->octet_4 & 0x40) >> 6; + hld->structure = (lld->octet_4 & 0x30) >> 4; + hld->duplex = (lld->octet_4 & 0x08) >> 3; + hld->nirr = (lld->octet_4 & 0x02) >> 1; + /* fields from octet 5 */ + hld->rate_adaption = (lld->octet_5 & 0x18) >> 3; + hld->sig_access = lld->octet_5 & 0x07; + /* fields from octet 5a */ + if (lld->extent_of_5 >= 1) { + hld->other_itc = (lld->octet_5_ext[0] & 0x60) >> 5; + hld->other_ra = (lld->octet_5_ext[0] & 0x18) >> 3; + } + /* fields from octet 5b */ + if (lld->extent_of_5 >= 2) + hld->v120_params = lld->octet_5_ext[1]; + /* fields from octet 6 */ + hld->async = lld->octet_6 & 1; + /* fields from octet 6a */ + hld->stop_bits_ind = (lld->octet_6_ext[0] & 0x40) >> 6; + hld->data_bits_ind = (lld->octet_6_ext[0] & 0x10) >> 4; + hld->user_rate = lld->octet_6_ext[0] & 0x0F; + /* fields from octet 6b */ + hld->interm_rate = (lld->octet_6_ext[1] & 0x60) >> 5; + hld->nic_tx = (lld->octet_6_ext[1] & 0x10) >> 4; + hld->nic_rx = (lld->octet_6_ext[1] & 0x08) >> 3; + hld->parity = lld->octet_6_ext[1] & 0x07; + /* fields from octet 6c */ + hld->transp = (lld->octet_6_ext[2] & 0x60) >> 5; + hld->modem_type = lld->octet_6_ext[2] & 0x1F; + /* fields from octet 6d */ + if (lld->extent_of_6 >= 4) { + hld->other_modem_type = (lld->octet_6_ext[3] & 0x60) >> 5; + hld->fnur = lld->octet_6_ext[3] & 0x1F; + } + /* fields from octet 6e */ + if (lld->extent_of_6 >= 5) { + hld->accept_tchf144 = (lld->octet_6_ext[4] & 0x40) >> 6; + hld->accept_tchf96 = (lld->octet_6_ext[4] & 0x10) >> 4; + hld->accept_tchf48 = (lld->octet_6_ext[4] & 0x08) >> 3; + hld->max_tch_minus1 = lld->octet_6_ext[4] & 0x07; + } + /* fields from octet 6f */ + if (lld->extent_of_6 >= 6) { + hld->uimi = (lld->octet_6_ext[5] & 0x70) >> 4; + hld->waiur = lld->octet_6_ext[5] & 0x0F; + } + /* fields from octet 6g */ + if (lld->extent_of_6 >= 7) { + hld->accept_tch288 = (lld->octet_6_ext[6] & 0x40) >> 6; + hld->accept_tch320 = (lld->octet_6_ext[6] & 0x20) >> 5; + hld->accept_tch432 = (lld->octet_6_ext[6] & 0x10) >> 4; + hld->asymmetry = (lld->octet_6_ext[6] & 0x0C) >> 2; + } + /* fields from octet 7 */ + if (lld->have_octet_7) { + hld->uil2p = lld->octet_7 & 0x1F; + hld->have_uil2p = true; + } +} + +/*! High-level decode bearer capability IE of 3GPP TS 24.008 section 10.5.4.5. + * \param[out] bc Caller-provided memory for decoded output. + * \param[in] ie_len Length of the received BC-IE value part. + * \param[in] ie_val Value part of the received BC-IE. + * \returns 0 on success; negative on error. + */ +int osmo_gsm48_decode_bcap_hl(struct osmo_bcap_hl *bc, uint8_t ie_len, + const uint8_t *ie_val) +{ + struct osmo_bcap_ll lld; + int rc; + + memset(&bc, 0, sizeof(struct osmo_bcap_hl)); + rc = osmo_gsm48_decode_bcap_ll(&lld, ie_len, ie_val); + if (rc < 0) + return rc; + bc->itc = lld.itc; + bc->tmod = lld.tmod; + bc->coding = lld.coding; + bc->rrq = lld.rrq; + switch (lld.itc) { + case GSM48_BCAP_ITCAP_SPEECH: + if (lld.speech.num_vers != 0) { + memcpy(&bc->speech, &lld.speech, + sizeof(struct osmo_bcap_speech)); + } else { + bcap_speech_dec_phase1_logic(bc); + } + break; + case GSM48_BCAP_ITCAP_UNR_DIG_INF: + case GSM48_BCAP_ITCAP_3k1_AUDIO: + case GSM48_BCAP_ITCAP_FAX_G3: + case GSM48_BCAP_ITCAP_OTHER: + /* octets 6a, 6b and 6c are mandatory */ + if (lld.data.extent_of_6 < 3) + return -EINVAL; + bcap_hl_decode_data(&bc->data, &lld.data); + break; + default: + return -EOPNOTSUPP; + } + return 0; +} + +/*! Encode TS 04.08 Bearer Capability IE (10.5.4.5), legacy version. * \param[out] msg Message Buffer to which IE is to be appended * \param[in] lv_only Write only LV portion (1) or TLV (0) * \param[in] bcap Decoded Bearer Capability to be encoded @@ -392,6 +607,207 @@ return 0; } +/*! Low-level encode bearer capability IE of 3GPP TS 24.008 section 10.5.4.5. + * \param[out] msg Message buffer to which BC-IE is to be appended. + * \param[in] lv_only Write only LV portion (true) or TLV (false). + * \param[in] lld Low-level decoded BC-IE to be encoded. + * \returns 0 on success; negative on error. + */ +int osmo_gsm48_encode_bcap_ll(struct msgb *msg, bool lv_only, + const struct osmo_bcap_ll *lld) +{ + uint8_t buf[14]; /* max len with all optional octets included */ + uint8_t *cp = buf; + uint8_t octet_3 = 0; + uint8_t n; + + octet_3 |= lld->rrq << 5; + octet_3 |= lld->coding << 4; + octet_3 |= lld->tmod << 3; + octet_3 |= lld->itc; + switch (lld->itc) { + case GSM48_BCAP_ITCAP_SPEECH: + for (n = 0; n < lld->speech.num_vers; n++) { + *cp++ = octet_3; + octet_3 = lld->speech.vers[n]; + if (n == 0 && lld->speech.ctm) + octet_3 |= 0x20; + } + octet_3 |= 0x80; + *cp++ = octet_3; + break; + case GSM48_BCAP_ITCAP_UNR_DIG_INF: + case GSM48_BCAP_ITCAP_3k1_AUDIO: + case GSM48_BCAP_ITCAP_FAX_G3: + case GSM48_BCAP_ITCAP_OTHER: + octet_3 |= 0x80; + *cp++ = octet_3; + *cp++ = lld->data.octet_4; + *cp++ = lld->data.octet_5; + for (n = 0; n < lld->data.extent_of_5; n++) + *cp++ = lld->data.octet_5_ext[n]; + *cp++ = lld->data.octet_6; + for (n = 0; n < lld->data.extent_of_6; n++) + *cp++ = lld->data.octet_6_ext[n]; + if (lld->data.have_octet_7) + *cp++ = lld->data.octet_7; + break; + default: + return -EOPNOTSUPP; + } + if (lv_only) + msgb_lv_put(msg, cp - buf, buf); + else + msgb_tlv_put(msg, GSM48_IE_BEARER_CAP, cp - buf, buf); + return 0; +} + +static void bcap_enc_trim_6d_6f(struct osmo_bcap_data_ll *lld, + bool ms_rules_6d_6e) +{ + if (lld->octet_6_ext[6]) { + lld->octet_6_ext[6] |= 0x80; + lld->extent_of_6 = 7; + return; + } + if (lld->octet_6_ext[5]) { + lld->octet_6_ext[5] |= 0x80; + lld->extent_of_6 = 6; + return; + } + if (lld->octet_6_ext[4]) { + lld->octet_6_ext[4] |= 0x80; + lld->extent_of_6 = 5; + return; + } + if (lld->octet_6_ext[3]) { + if (ms_rules_6d_6e) { + lld->octet_6_ext[4] |= 0x80; + lld->extent_of_6 = 5; + } else { + lld->octet_6_ext[3] |= 0x80; + lld->extent_of_6 = 4; + } + return; + } + lld->octet_6_ext[2] |= 0x80; + lld->extent_of_6 = 3; +} + +static void bcap_hl_encode_data(struct osmo_bcap_data_ll *lld, + const struct osmo_bcap_data_hl *hld, + enum gsm48_bcap_itcap itcap, + bool ms_rules_6d_6e) +{ + lld->octet_4 = 0x80; + lld->octet_4 |= hld->compress << 6; + lld->octet_4 |= hld->structure << 4; + lld->octet_4 |= hld->duplex << 3; + lld->octet_4 |= hld->nirr << 1; + lld->octet_5 = 0; + lld->octet_5 |= hld->rate_adaption << 3; + lld->octet_5 |= hld->sig_access; + if (itcap == GSM48_BCAP_ITCAP_OTHER || + hld->rate_adaption == GSM48_BCAP_RA_OTHER) { + lld->octet_5_ext[0] = 0; + lld->octet_5_ext[0] |= (hld->other_itc) << 5; + lld->octet_5_ext[0] |= (hld->other_ra) << 3; + if (hld->other_ra == GSM48_BCAP_OTHER_RA_V120) { + lld->octet_5_ext[1] = 0x80 | hld->v120_params; + lld->extent_of_5 = 2; + } else { + lld->octet_5_ext[0] |= 0x80; + lld->extent_of_5 = 1; + } + } else { + lld->octet_5 |= 0x80; + lld->extent_of_5 = 0; + } + lld->octet_6 = 0x20; + lld->octet_6 |= hld->async; + lld->octet_6_ext[0] = 0; + lld->octet_6_ext[0] |= hld->stop_bits_ind << 6; + lld->octet_6_ext[0] |= hld->data_bits_ind << 4; + lld->octet_6_ext[0] |= hld->user_rate; + lld->octet_6_ext[1] = 0; + lld->octet_6_ext[1] |= hld->interm_rate << 5; + lld->octet_6_ext[1] |= hld->nic_tx << 4; + lld->octet_6_ext[1] |= hld->nic_rx << 3; + lld->octet_6_ext[1] |= hld->parity; + lld->octet_6_ext[2] = 0; + lld->octet_6_ext[2] |= hld->transp << 5; + lld->octet_6_ext[2] |= hld->modem_type; + /* Octets 6d through 6g: fill out all of them initially, + * then trim any unused ones. */ + lld->octet_6_ext[3] = 0; + lld->octet_6_ext[3] |= hld->other_modem_type << 5; + lld->octet_6_ext[3] |= hld->fnur; + lld->octet_6_ext[4] = 0; + lld->octet_6_ext[4] |= hld->accept_tchf144 << 6; + lld->octet_6_ext[4] |= hld->accept_tchf96 << 4; + lld->octet_6_ext[4] |= hld->accept_tchf48 << 3; + lld->octet_6_ext[4] |= hld->max_tch_minus1; + lld->octet_6_ext[5] = 0; + lld->octet_6_ext[5] |= hld->uimi << 4; + lld->octet_6_ext[5] |= hld->waiur; + lld->octet_6_ext[6] = 0; + lld->octet_6_ext[6] |= hld->accept_tch288 << 6; + lld->octet_6_ext[6] |= hld->accept_tch320 << 5; + lld->octet_6_ext[6] |= hld->accept_tch432 << 4; + lld->octet_6_ext[6] |= hld->asymmetry << 2; + bcap_enc_trim_6d_6f(lld, ms_rules_6d_6e); + if (hld->have_uil2p) { + lld->octet_7 = 0xC0 | hld->uil2p; + lld->have_octet_7 = true; + } else { + lld->have_octet_7 = false; + } +} + +/*! High-level encode bearer capability IE of 3GPP TS 24.008 section 10.5.4.5. + * \param[out] msg Message buffer to which BC-IE is to be appended. + * \param[in] lv_only Write only LV portion (true) or TLV (false). + * \param[in] bc High-level decoded BC-IE to be encoded. + * \param[in] ms_rules_6d_6e Apply MS rules for inclusion of octets 6d and 6e. + * \returns 0 on success; negative on error. + * + * TS 24.008 section 10.5.4.5.1 stipulates that extension octets through 6c + * are mandatory for all non-speech calls - but the rules for 6d through 6g + * are slightly different between MS->network and network->MS directions. + * For BC-IE emitted by MS, the rule says that if 6d is included, then 6e + * shall be included too - but in the network->MS direction, the MSC can + * trim that extension octet train at any sensible point after 6c. If the + * network needs to send non-zero FNUR or V.34 selection, but there is no + * octet 6f for UIMI, then ending at octet 6d is the normal case. + */ +int osmo_gsm48_encode_bcap_hl(struct msgb *msg, bool lv_only, + const struct osmo_bcap_hl *bc, + bool ms_rules_6d_6e) +{ + struct osmo_bcap_ll lld; + + lld.itc = bc->itc; + lld.tmod = bc->tmod; + lld.coding = bc->coding; + lld.rrq = bc->rrq; + switch (lld.itc) { + case GSM48_BCAP_ITCAP_SPEECH: + memcpy(&lld.speech, &bc->speech, + sizeof(struct osmo_bcap_speech)); + break; + case GSM48_BCAP_ITCAP_UNR_DIG_INF: + case GSM48_BCAP_ITCAP_3k1_AUDIO: + case GSM48_BCAP_ITCAP_FAX_G3: + case GSM48_BCAP_ITCAP_OTHER: + bcap_hl_encode_data(&lld.data, &bc->data, lld.itc, + ms_rules_6d_6e); + break; + default: + return -EOPNOTSUPP; + } + return osmo_gsm48_encode_bcap_ll(msg, lv_only, &lld); +} + /*! Decode TS 04.08 Call Control Capabilities IE (10.5.4.5a) * \param[out] ccap Caller-provided memory for decoded CC capabilities * \param[in] lv Length-Value of IE diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 88ee3ae..2cb768f 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -436,6 +436,10 @@ gsm48_mi_to_string; gsm48_chan_mode_to_vamos; gsm48_chan_mode_to_non_vamos; +osmo_gsm48_decode_bcap_hl; +osmo_gsm48_decode_bcap_ll; +osmo_gsm48_encode_bcap_hl; +osmo_gsm48_encode_bcap_ll; osmo_mobile_identity_to_str_buf; osmo_mobile_identity_to_str_c; osmo_mobile_identity_cmp; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44192?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie864734fe1dfd1587bafddd4248ce69a7e066525 Gerrit-Change-Number: 44192 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon@freecalypso.org>