aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-12-21 01:34:48 +0100
committergsmevent admin <admin@gsmevent.box>2018-12-24 15:45:50 +0100
commit7cd1b89fd3f26d19cfcc190806173bad0bd61981 (patch)
tree252f7172b5ef495a2b9b902bac709c32a4cb9024
parent3332ac44308e54b0f55466757730a93e2294028b (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
-rw-r--r--src/libmsc/msc_mgcp.c16
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;
}