From ac8c9cc5634e54711121c0a6615654bac28c6de2 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 dd40501..66ac56e 100644 --- a/chan_openbsc.c +++ b/chan_openbsc.c @@ -472,7 +472,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