Change in osmo-msc[master]: call_leg: remove unused event MSC_EV_CALL_LEG_RTP_RELEASED

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu May 9 14:25:02 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13945


Change subject: call_leg: remove unused event MSC_EV_CALL_LEG_RTP_RELEASED
......................................................................

call_leg: remove unused event MSC_EV_CALL_LEG_RTP_RELEASED

The event is actually never dispatched and useless, because when an RTP stream
releases, the call_leg terminates directly anyway (which wasn't apparent when
starting to design the call_leg FSM yet).

Change-Id: I6b2fc1225c960fa2f7c46adf241520217a07821c
---
M include/osmocom/msc/call_leg.h
M include/osmocom/msc/msc_roles.h
M src/libmsc/call_leg.c
M src/libmsc/msc_a.c
M src/libmsc/msc_i.c
M src/libmsc/msc_t.c
6 files changed, 8 insertions(+), 45 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/45/13945/1

diff --git a/include/osmocom/msc/call_leg.h b/include/osmocom/msc/call_leg.h
index b8126e8..61107ee 100644
--- a/include/osmocom/msc/call_leg.h
+++ b/include/osmocom/msc/call_leg.h
@@ -36,7 +36,6 @@
 
 	uint32_t parent_event_rtp_addr_available;
 	uint32_t parent_event_rtp_complete;
-	uint32_t parent_event_rtp_released;
 
 	/* For internal MNCC, if RTP addresses for endpoints become assigned by the MGW, implicitly notify the other
 	 * call leg's RTP_TO_CN side rtp_stream with rtp_stream_remote_addr_available(). */
@@ -58,15 +57,13 @@
 struct call_leg *call_leg_alloc(struct osmo_fsm_inst *parent_fi,
 				uint32_t parent_event_term,
 				uint32_t parent_event_rtp_addr_available,
-				uint32_t parent_event_rtp_complete,
-				uint32_t parent_event_rtp_released);
+				uint32_t parent_event_rtp_complete);
 
 void call_leg_reparent(struct call_leg *cl,
 		       struct osmo_fsm_inst *parent_fi,
 		       uint32_t parent_event_term,
 		       uint32_t parent_event_rtp_addr_available,
-		       uint32_t parent_event_rtp_complete,
-		       uint32_t parent_event_rtp_released);
+		       uint32_t parent_event_rtp_complete);
 
 int call_leg_local_bridge(struct call_leg *cl1, uint32_t call_id1, struct gsm_trans *trans1,
 			  struct call_leg *cl2, uint32_t call_id2, struct gsm_trans *trans2);
diff --git a/include/osmocom/msc/msc_roles.h b/include/osmocom/msc/msc_roles.h
index a1fab2f..b22bc7b 100644
--- a/include/osmocom/msc/msc_roles.h
+++ b/include/osmocom/msc/msc_roles.h
@@ -148,7 +148,6 @@
 
 	MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE,
 	MSC_EV_CALL_LEG_RTP_COMPLETE,
-	MSC_EV_CALL_LEG_RTP_RELEASED,
 	MSC_EV_CALL_LEG_TERM,
 
 	/* MNCC has told us to RTP_CREATE, but local RTP port has not yet been set up.
diff --git a/src/libmsc/call_leg.c b/src/libmsc/call_leg.c
index cb7e6ea..1b7db2b 100644
--- a/src/libmsc/call_leg.c
+++ b/src/libmsc/call_leg.c
@@ -67,8 +67,7 @@
 struct call_leg *call_leg_alloc(struct osmo_fsm_inst *parent_fi,
 				uint32_t parent_event_term,
 				uint32_t parent_event_rtp_addr_available,
-				uint32_t parent_event_rtp_complete,
-				uint32_t parent_event_rtp_released)
+				uint32_t parent_event_rtp_complete)
 {
 	struct call_leg *cl;
 	struct osmo_fsm_inst *fi = osmo_fsm_inst_alloc_child(&call_leg_fsm, parent_fi, parent_event_term);
@@ -82,7 +81,6 @@
 		.fi = fi,
 		.parent_event_rtp_addr_available = parent_event_rtp_addr_available,
 		.parent_event_rtp_complete = parent_event_rtp_complete,
-		.parent_event_rtp_released = parent_event_rtp_released,
 	};
 
 	return cl;
@@ -92,8 +90,7 @@
 		       struct osmo_fsm_inst *new_parent_fi,
 		       uint32_t parent_event_term,
 		       uint32_t parent_event_rtp_addr_available,
-		       uint32_t parent_event_rtp_complete,
-		       uint32_t parent_event_rtp_released)
+		       uint32_t parent_event_rtp_complete)
 {
 	LOG_CALL_LEG(cl, LOGL_DEBUG, "Reparenting from parent %s to parent %s\n",
 		     cl->fi->proc.parent->name, new_parent_fi->name);
@@ -101,7 +98,6 @@
 	talloc_steal(new_parent_fi, cl->fi);
 	cl->parent_event_rtp_addr_available = parent_event_rtp_addr_available;
 	cl->parent_event_rtp_complete = parent_event_rtp_complete;
-	cl->parent_event_rtp_released = parent_event_rtp_released;
 }
 
 static int call_leg_fsm_timer_cb(struct osmo_fsm_inst *fi)
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 5baed54..77dd43d 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -546,28 +546,15 @@
 
 static void msc_a_cleanup_rtp_streams(struct msc_a *msc_a, uint32_t event, void *data)
 {
-	struct rtp_stream *rtps;
-
 	switch (event) {
-	case MSC_EV_CALL_LEG_RTP_RELEASED:
-		rtps = data;
-		if (msc_a->cc.mncc_forwarding_to_remote_ran
-		    && msc_a->cc.mncc_forwarding_to_remote_ran->rtps == rtps)
-			msc_a->cc.mncc_forwarding_to_remote_ran->rtps = NULL;
-		if (msc_a->ho.new_cell.mncc_forwarding_to_remote_ran
-		    && msc_a->ho.new_cell.mncc_forwarding_to_remote_ran->rtps == rtps)
-			msc_a->ho.new_cell.mncc_forwarding_to_remote_ran->rtps = NULL;
-		return;
 
 	case MSC_EV_CALL_LEG_TERM:
 		msc_a->cc.call_leg = NULL;
 		if (msc_a->cc.mncc_forwarding_to_remote_ran)
 			msc_a->cc.mncc_forwarding_to_remote_ran->rtps = NULL;
 
-		if (msc_a->ho.new_cell.mncc_forwarding_to_remote_ran) {
-			fprintf(stderr, "FOCKEN %p\n", msc_a->ho.new_cell.mncc_forwarding_to_remote_ran->rtps);
+		if (msc_a->ho.new_cell.mncc_forwarding_to_remote_ran)
 			msc_a->ho.new_cell.mncc_forwarding_to_remote_ran->rtps = NULL;
-		}
 		return;
 
 	case MSC_MNCC_EV_CALL_ENDED:
@@ -633,7 +620,6 @@
 		/* Nothing to do. */
 		return;
 
-	case MSC_EV_CALL_LEG_RTP_RELEASED:
 	case MSC_MNCC_EV_CALL_ENDED:
 		/* Cleaned up above */
 		return;
@@ -765,7 +751,6 @@
 		/* Already releasing */
 		return;
 
-	case MSC_EV_CALL_LEG_RTP_RELEASED:
 	case MSC_EV_CALL_LEG_TERM:
 	case MSC_MNCC_EV_CALL_ENDED:
 		/* RTP streams cleaned up above */
@@ -819,7 +804,6 @@
 	OSMO_VALUE_STRING(MSC_REMOTE_EV_RX_GSUP),
 	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE),
 	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_RTP_COMPLETE),
-	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_RTP_RELEASED),
 	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_TERM),
 	OSMO_VALUE_STRING(MSC_MNCC_EV_NEED_LOCAL_RTP),
 	OSMO_VALUE_STRING(MSC_MNCC_EV_CALL_PROCEEDING),
@@ -934,7 +918,6 @@
 			| S(MSC_A_EV_UNUSED)
 			| S(MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE)
 			| S(MSC_EV_CALL_LEG_RTP_COMPLETE)
-			| S(MSC_EV_CALL_LEG_RTP_RELEASED)
 			| S(MSC_EV_CALL_LEG_TERM)
 			| S(MSC_MNCC_EV_CALL_ENDED)
 			| S(MSC_A_EV_HANDOVER_REQUIRED)
@@ -950,7 +933,6 @@
 			| S(MSC_A_EV_FROM_I_PROCESS_ACCESS_SIGNALLING_REQUEST)
 			| S(MSC_A_EV_FROM_I_SEND_END_SIGNAL_REQUEST)
 			| S(MSC_A_EV_UNUSED)
-			| S(MSC_EV_CALL_LEG_RTP_RELEASED)
 			| S(MSC_EV_CALL_LEG_TERM)
 			| S(MSC_MNCC_EV_CALL_ENDED)
 			,
@@ -1590,8 +1572,7 @@
 		cl = msc_a->cc.call_leg = call_leg_alloc(msc_a->c.fi,
 							 MSC_EV_CALL_LEG_TERM,
 							 MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE,
-							 MSC_EV_CALL_LEG_RTP_COMPLETE,
-							 MSC_EV_CALL_LEG_RTP_RELEASED);
+							 MSC_EV_CALL_LEG_RTP_COMPLETE);
 		OSMO_ASSERT(cl);
 
 		/* HACK: We put the connection in loopback mode at the beginnig to
diff --git a/src/libmsc/msc_i.c b/src/libmsc/msc_i.c
index 05df9cb..f7aab0d 100644
--- a/src/libmsc/msc_i.c
+++ b/src/libmsc/msc_i.c
@@ -278,7 +278,6 @@
 	OSMO_VALUE_STRING(MSC_REMOTE_EV_RX_GSUP),
 	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE),
 	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_RTP_COMPLETE),
-	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_RTP_RELEASED),
 	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_TERM),
 	OSMO_VALUE_STRING(MSC_MNCC_EV_NEED_LOCAL_RTP),
 	OSMO_VALUE_STRING(MSC_MNCC_EV_CALL_PROCEEDING),
diff --git a/src/libmsc/msc_t.c b/src/libmsc/msc_t.c
index c6bba47..8eefccc 100644
--- a/src/libmsc/msc_t.c
+++ b/src/libmsc/msc_t.c
@@ -359,8 +359,7 @@
 	msc_t->inter_msc.call_leg = call_leg_alloc(msc_t->c.fi,
 						   MSC_EV_CALL_LEG_TERM,
 						   MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE,
-						   MSC_EV_CALL_LEG_RTP_COMPLETE,
-						   MSC_EV_CALL_LEG_RTP_RELEASED);
+						   MSC_EV_CALL_LEG_RTP_COMPLETE);
 	if (!msc_t->inter_msc.call_leg
 	    || call_leg_ensure_ci(msc_t->inter_msc.call_leg, RTP_TO_RAN, msc_t->inter_msc.callref, NULL, NULL, NULL)
 	    || call_leg_ensure_ci(msc_t->inter_msc.call_leg, RTP_TO_CN, msc_t->inter_msc.callref, NULL, NULL, NULL)) {
@@ -391,7 +390,6 @@
 		msc_t_send_stored_ho_request(msc_t);
 		return;
 
-	case MSC_EV_CALL_LEG_RTP_RELEASED:
 	case MSC_EV_CALL_LEG_TERM:
 		msc_t->inter_msc.call_leg = NULL;
 		msc_t_error("Failed to set up MGW endpoint\n");
@@ -550,7 +548,6 @@
 		msc_t_down_l2_co(msc_t, an_apdu, false);
 		return;
 
-	case MSC_EV_CALL_LEG_RTP_RELEASED:
 	case MSC_EV_CALL_LEG_TERM:
 		msc_t->inter_msc.call_leg = NULL;
 		msc_t_error("Failed to set up MGW endpoint\n");
@@ -609,8 +606,7 @@
 				  msc_i->c.fi,
 				  MSC_EV_CALL_LEG_TERM,
 				  MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE,
-				  MSC_EV_CALL_LEG_RTP_COMPLETE,
-				  MSC_EV_CALL_LEG_RTP_RELEASED);
+				  MSC_EV_CALL_LEG_RTP_COMPLETE);
 
 		/* msc_i_set_ran_conn() properly "steals" the ran_conn from msc_t */
 		msc_i_set_ran_conn(msc_i, msc_t->ran_conn);
@@ -657,7 +653,6 @@
 		msc_t_down_l2_co(msc_t, an_apdu, false);
 		return;
 
-	case MSC_EV_CALL_LEG_RTP_RELEASED:
 	case MSC_EV_CALL_LEG_TERM:
 		msc_t->inter_msc.call_leg = NULL;
 		msc_t_error("Failed to set up MGW endpoint\n");
@@ -795,7 +790,6 @@
 		.action = msc_t_fsm_wait_local_rtp,
 		.in_event_mask = 0
 			| S(MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE)
-			| S(MSC_EV_CALL_LEG_RTP_RELEASED)
 			| S(MSC_EV_CALL_LEG_TERM)
 			| S(MSC_MNCC_EV_CALL_ENDED)
 			| S(MSC_T_EV_CN_CLOSE)
@@ -810,7 +804,6 @@
 		.in_event_mask = 0
 			| S(MSC_EV_FROM_RAN_UP_L2)
 			| S(MSC_EV_FROM_RAN_CONN_RELEASED)
-			| S(MSC_EV_CALL_LEG_RTP_RELEASED)
 			| S(MSC_EV_CALL_LEG_TERM)
 			| S(MSC_MNCC_EV_CALL_ENDED)
 			| S(MSC_T_EV_FROM_A_FORWARD_ACCESS_SIGNALLING_REQUEST)
@@ -827,7 +820,6 @@
 		.in_event_mask = 0
 			| S(MSC_EV_FROM_RAN_UP_L2)
 			| S(MSC_EV_FROM_RAN_CONN_RELEASED)
-			| S(MSC_EV_CALL_LEG_RTP_RELEASED)
 			| S(MSC_EV_CALL_LEG_TERM)
 			| S(MSC_MNCC_EV_CALL_ENDED)
 			| S(MSC_T_EV_FROM_A_FORWARD_ACCESS_SIGNALLING_REQUEST)
@@ -841,7 +833,6 @@
 	OSMO_VALUE_STRING(MSC_REMOTE_EV_RX_GSUP),
 	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE),
 	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_RTP_COMPLETE),
-	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_RTP_RELEASED),
 	OSMO_VALUE_STRING(MSC_EV_CALL_LEG_TERM),
 	OSMO_VALUE_STRING(MSC_MNCC_EV_NEED_LOCAL_RTP),
 	OSMO_VALUE_STRING(MSC_MNCC_EV_CALL_PROCEEDING),

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b2fc1225c960fa2f7c46adf241520217a07821c
Gerrit-Change-Number: 13945
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190509/5713068b/attachment.html>


More information about the gerrit-log mailing list