diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-05-09 17:54:08 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-05-21 18:32:38 +0200 |
commit | a3cdab448121c76a56ef547ffdc61e3f58a93dbc (patch) | |
tree | a5598e4591f10b89110e3be9fc35d373850b3de3 /src/libmsc/msc_a.c | |
parent | 643270f7179d31cc4d8b60733007f488aa9becdc (diff) |
Request Osmux CID and forward it in Assign Req and Assign Compl
Related: OS#2551
Depends: osmo-mgw.git I73b4c62baf39050da81d65553cbea07bc51163de
Change-Id: I5b14e34481e890669c9ee02dba81eba84293cebb
Diffstat (limited to 'src/libmsc/msc_a.c')
-rw-r--r-- | src/libmsc/msc_a.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c index cfba545be..b311df349 100644 --- a/src/libmsc/msc_a.c +++ b/src/libmsc/msc_a.c @@ -527,6 +527,8 @@ static void msc_a_call_leg_ran_local_addr_available(struct msc_a *msc_a) .assignment_command = { .cn_rtp = &msc_a->cc.call_leg->rtp[RTP_TO_RAN]->local, .channel_type = &channel_type, + .osmux_present = msc_a->cc.call_leg->rtp[RTP_TO_RAN]->use_osmux, + .osmux_cid = msc_a->cc.call_leg->rtp[RTP_TO_RAN]->local_osmux_cid, }, }; if (msc_a_ran_down(msc_a, MSC_ROLE_I, &msg)) { @@ -620,8 +622,9 @@ static void msc_a_fsm_communicating(struct osmo_fsm_inst *fi, uint32_t event, vo return; } LOG_MSC_A(msc_a, LOGL_DEBUG, - "MGW endpoint's RTP address available for the CI %s: " OSMO_SOCKADDR_STR_FMT "\n", - rtp_direction_name(rtps->dir), OSMO_SOCKADDR_STR_FMT_ARGS(&rtps->local)); + "MGW endpoint's RTP address available for the CI %s: " OSMO_SOCKADDR_STR_FMT " (osmux=%s:%d)\n", + rtp_direction_name(rtps->dir), OSMO_SOCKADDR_STR_FMT_ARGS(&rtps->local), + rtps->use_osmux ? "yes" : "no", rtps->local_osmux_cid); switch (rtps->dir) { case RTP_TO_RAN: msc_a_call_leg_ran_local_addr_available(msc_a); @@ -1257,9 +1260,20 @@ static void msc_a_up_call_assignment_complete(struct msc_a *msc_a, const struct return; } + if (rtps_to_ran->use_osmux != ac->assignment_complete.osmux_present) { + LOG_MSC_A_CAT(msc_a, DCC, LOGL_ERROR, "Osmux usage ass request and complete don't match: %d vs %d\n", + rtps_to_ran->use_osmux, ac->assignment_complete.osmux_present); + call_leg_release(msc_a->cc.call_leg); + return; + } + /* Update RAN-side endpoint CI: */ rtp_stream_set_codec(rtps_to_ran, ac->assignment_complete.codec); rtp_stream_set_remote_addr(rtps_to_ran, &ac->assignment_complete.remote_rtp); + if (rtps_to_ran->use_osmux) + rtp_stream_set_remote_osmux_cid(rtps_to_ran, + ac->assignment_complete.osmux_cid); + rtp_stream_commit(rtps_to_ran); /* Setup CN side endpoint CI: @@ -1592,6 +1606,8 @@ int msc_tx_common_id(struct msc_a *msc_a, enum msc_role to_role) static int msc_a_start_assignment(struct msc_a *msc_a, struct gsm_trans *cc_trans) { struct call_leg *cl = msc_a->cc.call_leg; + struct msc_i *msc_i = msc_a_msc_i(msc_a); + struct gsm_network *net = msc_a_net(msc_a); OSMO_ASSERT(!msc_a->cc.active_trans); msc_a->cc.active_trans = cc_trans; @@ -1612,6 +1628,16 @@ static int msc_a_start_assignment(struct msc_a *msc_a, struct gsm_trans *cc_tran cl->crcx_conn_mode[RTP_TO_RAN] = MGCP_CONN_LOOPBACK; } + if (net->use_osmux != OSMUX_USAGE_OFF) { + msc_i = msc_a_msc_i(msc_a); + if (msc_i->c.remote_to) { + /* TODO: investigate what to do in this case */ + LOG_MSC_A(msc_a, LOGL_ERROR, "Osmux not yet supported for inter-MSC"); + } else { + cl->ran_peer_supports_osmux = msc_i->ran_conn->ran_peer->remote_supports_osmux; + } + } + /* This will lead to either MSC_EV_CALL_LEG_LOCAL_ADDR_AVAILABLE or MSC_EV_CALL_LEG_TERM. * If the local address is already known, then immediately trigger. */ if (call_leg_local_ip(cl, RTP_TO_RAN)) |