tweak fsm_msc_mgcp FSM and FI name

Instead of

  MGW(MGW_99)

use a name of

  msc-mgcp(MSISDN:2331_GERAN_A:00000017_trans99)

1. The FSM is communication towards an MGW, not the MGW itself. When reading
combined logging (gsmtap_log), it is confusing to read 'MGW' in a log coming
from the MSC. The API is also called msc_mgcp_*.

2. Calling the FSM instance 'MGW_' again doesn't make sense.

3. Indicate 'trans' before the trans_id (trans_id was already shown, but not
indicated what it was).

4. Also indicate the actual subscriber's identification.

5. Also indicate the RAN connection and conn_id.

This comes up while trying to understand a call coming in on an already
established call: parsing the log with a human brain is near torture without
this info, taking extremely long to get grips on.

Change-Id: Ie5fc1ffb7eba0209fee4666a075655cd24d27473
This commit is contained in:
Neels Hofmeyr 2018-12-18 22:05:24 +01:00 committed by Harald Welte
parent b62289aa27
commit a725970d85
1 changed files with 4 additions and 6 deletions

View File

@ -941,7 +941,7 @@ static struct osmo_fsm_state fsm_msc_mgcp_states[] = {
/* State machine definition */
static struct osmo_fsm fsm_msc_mgcp = {
.name = "MGW",
.name = "msc-mgcp",
.states = fsm_msc_mgcp_states,
.num_states = ARRAY_SIZE(fsm_msc_mgcp_states),
.log_subsys = DMGCP,
@ -977,7 +977,6 @@ int msc_mgcp_try_call_assignment(struct gsm_trans *trans)
int msc_mgcp_call_assignment(struct gsm_trans *trans)
{
struct mgcp_ctx *mgcp_ctx;
char name[32];
static bool fsm_registered = false;
struct ran_conn *conn;
struct mgcp_client *mgcp;
@ -1007,9 +1006,6 @@ int msc_mgcp_call_assignment(struct gsm_trans *trans)
conn->iu.rab_id = next_iu_rab_id++;
#endif
if (snprintf(name, sizeof(name), "MGW_%i", trans->transaction_id) >= sizeof(name))
return -EINVAL;
/* Register the fsm description (if not already done) */
if (fsm_registered == false) {
osmo_fsm_register(&fsm_msc_mgcp);
@ -1027,8 +1023,10 @@ int msc_mgcp_call_assignment(struct gsm_trans *trans)
vlr_subscr_name(trans->vsub), osmo_quote_str(mgcp_client_rtpbridge_wildcard(mgcp), -1));
return -EINVAL;
}
mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_msc_mgcp, NULL, NULL, LOGL_DEBUG, name);
mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_msc_mgcp, NULL, NULL, LOGL_DEBUG, NULL);
OSMO_ASSERT(mgcp_ctx->fsm);
osmo_fsm_inst_update_id_f(mgcp_ctx->fsm, "%s_%s_trans%d",
vlr_subscr_name(trans->vsub), ran_conn_get_conn_id(conn), trans->transaction_id);
mgcp_ctx->fsm->priv = mgcp_ctx;
mgcp_ctx->mgcp = mgcp;
mgcp_ctx->trans = trans;