[asterisk-dev] Hi all, is struct ast_frame encoded by any codec?

Russell Bryant russell at digium.com
Thu Sep 9 16:55:19 CDT 2010


On Thu, 2010-09-09 at 15:21 -0500, Tilghman Lesher wrote:
> On Thursday 09 September 2010 04:51:43 John Wu wrote:
> > Is struct ast_frame transfer in asterisk channel just the rtp frame my
> > application send out?
> 
> No, the data portion of the ast_frame may be the rtp frame, though.  There's
> an additional 'offset' element within the frame that points to the audio data
> within whatever structure 'data' points to, and there's additional information
> about the audio codec within ast_frame.  The point of all this is to make
> ast_frame extremely efficient as a method of carting audio around within
> Asterisk.

Even if some RTP headers may be there, no code outside of the RTP system
should assume that or try to touch that part of the buffer.  That would
be evil (and extremely error prone).

The key point here is that ast_frame is a generic structure inside of
Asterisk used to carry signaling and media information.  It has nothing
to do with RTP frames.


-- 
Russell Bryant
Digium, Inc.  |  Engineering Manager, Open Source Software
445 Jan Davis Drive NW   -    Huntsville, AL 35806  -  USA
jabber: rbryant at digium.com    -=-    skype: russell-bryant
www.digium.com -=- www.asterisk.org -=- blogs.asterisk.org







More information about the asterisk-dev mailing list