path: root/src/libbsc/handover_logic.c
diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2018-01-19 01:23:35 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-01-19 16:03:15 +0100
commitbe1131df42b3e0a7b4113ecc0c159977ecc8fae7 (patch)
tree69890462bdc195307ff46c07c80d48108f76c7b3 /src/libbsc/handover_logic.c
parent9af36d7844501206e1480eebc4c9a80e875c52b3 (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/libbsc/handover_logic.c')
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c
index a30cd0912..cad014426 100644
--- a/src/libbsc/handover_logic.c
+++ b/src/libbsc/handover_logic.c
@@ -325,7 +325,11 @@ static int ho_rsl_detect(struct gsm_lchan *new_lchan)
return -ENODEV;
- /* FIXME: do we actually want to do something here ? */
+ LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan));
+ /* This is just for logging on the DHO category. The actual MGCP switchover happens in
+ * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal.
+ * (Calling mgcp_handover() directly currently breaks linking in utils/...) */
return 0;