From 6c4d2443b478e51741901676c990db8af1ec2ca2 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 6 Jan 2011 13:31:41 +0100 Subject: rtp: Move the RTP Proxy code out of RSL into the BSC/MSC domain Instead of creating the sockets in the RSL code we will do this in the CRCX_ACK, MDCX_ACK, DLCX_IND signal handler of gsm_04_08. Introduce a handover signal so we can repatch the RTP sockets in the gsm_04_08 as well. --- openbsc/src/handover_logic.c | 46 ++++---------------------------------------- 1 file changed, 4 insertions(+), 42 deletions(-) (limited to 'openbsc/src/handover_logic.c') diff --git a/openbsc/src/handover_logic.c b/openbsc/src/handover_logic.c index 8e8b9db10..44a69331c 100644 --- a/openbsc/src/handover_logic.c +++ b/openbsc/src/handover_logic.c @@ -332,7 +332,7 @@ static int ho_rsl_detect(struct gsm_lchan *new_lchan) static int ho_ipac_crcx_ack(struct gsm_lchan *new_lchan) { struct bsc_handover *ho; - struct rtp_socket *old_rs, *new_rs, *other_rs; + struct ho_signal_data sig_ho; ho = bsc_ho_by_new_lchan(new_lchan); if (!ho) { @@ -340,47 +340,9 @@ static int ho_ipac_crcx_ack(struct gsm_lchan *new_lchan) return 0; } - if (ipacc_rtp_direct) { - LOGP(DHO, LOGL_ERROR, "unable to handover in direct RTP mode\n"); - return 0; - } - - /* RTP Proxy mode */ - new_rs = new_lchan->abis_ip.rtp_socket; - old_rs = ho->old_lchan->abis_ip.rtp_socket; - - if (!new_rs) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for new_lchan\n"); - return -EIO; - } - - rsl_ipacc_mdcx_to_rtpsock(new_lchan); - - if (!old_rs) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for old_lchan\n"); - return -EIO; - } - - /* copy rx_action and reference to other sock */ - new_rs->rx_action = old_rs->rx_action; - new_rs->tx_action = old_rs->tx_action; - new_rs->transmit = old_rs->transmit; - - switch (ho->old_lchan->abis_ip.rtp_socket->rx_action) { - case RTP_PROXY: - other_rs = old_rs->proxy.other_sock; - rtp_socket_proxy(new_rs, other_rs); - /* delete reference to other end socket to prevent - * rtp_socket_free() from removing the inverse reference */ - old_rs->proxy.other_sock = NULL; - break; - case RTP_RECV_UPSTREAM: - new_rs->receive = old_rs->receive; - break; - case RTP_NONE: - break; - } - + sig_ho.old_lchan = ho->old_lchan; + sig_ho.new_lchan = new_lchan; + dispatch_signal(SS_HO, S_HANDOVER_ACK, &sig_ho); return 0; } -- cgit v1.2.3