summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-13 09:29:11 +0100
committerHarald Welte <laforge@gnumonks.org>2018-05-29 18:10:31 +0200
commitb422a8031e12c002e6420f1f1e15d6d19ae31a0a (patch)
treeba75b39d97fc623964a9eeb1ba7922a06da02cef
parent237b6c156d2001878be482aaafc24a07f8871b3e (diff)
bsc: Add MGCP-MDCX handling to as_handover()laforge/wip
The MDCX of the BTS-side connection on the MGW is the last step during intra-BSC handover between two BTSs at one BSC. Change-Id: I1daca5b93300a494020081e84fbceaf0a0f364ff
-rw-r--r--bsc/MSC_ConnectionHandler.ttcn28
1 files changed, 28 insertions, 0 deletions
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 76498fe..c4daf65 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -773,6 +773,7 @@ type record HandoverState {
altstep as_handover(inout HandoverState st) runs on MSC_ConnHdlr {
var RSL_Message rsl;
+ var MgcpCommand mgcp_cmd;
[not st.rr_ho_cmpl_seen] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl {
var PDU_ML3_NW_MS l3 := dec_PDU_ML3_NW_MS(rsl.ies[2].body.l3_info.payload);
log("Rx L3 from net: ", l3);
@@ -816,6 +817,33 @@ altstep as_handover(inout HandoverState st) runs on MSC_ConnHdlr {
f_rslem_unregister(0, st.old_chan_nr);
st.handover_done := true;
}
+ /* Final step: We expect a MDCX to switch the media stream from old BTS to new one */
+ [st.rr_ho_cmpl_seen and g_media.bts1.ipa_crcx_seen] MGCP.receive(tr_MDCX) -> value mgcp_cmd {
+ var SDP_Message sdp;
+ var integer cid := f_get_mgcp_conn(f_MgcpCmd_extract_conn_id(mgcp_cmd));
+ /* FIXME: Enforce that the connection_id is the BTS/Abis side, not MSC/Abis side */
+ if (isvalue(mgcp_cmd.sdp)) {
+ sdp := mgcp_cmd.sdp;
+ g_media.mgcp_conn[cid].peer.host := sdp.connection.conn_addr.addr;
+ g_media.mgcp_conn[cid].peer.port_nr := sdp.media_list[0].media_field.ports.port_number;
+ } else {
+ setverdict(fail, "MDCX has no [recognizable] SDP");
+ }
+ var MgcpConnState mgcp_conn := g_media.mgcp_conn[cid];
+ sdp := valueof(ts_SDP(mgcp_conn.peer.host, mgcp_conn.peer.host, "foo", "21",
+ mgcp_conn.peer.port_nr, { int2str(mgcp_conn.rtp_pt) },
+ {valueof(ts_SDP_rtpmap(mgcp_conn.rtp_pt,
+ mgcp_conn.mime_type & "/" &
+ int2str(mgcp_conn.sample_rate))),
+ valueof(ts_SDP_ptime(mgcp_conn.ptime)) } ));
+ MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp));
+ //g_media.mgcp_conn[cid].mdcx_seen := true;
+ /* the new BTS is now the main BTS; switch over to use it by default */
+ g_media.bts := g_media.bts1;
+ g_media.bts1.ipa_crcx_seen := false;
+ /* no 'repeat' here, we want to terminate the alt statement */
+ }
+
}