Change in ...osmo-sip-connector[master]: Transmit Bearer Caps to MNCC with SETUP_REQ

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

keith gerrit-no-reply at lists.osmocom.org
Thu Aug 1 16:04:47 UTC 2019


keith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sip-connector/+/15019


Change subject: Transmit Bearer Caps to MNCC with SETUP_REQ
......................................................................

Transmit Bearer Caps to MNCC with SETUP_REQ

This commit attempts to address:
https://osmocom.org/issues/1683

Section MT Call, Point 2.

Change-Id: I55cdc4b7c52730d7e998a1d692c7552fd07403ee
---
M src/mncc.c
1 file changed, 57 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/19/15019/1

diff --git a/src/mncc.c b/src/mncc.c
index ab2bed6..850377e 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -818,12 +818,63 @@
 		OSMO_STRLCPY_ARRAY(mncc.called.number, call->dest);
 	}
 
-	/*
-	 * TODO/FIXME:
-	 *  - Determine/request channel based on offered audio codecs
-	 *  - Screening, redirect?
-	 *  - Synth. the bearer caps based on codecs?
-	 */
+	if (call->initial->payload_type == 8) {
+		/* Full Rate GSM codec requested by SIP side. */
+		mncc.fields |= MNCC_F_BEARER_CAP;
+		struct gsm_mncc_bearer_cap bearer_cap = {
+			.transfer =	GSM48_BCAP_ITCAP_SPEECH,
+			.mode =		GSM48_BCAP_TMOD_CIRCUIT,
+			.coding =	GSM48_BCAP_CODING_GSM_STD,
+			.radio =	GSM48_BCAP_RRQ_FR_ONLY,
+			.speech_ver = { GSM48_BCAP_SV_FR,
+					-1},
+			.data = {
+				.rate_adaption =	GSM48_BCAP_RA_NONE,
+				.sig_access =		0,
+				.async =		0,
+				.nr_stop_bits =		0,
+				.nr_data_bits =		0,
+				.user_rate =		0,
+				.parity =		GSM48_BCAP_PAR_ODD,
+				.interm_rate =		0,
+				.transp =		GSM48_BCAP_TR_TRANSP,
+				.modem_type =		GSM48_BCAP_MT_NONE,
+			},
+		};
+		mncc.bearer_cap = bearer_cap;
+	}
+
+	if (call->initial->payload_type == 98) {
+		/* WARNING: Dynamic Payload type
+		 * in use by current hacker...
+		 *
+		 * FIXME: Store the codec name in the struct
+		 * so that we can check it here.
+		*/
+		mncc.fields |= MNCC_F_BEARER_CAP;
+		struct gsm_mncc_bearer_cap bearer_cap = {
+			.transfer =	GSM48_BCAP_ITCAP_SPEECH,
+			.mode =		GSM48_BCAP_TMOD_CIRCUIT,
+			.coding =	GSM48_BCAP_CODING_GSM_STD,
+			.radio =	GSM48_BCAP_RRQ_DUAL_HR,
+			.speech_ver = { GSM48_BCAP_SV_AMR_H,
+					-1},
+			.data = {
+				.rate_adaption =	GSM48_BCAP_RA_NONE,
+				.sig_access =		0,
+				.async =		0,
+				.nr_stop_bits =		0,
+				.nr_data_bits =		0,
+				.user_rate =		0,
+				.parity =		GSM48_BCAP_PAR_ODD,
+				.interm_rate =		0,
+				.transp =		GSM48_BCAP_TR_TRANSP,
+				.modem_type =		GSM48_BCAP_MT_NONE,
+			},
+		};
+		mncc.bearer_cap = bearer_cap;
+	}
+
 	rc = write(conn->fd.fd, &mncc, sizeof(mncc));
 	if (rc != sizeof(mncc)) {
 		LOGP(DMNCC, LOGL_ERROR, "Failed to send message leg(%u)\n",

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15019
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I55cdc4b7c52730d7e998a1d692c7552fd07403ee
Gerrit-Change-Number: 15019
Gerrit-PatchSet: 1
Gerrit-Owner: keith <keith at rhizomatica.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190801/61cdcca9/attachment.htm>


More information about the gerrit-log mailing list