abort assignment on Assignment Failure
If Assignment fails in the BSC, trigger an EV_TEARDOWN_ERROR in the mgcp_ctx
FSM instance, so that the call gets torn down immediately. Before this, the
non-call would idle around without anything happening.
Related: OS#3236
Depends: I11b182a03f5ecb6df7cd8f260757d3626c8e945d (libosmocore)
Change-Id: I358cfbaf0f44f25148e8b9bafcb9257b1952b35a
diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c
index 4c17768..5b4ee26 100644
--- a/src/libmsc/msc_mgcp.c
+++ b/src/libmsc/msc_mgcp.c
@@ -1094,6 +1094,25 @@
return 0;
}
+/* Notify the MGCP context that Assignment failed.
+ * This will end the "ringing" on the other call leg, and will usually result in L3 and conn release (i.e. when no other
+ * transactions are still pending, which is usually the case). */
+int msc_mgcp_ass_fail(struct ran_conn *conn)
+{
+ struct mgcp_ctx *mgcp_ctx;
+
+ OSMO_ASSERT(conn);
+
+ mgcp_ctx = conn->rtp.mgcp_ctx;
+ if (!mgcp_ctx)
+ return -EINVAL;
+
+ LOGPFSMSL(conn->fi, DMGCP, LOGL_ERROR, "Assignment failed\n");
+
+ osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN_ERROR, mgcp_ctx);
+ return 0;
+}
+
/* Make the connection of a previously assigned call complete
* Parameter:
* trans: transaction context.