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/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged. Change subject: libmsc: Add a function to return a unique ID of the subscriber conn ...................................................................... libmsc: Add a function to return a unique ID of the subscriber conn The ID will include the type of connection (GERAN_A, UTRAN_IU) followed by the SCCP conn_id. This can be used for the fsm instance ID before we know the IMSI. Change-Id: I4b875772e3994ad3458ee60dbf880604486d9afd --- M include/osmocom/msc/osmo_msc.h M src/libmsc/subscr_conn.c 2 files changed, 21 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/osmo_msc.h b/include/osmocom/msc/osmo_msc.h index 2b019e1..70e3818 100644 --- a/include/osmocom/msc/osmo_msc.h +++ b/include/osmocom/msc/osmo_msc.h @@ -54,6 +54,7 @@ MSC_CONN_REJECT = 1, }; +char *msc_subscr_conn_get_conn_id(struct gsm_subscriber_connection *conn); int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id); int msc_vlr_alloc(struct gsm_network *net); diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index 124e46b..512f512 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -31,6 +31,7 @@ #include <osmocom/msc/transaction.h> #include <osmocom/msc/signal.h> #include <osmocom/msc/a_iface.h> +#include <osmocom/msc/iucs.h> #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ @@ -303,6 +304,25 @@ .timer_cb = subscr_conn_fsm_timeout, }; +char *msc_subscr_conn_get_conn_id(struct gsm_subscriber_connection *conn) +{ + char *id; + + switch (conn->via_ran) { + case RAN_GERAN_A: + id = talloc_asprintf(conn, "GERAN_A-%08x", conn->a.conn_id); + break; + case RAN_UTRAN_IU: + id = talloc_asprintf(conn, "UTRAN_IU-%08x", iu_get_conn_id(conn->iu.ue_ctx)); + break; + default: + LOGP(DMM, LOGL_ERROR, "RAN of conn %p unknown!\n", conn); + return NULL; + } + + return id; +} + int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id) { struct osmo_fsm_inst *fi; -- To view, visit https://gerrit.osmocom.org/6502 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4b875772e3994ad3458ee60dbf880604486d9afd Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: daniel <dwillmann at sysmocom.de> Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org> Gerrit-Reviewer: Jenkins Builder