From f95f2733e62ea5e3e08239818ede277af0e0a7ef Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 17 Jan 2012 15:27:33 +0100 Subject: lchan: Close a possible still open RTP Socket In case of a reset (loss of the BTS) close down all remaining RTP Proxy sockets. In case of a lchan_free shout if the rtp proxy is still open. I would prefer if the proxy code sits inside the gsm subscriber connection. --- openbsc/src/libbsc/chan_alloc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index 846a393af..0fd7c4edb 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -309,6 +310,12 @@ void lchan_free(struct gsm_lchan *lchan) osmo_signal_dispatch(SS_LCHAN, S_LCHAN_UNEXPECTED_RELEASE, &sig); } + if (lchan->abis_ip.rtp_socket) { + LOGP(DRLL, LOGL_ERROR, "%s RTP Proxy Socket remained open.\n", + gsm_lchan_name(lchan)); + rtp_socket_free(lchan->abis_ip.rtp_socket); + lchan->abis_ip.rtp_socket = NULL; + } /* stop the timer */ osmo_timer_del(&lchan->T3101); @@ -362,6 +369,11 @@ void lchan_reset(struct gsm_lchan *lchan) lchan->type = GSM_LCHAN_NONE; lchan->state = LCHAN_S_NONE; + + if (lchan->abis_ip.rtp_socket) { + rtp_socket_free(lchan->abis_ip.rtp_socket); + lchan->abis_ip.rtp_socket = NULL; + } } /* release the next allocated SAPI or return 0 */ -- cgit v1.2.3