diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-12-21 01:34:48 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2019-01-03 00:34:53 +0000 |
commit | c43b966d32da71aab2e51425256ed00333169314 (patch) | |
tree | 4ed940861a628b53cae41764d2229ac257d64dc6 /src | |
parent | 76ef72dda892b8ec4b64bba2fb700763196540c9 (diff) |
cosmetics in msc_mgcp_call_release()
Use local variables instead of writing trans->conn-> all the time.
Cosmetic preparation for I1f8746e7babfcd3028a4d2c0ba260c608c686c76 and
I0ba216b737909e92080a722db26e3577726c63cb/
Change-Id: I99717b3b72a9d7cbc95455ea25b2018ec1755308
Diffstat (limited to 'src')
-rw-r--r-- | src/libmsc/msc_mgcp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c index 71f36b364..6170c108c 100644 --- a/src/libmsc/msc_mgcp.c +++ b/src/libmsc/msc_mgcp.c @@ -1143,26 +1143,29 @@ int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr) int msc_mgcp_call_release(struct gsm_trans *trans) { struct mgcp_ctx *mgcp_ctx; + struct ran_conn *conn = trans->conn; OSMO_ASSERT(trans); - if (!trans->conn) { + if (!conn) { LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call release failed\n", vlr_subscr_name(trans->vsub)); return -EINVAL; } - if (!trans->conn->rtp.mgcp_ctx) { + mgcp_ctx = conn->rtp.mgcp_ctx; + if (!mgcp_ctx) { LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, call release failed.\n", vlr_subscr_name(trans->vsub)); return -EINVAL; } - if (!trans->conn->rtp.mgcp_ctx->fsm) { + if (!mgcp_ctx->fsm) { LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) no FSM, call release failed\n", vlr_subscr_name(trans->vsub)); return -EINVAL; } - mgcp_ctx = trans->conn->rtp.mgcp_ctx; + LOGP(DMGCP, LOGL_DEBUG, "(ti %02x %s) Call release: tearing down MGW endpoint\n", + trans->transaction_id, vlr_subscr_name(trans->vsub)); /* Inform the FSM that as soon as it reaches ST_HALT it may free * all context information immediately */ @@ -1176,10 +1179,7 @@ int msc_mgcp_call_release(struct gsm_trans *trans) * overwriting the context pointer with NULL. The FSM will now * take care for a graceful shutdown and when done it will free * all related context information */ - trans->conn->rtp.mgcp_ctx = NULL; - - LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call release initiated\n", - vlr_subscr_name(trans->vsub)); + conn->rtp.mgcp_ctx = NULL; return 0; } |