aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}