From 13e923c754c66127e0a11b3d18bac93129021654 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Wed, 12 Jun 2013 08:20:36 +0200 Subject: Do not perform assignment, if the new channel equals the current one This can happen, if a TCH/H was requested, but because it is not available, a TCH/F is allocated. If the old channel was TCH/F already, it makes no sense to assign it. --- src/libbsc/bsc_api.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 20a296893..dfe4f94f8 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -221,6 +221,13 @@ static int handle_new_assignment(struct gsm_subscriber_connection *conn, int cha return -1; } + /* check if we are on TCH/F and requested TCH/H, but got TCH/F */ + if (conn->lchan->type == new_lchan->type) { + lchan_free(new_lchan); + LOGP(DMSC, LOGL_NOTICE, "Not assign to equal channel rate.\n"); + return -1; + } + /* copy old data to the new channel */ memcpy(&new_lchan->encr, &conn->lchan->encr, sizeof(new_lchan->encr)); new_lchan->ms_power = conn->lchan->ms_power; -- cgit v1.2.3