aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-06-26 18:21:30 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2018-06-26 18:34:24 +0200
commit116e05e91d83ffee2ed714975f4942f5e3e918c5 (patch)
tree33099808e3cb64d47d66a108ce68f60d0cf0e1c2
parent9eea6a9d0584c3f0a7f12fd7af55308e6546f07b (diff)
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
-rw-r--r--include/osmocom/bsc/bsc_subscr_conn_fsm.h3
-rw-r--r--src/osmo-bsc/bsc_subscr_conn_fsm.c11
-rw-r--r--src/osmo-bsc/osmo_bsc_lcls.c2
3 files changed, 10 insertions, 6 deletions
diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
index e8226f443..9e56f6b47 100644
--- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h
+++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
@@ -66,6 +66,9 @@ enum gscon_fsm_event {
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 0f3d9d20a..66cdbbafc 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -122,8 +122,7 @@ static const struct value_string gscon_fsm_event_names[] = {
/* 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 @@ static void gscon_fsm_active(struct osmo_fsm_inst *fi, uint32_t event, void *dat
/* 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 @@ static void gscon_fsm_wait_ass_cmpl(struct osmo_fsm_inst *fi, uint32_t event, vo
/* 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 @@ static void gscon_fsm_wait_mdcx_bts(struct osmo_fsm_inst *fi, uint32_t event, vo
/* 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 @@ static void gscon_fsm_wait_ho_compl(struct osmo_fsm_inst *fi, uint32_t event, vo
/* 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 c2b076090..b197e6607 100644
--- a/src/osmo-bsc/osmo_bsc_lcls.c
+++ b/src/osmo-bsc/osmo_bsc_lcls.c
@@ -244,6 +244,7 @@ static void lcls_break_local_switching(struct gsm_subscriber_connection *conn)
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 @@ static void lcls_locally_switched_onenter(struct osmo_fsm_inst *fi, uint32_t pre
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);
}