diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-01-19 01:23:35 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-01-19 16:03:15 +0100 |
commit | be1131df42b3e0a7b4113ecc0c159977ecc8fae7 (patch) | |
tree | 69890462bdc195307ff46c07c80d48108f76c7b3 /src/osmo-bsc/osmo_bsc_audio.c | |
parent | 9af36d7844501206e1480eebc4c9a80e875c52b3 (diff) |
HO: fix recovery from failed handover
Do not instruct the MGW to move the RTP to the new lchan before we have
received a HANDOVER DETECT.
Before:
Chan Activ
Chan Activ Ack
IPACC-CRCX
-ACK
IPACC-MDCX
-ACK
MGCP MDCX --> MGW
...
HANDOVER DETECT
Call continues on new lchan
In above sequence, if the HANDOVER DETECT times out, the MGW has moved to the
new lchan which never becomes used and is released. Furthermore, from the IPACC
MDCX until the HANDOVER DETECT, the RTP stream would break off momentarily.
After:
Chan Activ
Chan Activ Ack
IPACC-CRCX
-ACK
IPACC-MDCX
-ACK
...
HANDOVER DETECT
MGCP MDCX --> MGW
Call continues on new lchan
If the HANDOVER DETECT times out, the call happily continues on the old lchan.
This change is inspired by Ivan Kluchnikov's HO work, who implemented a similar
fix in the openbsc.git codebase (branch fairwaves/master-rebase): his patch
moves ipacc_mdcx() to connect RTP to the new lchan from switch_for_handover()
(which triggered on S_ABISIP_CRCX_ACK, i.e. creation of the new lchan) to later
on in ho_detect() a.k.a. the S_LCHAN_HANDOVER_DETECT signal handler:
http://git.osmocom.org/openbsc/commit/?h=fairwaves/master-rebase&id=9507a7a1ea627e07370c9d264816bb190b3b91b8
This patch does essentially the same: remove the mgcp_handover() call from the
MDCX-ACK handling (creation of the new lchan), and add a signal handler for
S_LCHAN_HANDOVER_DETECT to osmo_bsc_mgcp.c to effect the MGW switchover.
Note, it would have been possible to call mgcp_handover() directly from rx of
the HANDOVER DETECT message, but that produces linking fallout in some utils/
projects, which then need to link the mgcp code as well. That is because those
aren't properly separated from the more complex parts of libbsc. Using the
signal is a bit bloaty, but saves the linking hell for now. I've faced a
similar problem twice recently, it would pay off to separate out the simpler
utils/ and ipaccess/ tools so that they don't need to link all of libbsc and
osmo-bsc, at some point (TM).
Change-Id: Iec58c5fcc5697f1775da7ec0111135108ed1fc8f
Diffstat (limited to 'src/osmo-bsc/osmo_bsc_audio.c')
-rw-r--r-- | src/osmo-bsc/osmo_bsc_audio.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 433dc6c5f..ceec469ca 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -50,11 +50,6 @@ static int handle_abisip_signal(unsigned int subsys, unsigned int signal, switch (signal) { case S_ABISIP_CRCX_ACK: - /* - * TODO: handle handover here... then the audio should go to - * the old mgcp port.. - */ - /* we can ask it to connect now */ LOGP(DMSC, LOGL_DEBUG, "Connecting BTS to port: %d conn: %d\n", con->sccp_con->user_plane.rtp_port, lchan->abis_ip.conn_id); @@ -77,14 +72,11 @@ static int handle_abisip_signal(unsigned int subsys, unsigned int signal, case S_ABISIP_MDCX_ACK: if (con->ho_lchan) { - /* NOTE: When an ho_lchan exists, the MDCX is part of an - * handover operation (intra-bsc). This means we will not - * inform the MSC about the event, which means that no - * assignment complete message is transmitted, we just - * inform the logic that controls the MGW about the new - * connection info */ - LOGP(DMSC, LOGL_INFO,"RTP connection handover initiated...\n"); - mgcp_handover(con->sccp_con->user_plane.mgcp_ctx, con->ho_lchan); + LOGP(DHO, LOGL_DEBUG, "%s -> %s BTS sent MDCX ACK\n", gsm_lchan_name(lchan), + gsm_lchan_name(con->ho_lchan)); + /* No need to do anything for handover here. As soon as a HANDOVER DETECT + * happens, osmo_bsc_mgcp.c will trigger the MGCP MDCX towards MGW by + * receiving an S_LCHAN_HANDOVER_DETECT signal. */ } else if (is_ipaccess_bts(conn_get_bts(con)) && con->sccp_con->user_plane.rtp_ip) { /* NOTE: This is only relevant on AoIP networks with * IPA based base stations. See also osmo_bsc_api.c, |