summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-01-17 15:27:33 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-01-17 15:30:24 +0100
commitf95f2733e62ea5e3e08239818ede277af0e0a7ef (patch)
tree45e162f1ebc6ba145c47a20ca15af85ed7ae0f1f
parent1d7f7c8ca846945b53d914f46aab3f1c1f3d5070 (diff)
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.
-rw-r--r--openbsc/src/libbsc/chan_alloc.c12
1 files changed, 12 insertions, 0 deletions
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 <openbsc/abis_nm.h>
#include <openbsc/abis_rsl.h>
#include <openbsc/debug.h>
+#include <openbsc/rtp_proxy.h>
#include <openbsc/signal.h>
#include <osmocom/core/talloc.h>
@@ -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 */