From 521e1a41c63847cfb58b5c0704252ba6475e4426 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 31 Mar 2013 11:57:38 +0200 Subject: If requested TCH/H channel is not available, try assigning TCH/F If MNCC application requests a half rate channel, the channel might not be available, due to different cell configuration, so the full rate channel is used. --- openbsc/src/libbsc/abis_rsl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index fbea70f80..de8207687 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1385,6 +1385,12 @@ static int rsl_rx_chan_rqd(struct msgb *msg) /* check availability / allocate channel */ lchan = lchan_alloc(bts, lctype, is_lu); + if (!lchan && (rqd_ref->ra & 0xf0) == 0x30) { + LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x, retrying with %s\n", + msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra, gsm_lchant_name(GSM_LCHAN_TCH_F)); + lctype = GSM_LCHAN_TCH_F; + lchan = lchan_alloc(bts, lctype, is_lu); + } if (!lchan) { LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); @@ -1889,6 +1895,11 @@ int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan) struct rtp_socket *rs = lchan->abis_ip.rtp_socket; int rc; + if (!rs) { + LOGP(DRSL, LOGL_ERROR, "LCHAN has not rtp_socket\n"); + return -EINVAL; + } + rc = rsl_ipacc_mdcx(lchan, ntohl(rs->rtp.sin_local.sin_addr.s_addr), ntohs(rs->rtp.sin_local.sin_port), /* FIXME: use RTP payload of bound socket, not BTS*/ -- cgit v1.2.3