aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2009-09-29 20:52:04 +0200
committerSylvain Munaut <tnt@246tNt.com>2009-09-29 20:53:29 +0200
commitac8c9cc5634e54711121c0a6615654bac28c6de2 (patch)
treebd10f3840d3bdbbf756eabcd9b45035ac03ec582
parentd3e9dc0488a2ac696cdcbe715c5940cb83a1aab3 (diff)
Fix RTCP frame reception
we previously registred the FD for monitoring but never read it, causing 100% CPU ... bad ! Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--chan_openbsc.c18
1 files changed, 17 insertions, 1 deletions
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