Change in osmo-bsc[master]: lcls: set codec info when performing MGW operation

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Jun 26 17:59:32 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9747 )

Change subject: lcls: set codec info when performing MGW operation
......................................................................

lcls: set codec info when performing MGW operation

While GSCON is setting the codec info when operating on the MGW, LCLS
is not doing that yet. This means that the MDCX messages that are
sent by LCLS do not contain any payload type and also no ptime or
rtpmap fields. This also causes the following TTCN3 tests to fail:

TC_lcls_connect_break
TC_lcls_connect_clear
TC_lcls_gcr_bway_connect
TC_lcls_gcr_bway_dont_connect_csc

- Make mgcp_pick_codec() public as bsc_subscr_pick_codec()
- use bsc_subscr_pick_codec() to set codec info in osmo_bsc_lcls.c

Change-Id: I383d55fa602cda0926dd701ee517a299db578260
Closes: OS#3358
---
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/osmo_bsc_lcls.c
3 files changed, 10 insertions(+), 6 deletions(-)

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



diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
index e8226f4..9e56f6b 100644
--- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h
+++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
@@ -66,6 +66,9 @@
 
 struct gsm_subscriber_connection;
 struct gsm_network;
+struct mgcp_conn_peer;
 
 /* Allocate a subscriber connection and its associated FSM */
 struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net);
+
+void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn);
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 0f3d9d2..66cdbba 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -122,8 +122,7 @@
 
 /* Depending on the channel mode and rate, set the codec type that is signalled
  * towards the MGW. */
-static void mgcp_pick_codec(struct gsm_subscriber_connection *conn,
-			    struct mgcp_conn_peer *conn_peer)
+void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn)
 {
 	switch (conn->user_plane.chan_mode) {
 	case GSM48_CMODE_SPEECH_V1:
@@ -440,7 +439,7 @@
 			/* A voice channel is requested, so we run down the
 			 * mgcp-ass-mgcp state-chain (see FIXME above) */
 			memset(&conn_peer, 0, sizeof(conn_peer));
-			mgcp_pick_codec(conn, &conn_peer);
+			bsc_subscr_pick_codec(&conn_peer, conn);
 			conn_peer.call_id = conn->sccp.conn_id;
 			conn_peer.ptime = 20;
 			osmo_strlcpy(conn_peer.endpoint, get_mgw_ep_name(conn), sizeof(conn_peer.endpoint));
@@ -600,7 +599,7 @@
 
 			/* Prepare parameters with the information we got during the assignment */
 			memset(&conn_peer, 0, sizeof(conn_peer));
-			mgcp_pick_codec(conn, &conn_peer);
+			bsc_subscr_pick_codec(&conn_peer, conn);
 			addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip);
 			osmo_strlcpy(conn_peer.addr, inet_ntoa(addr), sizeof(conn_peer.addr));
 			conn_peer.port = lchan->abis_ip.bound_port;
@@ -667,7 +666,7 @@
 		/* Prepare parameters with the connection information we got
 		 * with the assignment command */
 		memset(&conn_peer, 0, sizeof(conn_peer));
-		mgcp_pick_codec(conn, &conn_peer);
+		bsc_subscr_pick_codec(&conn_peer, conn);
 		conn_peer.call_id = conn->sccp.conn_id;
 		sin = (struct sockaddr_in *)&conn->user_plane.aoip_rtp_addr_remote;
 		conn_peer.port = osmo_ntohs(sin->sin_port);
@@ -792,7 +791,7 @@
 		/* Prepare parameters with the information we got during the
 		 * handover procedure (via IPACC) */
 		memset(&conn_peer, 0, sizeof(conn_peer));
-		mgcp_pick_codec(conn, &conn_peer);
+		bsc_subscr_pick_codec(&conn_peer, conn);
 		addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip);
 		osmo_strlcpy(conn_peer.addr, inet_ntoa(addr), sizeof(conn_peer.addr));
 		conn_peer.port = lchan->abis_ip.bound_port;
diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c
index c2b0760..b197e66 100644
--- a/src/osmo-bsc/osmo_bsc_lcls.c
+++ b/src/osmo-bsc/osmo_bsc_lcls.c
@@ -244,6 +244,7 @@
 	memset(&peer, 0, sizeof(peer));
 	peer.port = htons(sin->sin_port);
 	osmo_strlcpy(peer.addr, inet_ntoa(sin->sin_addr), sizeof(peer.addr));
+	bsc_subscr_pick_codec(&peer, conn);
 	mgcp_conn_modify(conn->user_plane.fi_msc, 0, &peer);
 }
 
@@ -563,6 +564,7 @@
 	memset(&peer, 0, sizeof(peer));
 	peer.port = htons(sin->sin_port);
 	osmo_strlcpy(peer.addr, inet_ntoa(sin->sin_addr), sizeof(peer.addr));
+	bsc_subscr_pick_codec(&peer, conn);
 	mgcp_conn_modify(conn->user_plane.fi_msc, 0, &peer);
 
 }

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I383d55fa602cda0926dd701ee517a299db578260
Gerrit-Change-Number: 9747
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180626/2b417c5c/attachment.htm>


More information about the gerrit-log mailing list