From 604105c204113b2efcca36245fd59e52dab145ac Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Tue, 29 Sep 2009 20:52:04 +0200 Subject: [PATCH] Fix RTCP frame reception we previously registred the FD for monitoring but never read it, causing 100% CPU ... bad ! Signed-off-by: Sylvain Munaut --- chan_openbsc.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/chan_openbsc.c b/chan_openbsc.c index 0d312b9..d2159dd 100644 --- a/chan_openbsc.c +++ b/chan_openbsc.c @@ -543,7 +543,23 @@ static struct ast_frame * openbsc_chan_read(struct ast_channel *chan) { struct openbsc_chan_priv *p = chan->tech_pvt; - return p->rtp ? ast_rtp_read(p->rtp) : &ast_null_frame; + struct ast_frame *f; + + if (!p->rtp) + return &ast_null_frame; + + switch (chan->fdno) { + case 0: + f = ast_rtp_read(p->rtp); + break; + + case 1: + f = ast_rtcp_read(p->rtp); + break; + + default: + f = &ast_null_frame; + } } static int