osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/41042?usp=email )
Change subject: gsm48_cc_tx_setup: remove extra bearer_cap var
......................................................................
gsm48_cc_tx_setup: remove extra bearer_cap var
Store the bearer capabilities directly in the transaction, instead of
storing them in a separate variable first, then copying it to the
transaction, then using both the separate variable and the copy in the
transaction later on. The extra variable is not needed and only makes it
more compilicated.
Add an explicit '.transfer = GSM48_BCAP_ITCAP_SPEECH,' while at it in
the speech case. This was already set implicitly because
GSM48_BCAP_ITCAP_SPEECH is 0.
Change-Id: I247ef10923c2875ca75e73046f4b8ed14190d4d2
---
M src/libmsc/gsm_04_08_cc.c
1 file changed, 11 insertions(+), 16 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/42/41042/1
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index a429bc4..63a9018 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -915,18 +915,18 @@
* Versions) / CSD bearer services remaining after intersecting MS, BSS and
* remote call leg restrictions. To store in trans for later use, and to
* include in the outgoing CC Setup message. */
-static int gsm48_cc_tx_setup_set_bearer_cap(struct gsm_trans *trans, const struct gsm_mncc *setup,
- struct gsm_mncc_bearer_cap *bearer_cap)
+static int gsm48_cc_tx_setup_set_bearer_cap(struct gsm_trans *trans, const struct gsm_mncc *setup)
{
int rc;
switch (trans->bearer_cap.transfer) {
case GSM48_BCAP_ITCAP_SPEECH:
- *bearer_cap = (struct gsm_mncc_bearer_cap){
+ trans->bearer_cap = (struct gsm_mncc_bearer_cap){
+ .transfer = GSM48_BCAP_ITCAP_SPEECH,
.speech_ver = { -1 },
};
- sdp_audio_codecs_to_bearer_cap(bearer_cap, &trans->cc.local.audio_codecs);
- rc = bearer_cap_set_radio(bearer_cap);
+ sdp_audio_codecs_to_bearer_cap(&trans->bearer_cap, &trans->cc.local.audio_codecs);
+ rc = bearer_cap_set_radio(&trans->bearer_cap);
if (rc) {
LOG_TRANS(trans, LOGL_ERROR, "Error composing Bearer Capability for CC Setup\n");
return -1;
@@ -936,7 +936,7 @@
* transcode, we could use non-identical codecs on each conn of
* the MGW endpoint, but we are aiming for finding a matching
* codec. */
- if (bearer_cap->speech_ver[0] == -1) {
+ if (trans->bearer_cap.speech_ver[0] == -1) {
LOG_TRANS(trans, LOGL_ERROR, "%s: no codec match possible: %s\n",
get_mncc_name(setup->msg_type),
codec_filter_to_str(&trans->cc.codecs, &trans->cc.local, &trans->cc.remote));
@@ -948,7 +948,7 @@
trans->callref = 0;
return -1;
}
- rc = bearer_cap_filter_rev_lev(bearer_cap, trans->vsub->classmark.classmark1.rev_lev);
+ rc = bearer_cap_filter_rev_lev(&trans->bearer_cap, trans->vsub->classmark.classmark1.rev_lev);
if (rc) {
LOG_TRANS(trans, LOGL_ERROR, "No codec offered is supported by phase 1 mobile.\n");
return -1;
@@ -957,14 +957,14 @@
case GSM48_BCAP_ITCAP_3k1_AUDIO:
case GSM48_BCAP_ITCAP_FAX_G3:
case GSM48_BCAP_ITCAP_UNR_DIG_INF:
- *bearer_cap = (struct gsm_mncc_bearer_cap){
+ trans->bearer_cap = (struct gsm_mncc_bearer_cap){
.transfer = trans->bearer_cap.transfer,
.mode = GSM48_BCAP_TMOD_CIRCUIT,
.coding = GSM48_BCAP_CODING_GSM_STD,
.radio = GSM48_BCAP_RRQ_FR_ONLY,
};
- if (csd_bs_list_to_bearer_cap(bearer_cap, &trans->cc.local.bearer_services) == 0) {
+ if (csd_bs_list_to_bearer_cap(&trans->bearer_cap, &trans->cc.local.bearer_services) == 0) {
LOG_TRANS(trans, LOGL_ERROR, "Error composing Bearer Capability for CC Setup\n");
/* incompatible codecs */
@@ -977,10 +977,6 @@
break;
}
- /* Create a copy of the bearer capability in the transaction struct, so
- * we can use this information later */
- trans->bearer_cap = *bearer_cap;
-
return 0;
}
@@ -1030,7 +1026,6 @@
struct msgb *msg;
struct gsm_mncc *setup = arg;
int rc;
- struct gsm_mncc_bearer_cap bearer_cap;
rc = gsm48_cc_tx_setup_set_transaction_id(trans);
if (rc < 0)
@@ -1045,11 +1040,11 @@
if (rc < 0)
goto error;
- rc = gsm48_cc_tx_setup_set_bearer_cap(trans, setup, &bearer_cap);
+ rc = gsm48_cc_tx_setup_set_bearer_cap(trans, setup);
if (rc < 0)
goto error;
- msg = gsm48_cc_tx_setup_encode_msg(setup, &bearer_cap);
+ msg = gsm48_cc_tx_setup_encode_msg(setup, &trans->bearer_cap);
new_cc_state(trans, GSM_CSTATE_CALL_PRESENT);
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/41042?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I247ef10923c2875ca75e73046f4b8ed14190d4d2
Gerrit-Change-Number: 41042
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/41043?usp=email )
Change subject: gsm48_cc_tx_setup: fix speech bearer capabilities
......................................................................
gsm48_cc_tx_setup: fix speech bearer capabilities
Send the bearer capability IE from 3GPP TS 24.008 § D.1.2 for speech
instead of the result from gsm48_cc_tx_setup_set_bearer_cap() for the
network to MS direction. This is needed, because:
- We shall send spares for radio (which happens to be the same as
GSM48_BCAP_RRQ_FR_ONLY in the MS to network direction, see 3GPP TS
24.008 § D.1.1 and Table 10.5.102).
- We could send a speech version list in theory that MS are then
supposed to ignore (end of Table 10.5.103), but this causes bugs in
some MS so it is better to not send it (OS#6656).
Related: OS#6657, OS#6655, OS#6656
Related: osmo-ttcn3-hacks I8fd33cf2f7fb8a1c34851ecf54fccddd2efd0536
Change-Id: I7046e9244fd9d4301ee2c4df1147a619f753739c
---
M src/libmsc/gsm_04_08_cc.c
1 file changed, 20 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/43/41043/1
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 63a9018..198d9d5 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -913,8 +913,7 @@
/* Compose Bearer Capability information that reflects only the codecs (Speech
* Versions) / CSD bearer services remaining after intersecting MS, BSS and
- * remote call leg restrictions. To store in trans for later use, and to
- * include in the outgoing CC Setup message. */
+ * remote call leg restrictions. To store in trans for later use. */
static int gsm48_cc_tx_setup_set_bearer_cap(struct gsm_trans *trans, const struct gsm_mncc *setup)
{
int rc;
@@ -981,14 +980,31 @@
}
static struct msgb *gsm48_cc_tx_setup_encode_msg(const struct gsm_mncc *setup,
- const struct gsm_mncc_bearer_cap *bearer_cap)
+ const struct gsm_mncc_bearer_cap *bearer_cap_orig)
{
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC SETUP");
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
+ struct gsm_mncc_bearer_cap bearer_cap = *bearer_cap_orig;
gh->msg_type = GSM48_MT_CC_SETUP;
- gsm48_encode_bearer_cap(msg, 0, bearer_cap);
+ /* Send the bearer capability IE from 3GPP TS 24.008 § D.1.2 for speech
+ * instead of the result from gsm48_cc_tx_setup_set_bearer_cap() for
+ * the network to MS direction. This is needed, because:
+ * - We shall send spares for radio (which happens to be the same as
+ * GSM48_BCAP_RRQ_FR_ONLY in the MS to network direction, see 3GPP
+ * TS 24.008 § D.1.1 and Table 10.5.102).
+ * - We could send a speech version list in theory that MS are then
+ * supposed to ignore (end of Table 10.5.103), but this causes bugs
+ * in some MS so it is better to not send it (OS#6656). */
+ if (bearer_cap.transfer == GSM48_BCAP_ITCAP_SPEECH)
+ bearer_cap = (struct gsm_mncc_bearer_cap){
+ .transfer = GSM48_BCAP_ITCAP_SPEECH,
+ .radio = GSM48_BCAP_RRQ_FR_ONLY, /* spare */
+ .speech_ver = { -1 },
+ };
+
+ gsm48_encode_bearer_cap(msg, 0, &bearer_cap);
/* Facility */
if (setup->fields & MNCC_F_FACILITY)
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/41043?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I7046e9244fd9d4301ee2c4df1147a619f753739c
Gerrit-Change-Number: 41043
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41032?usp=email )
Change subject: s1ap_proxy_test: do more s1ap_proxy:fetch_erab/2
......................................................................
s1ap_proxy_test: do more s1ap_proxy:fetch_erab/2
Just like we do in test_e_rab_setup[_dup], let's test fetching
E-RAB info by UID in test_initial_context_setup[_dup] for the
sake of completeness and consistency.
Change-Id: I8e9ffc22be3bc352a8d3022b1c7b0c50699ff493
---
M test/s1ap_proxy_test.erl
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/32/41032/1
diff --git a/test/s1ap_proxy_test.erl b/test/s1ap_proxy_test.erl
index 60b09dc..9015934 100644
--- a/test/s1ap_proxy_test.erl
+++ b/test/s1ap_proxy_test.erl
@@ -375,6 +375,7 @@
?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_ALL, 2 + 2),
?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_PROC, 2),
?_assertMetricENB(?S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_UNMODIFIED, 2),
+ ?_assertMatch({ok, _}, s1ap_proxy:fetch_erab(Pid, {1, 5})),
?_assertMatch([_], s1ap_proxy:fetch_erab_list(Pid))].
@@ -388,6 +389,7 @@
?_assertMatch({forward, _}, s1ap_proxy:process_pdu(Pid, InitCtxSetupRspIn)),
%% duplicate INITIAL CONTEXT SETUP REQUEST results in the PDU being dropped
?_assertEqual({drop, InitCtxSetupReqIn}, s1ap_proxy:process_pdu(Pid, InitCtxSetupReqIn)),
+ ?_assertMatch({ok, _}, s1ap_proxy:fetch_erab(Pid, {1, 5})),
?_assertMatch([_], s1ap_proxy:fetch_erab_list(Pid))].
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41032?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I8e9ffc22be3bc352a8d3022b1c7b0c50699ff493
Gerrit-Change-Number: 41032
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41033?usp=email )
Change subject: {gtpu_kpi,pfcp_peer}: do not set trap_exit
......................................................................
{gtpu_kpi,pfcp_peer}: do not set trap_exit
We do not expect nor handle 'EXIT' messages in these modules,
therefore we should not be setting trap_exit.
Change-Id: I966f4a53b8eca6763ca30bae0bbb9e025e6a2c4f
---
M src/gtpu_kpi.erl
M src/pfcp_peer.erl
2 files changed, 0 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/33/41033/1
diff --git a/src/gtpu_kpi.erl b/src/gtpu_kpi.erl
index 5aeb749..9432626 100644
--- a/src/gtpu_kpi.erl
+++ b/src/gtpu_kpi.erl
@@ -146,7 +146,6 @@
%% ------------------------------------------------------------------
init([#{enable := true} = Cfg]) ->
- process_flag(trap_exit, true),
TName = maps:get(table_name, Cfg, "osmo-s1gw"),
Interval = maps:get(interval, Cfg, 3000),
%% flush the table, in case it remained
diff --git a/src/pfcp_peer.erl b/src/pfcp_peer.erl
index a7e9515..efcf0d0 100644
--- a/src/pfcp_peer.erl
+++ b/src/pfcp_peer.erl
@@ -156,7 +156,6 @@
init([LocAddr, RemAddr]);
init([LocAddr, RemAddr]) ->
- process_flag(trap_exit, true),
s1gw_metrics:gauge_set(?S1GW_GAUGE_PFCP_ASSOCIATED, 0),
{ok, Sock} = gen_udp:open(?PFCP_PORT, [binary,
{ip, LocAddr},
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41033?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I966f4a53b8eca6763ca30bae0bbb9e025e6a2c4f
Gerrit-Change-Number: 41033
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>