aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/gsm_04_08.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-12 12:30:54 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-12 12:32:48 +0100
commit4804c558ea4f95d58a4dd490da815881c44a7c5e (patch)
treeacfacdc44f3dfb983b2d0d4d59e5e8b6fcf7dbc3 /src/libmsc/gsm_04_08.c
parent329588721f8f6afe5de7bc890bc007e0cecf674d (diff)
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
Diffstat (limited to 'src/libmsc/gsm_04_08.c')
-rw-r--r--src/libmsc/gsm_04_08.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 6c9548867..a5b967e3b 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -1883,8 +1883,10 @@ static int gsm48_cc_tx_call_proc_and_assign(struct gsm_trans *trans, void *arg)
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 @@ static int gsm48_cc_tx_modify(struct gsm_trans *trans, void *arg)
/* 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 @@ static int gsm48_cc_tx_modify_complete(struct gsm_trans *trans, void *arg)
/* 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 @@ static int gsm48_cc_tx_modify_reject(struct gsm_trans *trans, void *arg)
/* 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);