send DLCX only once

If the mgcp_client_fsm gets terminated in ST_DLCX_RESP, it has already
sent a DLCX to the MGW. So do not send a second one.

I noticed the duplicate DLCX for the same endpoint conn identifier while
running TTCN3 tests and watching the network trace of test teardown.

Change-Id: I35e415f67946b73c74408afe265618cfe4f72b0b
This commit is contained in:
Neels Hofmeyr 2021-05-01 02:32:29 +00:00 committed by laforge
parent fe53edd776
commit 7371663aeb
1 changed files with 4 additions and 2 deletions

View File

@ -521,8 +521,10 @@ static void fsm_cleanup_cb(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause ca
/* Should the FSM be terminated while there are still open connections
* on the MGW, we send an unconditional DLCX to terminate the
* connection. This is not the normal case. The user should always use
* mgcp_conn_delete() to instruct the FSM to perform a graceful exit */
if (strlen(mgcp_ctx->conn_id)) {
* mgcp_conn_delete() to instruct the FSM to perform a graceful exit.
* If in ST_DLCX_RESP, a DLCX was already sent and we did not get a
* response. No point in sending another one. */
if (fi->state != ST_DLCX_RESP && strlen(mgcp_ctx->conn_id)) {
LOGPFSML(fi, LOGL_NOTICE,
"MGW/DLCX: FSM termination with connections still present, sending unconditional DLCX...\n");
msg = make_dlcx_msg(mgcp_ctx);