Harald Welte has submitted this change and it was merged. Change subject: MNCC: Copy bearer_cap from MNCC to gsm_trans ......................................................................
MNCC: Copy bearer_cap from MNCC to gsm_trans When we receive bearer capabilities from MNCC and encode thme into a CC message, we have to also update our "cache" inside 'struct gsm_trans'. Only that way, the BSSMAP ASSIGNMENT code is aware of the actual current/present bearer capabilities such as permitted speech codecs. This will in practise only work if the related CC/MNCC message with berer_cap IE will happen before the MSC performs the BSSMAP ASSIGNMENT procedure. Our logic still needs to change in a way that the CC/MNCC code in gsm_04_08.c detects if trans->bearer_cap != new bearer_cap, and in that case triggers a new follow-up BSSMAP ASSIGNMENT. Change-Id: I6838dc0c8c4c2c6bba385da548c92f3fc91060c1 Closes: OS#2854 --- M src/libmsc/gsm_04_08.c 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 6c95488..a5b967e 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -1883,8 +1883,10 @@ new_cc_state(trans, GSM_CSTATE_MO_CALL_PROC); /* bearer capability */ - if (proceeding->fields & MNCC_F_BEARER_CAP) + if (proceeding->fields & MNCC_F_BEARER_CAP) { gsm48_encode_bearer_cap(msg, 0, &proceeding->bearer_cap); + memcpy(&trans->bearer_cap, &proceeding->bearer_cap, sizeof(trans->bearer_cap)); + } /* facility */ if (proceeding->fields & MNCC_F_FACILITY) gsm48_encode_facility(msg, 0, &proceeding->facility); @@ -2575,6 +2577,7 @@ /* bearer capability */ gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap); + memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap)); new_cc_state(trans, GSM_CSTATE_MO_TERM_MODIFY); @@ -2621,6 +2624,7 @@ /* bearer capability */ gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap); + memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap)); new_cc_state(trans, GSM_CSTATE_ACTIVE); @@ -2673,6 +2677,7 @@ /* bearer capability */ gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap); + memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap)); /* cause */ gsm48_encode_cause(msg, 1, &modify->cause); -- To view, visit https://gerrit.osmocom.org/6381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6838dc0c8c4c2c6bba385da548c92f3fc91060c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus <lyn...@fe80.eu> Gerrit-Reviewer: neels <nhofm...@sysmocom.de>