Change in osmo-msc[master]: fix: incoming call during ongoing call

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Jan 4 16:25:02 UTC 2019


Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/12400 )

Change subject: fix: incoming call during ongoing call
......................................................................

fix: incoming call during ongoing call

If a call is already busy and another call is coming in, do not try to
immediately assign an lchan (before this patch, it fails because there already
is an mgcp_ctx for the conn). Leave the second CC transaction waiting.

When a call is hung up, as soon as the old mgcp_ctx is discarded, look for
other CC transactions that are waiting. If there is one, trigger assignment, so
a new mgcp_ctx is set up for the new call.

This fixes the following scenario:

- from A, call B.
- from C, call B; B rings during ongoing call.
- in B, pick up the call, choose to drop the old call.

After this patch, and with osmo-bsc patch with change-id
  I0c00ec2c120e5008281755adcd4944a3ce4d8355
we are now able to talk to the new caller.

I currently haven't tested yet what happens if there is *three* peers trying to
talk to the same number, running out of lab phones (not really, just not
bothering now). Possibly we should be taking over the particular call indicated
by the CC TI; instead, the current patch version takes on whichever waiting
call it finds first. This is fine if *one* additional call comes in on an
ongoing call, and this is already a huge improvement to what we had before.

Related: OS#3735
Change-Id: I0ba216b737909e92080a722db26e3577726c63cb
---
M src/libmsc/msc_mgcp.c
1 file changed, 31 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c
index 8e2e7a9..4c17768 100644
--- a/src/libmsc/msc_mgcp.c
+++ b/src/libmsc/msc_mgcp.c
@@ -962,6 +962,10 @@
 	struct ran_conn *conn = trans->conn;
 	if (trans->cc.assignment_started)
 		return 0;
+	if (conn->rtp.mgcp_ctx) {
+		LOGPFSMSL(conn->fi, DMGCP, LOGL_INFO, "Another call is already ongoing, not assigning yet\n");
+		return 0;
+	}
 	LOGPFSMSL(conn->fi, DMGCP, LOGL_INFO, "Starting call assignment\n");
 	trans->cc.assignment_started = true;
 	return msc_mgcp_call_assignment(trans);
@@ -1152,6 +1156,23 @@
 	return 0;
 }
 
+static struct gsm_trans *find_waiting_call(struct ran_conn *conn)
+{
+	struct gsm_trans *trans;
+	struct gsm_network *net = conn->network;
+
+	llist_for_each_entry(trans, &net->trans_list, entry) {
+		if (trans->conn != conn)
+			continue;
+		if (trans->protocol != GSM48_PDISC_CC)
+			continue;
+		if (trans->cc.assignment_started)
+			continue;
+		return trans;
+	}
+	return NULL;
+}
+
 /* Release ongoing call.
  * Parameter:
  * trans: connection context.
@@ -1160,6 +1181,7 @@
 {
 	struct mgcp_ctx *mgcp_ctx;
 	struct ran_conn *conn = trans->conn;
+	struct gsm_trans *waiting_trans;
 
 	OSMO_ASSERT(trans);
 
@@ -1203,5 +1225,14 @@
 	 * all related context information */
 	conn->rtp.mgcp_ctx = NULL;
 
+	/* If there is another call still waiting to be activated, this is the time when the mgcp_ctx is available again
+	 * and the other call can start assigning. */
+	waiting_trans = find_waiting_call(conn);
+	if (waiting_trans) {
+		LOGP(DMGCP, LOGL_DEBUG, "(ti %02x %s) Call waiting: starting Assignment\n",
+		     waiting_trans->transaction_id, vlr_subscr_name(trans->vsub));
+		msc_mgcp_try_call_assignment(waiting_trans);
+	}
+
 	return 0;
 }

-- 
To view, visit https://gerrit.osmocom.org/12400
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0ba216b737909e92080a722db26e3577726c63cb
Gerrit-Change-Number: 12400
Gerrit-PatchSet: 6
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190104/5de899a5/attachment.htm>


More information about the gerrit-log mailing list