aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2020-11-24 06:06:17 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2020-11-24 06:06:17 +0100
commit36a3753ed04ca16330bf1c4752bcfe71483f6288 (patch)
tree4370b344c7088fe5cbd9eee6ce18e79cf4090089
parent17d225492c8235010a1a866ad0291a1e5163125a (diff)
-rw-r--r--include/osmocom/msc/mncc.h9
-rw-r--r--src/libmsc/gsm_04_08_cc.c9
-rw-r--r--src/libmsc/msc_a.c6
3 files changed, 23 insertions, 1 deletions
diff --git a/include/osmocom/msc/mncc.h b/include/osmocom/msc/mncc.h
index 1c8aff0c9..d68729bc4 100644
--- a/include/osmocom/msc/mncc.h
+++ b/include/osmocom/msc/mncc.h
@@ -161,6 +161,11 @@ struct gsm_mncc {
unsigned char lchan_type;
unsigned char lchan_mode;
+ struct osmo_gcr_parsed gcr;
+ // or maybe as encoded buffer? has to pass the mncc_sock to osmo-sip-connector at some point
+ // uint8_t gcr_enc[15];
+ // uint8_t gcr_enc_len;
+
/* A buffer to contain SDP ('\0' terminated) */
char sdp[1024];
};
@@ -171,7 +176,9 @@ struct gsm_data_frame {
unsigned char data[0];
};
-#define MNCC_SOCK_VERSION 7
+#define MNCC_SOCK_VERSION 8
+// this version bump has to also happen in osmo-sip-connector
+
struct gsm_mncc_hello {
uint32_t msg_type;
uint32_t version;
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index e950f0857..f32d9673d 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -567,6 +567,9 @@ static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg)
//if (lcls_compose(&trans-lcls, trans, true)
// LOG_TRANS(trans, LOGL_ERROR, "LCLS Error\n");
+ /* pass the LCLS GCR on to the MT call leg via MNCC */
+ setup.gcr = trans->lcls->gcr;
+
tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0);
/* emergency setup is identified by msg_type */
if (msg_type == GSM48_MT_CC_EMERG_SETUP) {
@@ -2008,6 +2011,12 @@ static int mncc_tx_to_gsm_cc(struct gsm_network *net, const union mncc_msg *msg)
return -ENOMEM;
}
+ /* Get the GCR from the MO call leg (if any).
+ * First make room for the LCLS info, then insert the MO call leg's GCR. */
+ trans->lcls = lcls_compose(...);
+ trans->lcls->gcr = data->gcr;
+ trans->lcls->gcr_available = true;
+
/* If subscriber has no conn */
if (!msc_a) {
/* This condition will return before the common logging of the received MNCC message below, so
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index ac9a32d94..05c54f0a4 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -604,6 +604,12 @@ static void msc_a_call_leg_ran_local_addr_available(struct msc_a *msc_a)
}
if (cc_trans->lcls) {
+ /* LCLS: for the MO call leg, the LCLS GCR has been created in gsm48_cc_rx_setup() where the DTAP CC
+ * SETUP was received from the MO MS.
+ * For the MT call leg, the LCLS GCR has been received from the MO call leg via MNCC, in
+ * mncc_tx_to_gsm_cc(), where the MNCC SETUP was received from the CN side (PBX/sipcon or via internal
+ * MNCC).
+ */
LOG_MSC_A(msc_a, LOGL_ERROR, "We already have LCLS GCR: %s\n", osmo_gcr_dump(cc_trans->lcls));
} else {