Re: [asterisk-dev] Asterisk Beginner learning about Channels

2014-08-28 Thread Russell Bryant
On Wed, Aug 27, 2014 at 4:32 PM, Maiquel Breitenbach <
maiquel.breitenb...@gmail.com> wrote:

> Hi,
>
> I was already here asking about the building of new channel, I use as
> example chan_alsa, the new channel is work, the write function record a
> voice in file, but i am having problems with function read, asterisk
> doesn't call the read function, can someone explain how the asterisk works
> to call the read function of a channel?
>
> I appreciate very much your help.
>
>
Most channel drivers, including chan_alsa, set a file descriptor on the
channel that will be polled.  When that fd indicates reading is possible,
the read() callback will be called.  Search for ast_channel_set_fd() in
chan_alsa.c, for example.

It's also possible to do reading in your own way in another thread and
queue frames to the channel using ast_queue_frame().  chan_iax2 does this.
 In that case, the read calback isn't used.  chan_iax2 has to do it that
way as all data for *every* call is arriving on the same UDP socket, so it
can't put that one socket fd on every channel.

-- 
Russell Bryant
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[asterisk-dev] Asterisk Beginner learning about Channels

2014-08-27 Thread Maiquel Breitenbach
Hi,

I was already here asking about the building of new channel, I use as
example chan_alsa, the new channel is work, the write function record a
voice in file, but i am having problems with function read, asterisk
doesn't call the read function, can someone explain how the asterisk works
to call the read function of a channel?

I appreciate very much your help.

Best Regards,
Maiquel Breitenbach
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev