[asterisk-dev] No Read Events in oh323_read() from fdno 2 -- But from fdno 0 Instead
Robin J. Russell
rrussell at live-vu.com
Fri Apr 4 17:57:39 CDT 2008
I am working with chan_h323.c, and trying to add video. I have added quite a
bit of initialization, including opening a couple of extra streams, in
__oh323_update_info() --
if (pvt->update_rtp_info > 0) {
if (pvt->rtp) {
ast_log(LOG_DEBUG, "pvt->update_rtp_info....\n");
ast_jb_configure(c, &global_jbconf);
c->fds[0] = ast_rtp_fd(pvt->rtp);
c->fds[1] = ast_rtcp_fd(pvt->rtp);
if (pvt->vrtp) {
c->fds[2] = ast_rtp_fd(pvt->vrtp);
c->fds[3] = ast_rtcp_fd(pvt->vrtp);
}
ast_queue_frame(pvt->owner, &ast_null_frame); //
Tell Asterisk to apply changes
}
pvt->update_rtp_info = -1;
}
I also do this in __oh323_rtp_create() --
pvt->vrtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, our_addr);
Yet, nothing ever comes in case 2 below.
static struct ast_frame *oh323_read(struct ast_channel *c)
{
struct ast_frame *fr;
struct oh323_pvt *pvt = (struct oh323_pvt *)c->tech_pvt;
ast_mutex_lock(&pvt->lock);
__oh323_update_info(c, pvt);
switch(c->fdno) {
case 0:
fr = oh323_rtp_read(pvt,0);
break;
case 1:
if (pvt->rtp)
fr = ast_rtcp_read(pvt->rtp);
else
fr = &ast_null_frame;
break;
case 2:
ast_log(LOG_ERROR, "Video read\n");
fr = oh323_rtp_read(pvt,1);
break;
case 3:
ast_log(LOG_ERROR, "Video rtcp read\n");
if (pvt->vrtp)
fr = ast_rtcp_read(pvt->vrtp);
else
fr = &ast_null_frame;
break;
default:
ast_log(LOG_ERROR, "Unable to handle fd %d on channel %s\n",
c->fdno, c->name);
fr = &ast_null_frame;
break;
}
ast_mutex_unlock(&pvt->lock);
return fr;
}
I am puzzled that I am getting only events from only fdno==0, but not fdno
== 2. All of my incoming data, both voice and video, and coming from fds[0].
I see that chan_sip does not suffer from this.
Has anybody had a similar problem getting read events from the correct
stream?? Could somebody please let me know what I need to do to do to get
the right data to read from the right stream?
Thanks
R. Russell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080404/caccad8d/attachment.htm
More information about the asterisk-dev
mailing list