From 5046db98b106a3c583d7fe296e0748f1bde34629 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 29 May 2018 12:02:38 +0200 Subject: mgcp: hack to keep IuUP working Since change If9a81d057f73150e483286472e73c45e7a453a6d removes the RTP loopback at the beginning. This also means that the Hack we do to run the IuUP negotiation via looping back the first few RTP packets will not work anymore. However, we should keep that hack as long as we do not have IuUP support in the MGW. - Start RTP connection in loopback mode for IuUP Change-Id: I4c7d90de4dc87e8baf7cf4a0c69d0e9e8c92e27b --- src/libmsc/msc_mgcp.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c index 67a2142a1..c77e389bb 100644 --- a/src/libmsc/msc_mgcp.c +++ b/src/libmsc/msc_mgcp.c @@ -278,10 +278,22 @@ static void fsm_crcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data struct msgb *msg; int rc; +#ifdef BUILD_IU + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; +#endif + OSMO_ASSERT(mgcp_ctx); mgcp = mgcp_ctx->mgcp; OSMO_ASSERT(mgcp); +#ifdef BUILD_IU + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); +#endif + /* NOTE: In case of error, we will not be able to perform any DLCX * operation because until this point we do not have requested any * endpoint yet. */ @@ -302,6 +314,14 @@ static void fsm_crcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data return; } + /* HACK: We put the connection in loopback mode at the beginnig to + * trick the NodeB into doing the IuUP negotiation with itsself. + * this is a hack we need because osmo-mgw does not support IuUP yet */ +#ifdef BUILD_IU + if (conn->via_ran == RAN_UTRAN_IU) + mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; +#endif + msg = mgcp_msg_gen(mgcp, &mgcp_msg); OSMO_ASSERT(msg); @@ -377,10 +397,22 @@ static void fsm_crcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) struct msgb *msg; int rc; +#ifdef BUILD_IU + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; +#endif + OSMO_ASSERT(mgcp_ctx); mgcp = mgcp_ctx->mgcp; OSMO_ASSERT(mgcp); +#ifdef BUILD_IU + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); +#endif + switch (event) { case EV_CRCX_RAN_RESP: break; @@ -405,6 +437,14 @@ static void fsm_crcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) return; } + /* HACK: We put the connection in loopback mode at the beginnig to + * trick the NodeB into doing the IuUP negotiation with itsself. + * this is a hack we need because osmo-mgw does not support IuUP yet */ +#ifdef BUILD_IU + if (conn->via_ran == RAN_UTRAN_IU) + mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; +#endif + msg = mgcp_msg_gen(mgcp, &mgcp_msg); OSMO_ASSERT(msg); -- cgit v1.2.3