[asterisk-dev] [Code Review] RTP monitoring branch: initial review

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sun Oct 18 13:46:33 CDT 2009


On Wed, Oct 07, 2009 at 09:12:05PM -0000, Tzafrir Cohen wrote:
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/394/
> -----------------------------------------------------------
> Review request for Asterisk Developers and Tzafrir Cohen.
> Summary
> -------
> I'm working on the RTP monitoring branch:
>   http://svn.digium.com/svn/asterisk/team/tzafrir/monitor-rtp/
>   http://svn.digium.com/svn/asterisk/team/tzafrir/monitor-rtp/doc/monitor-rtp.txt


> The changes involved:


> 2. Allowing ast_writefile to write to a socket


> Writing to a socket
> -------------------
> We hook into a mechnism that writes to files and want to convert it to
> sending packets to a remote server. Writing to a file and writing to a
> socket is basically the same (write(2)). Opening is slightly different.

As of r224438 the interface is cleaner:

ast_writefile is no longer used. ast_writefd has been exposed as a
separate interface function. The temporary
ast_filestream_xxx_get_filename has been renamed to
ast_filestream_get_fd_state() .

The filename field of struct ast_filestream is still (ab)used to save
the state information. Is it possible to add another member to that 
struct (be that a flag) without breaking ABI?

Alternatively, another indicator for the fact that a struct
ast_filestream was created with ast_writefd() rather than with
ast_writefile is that the 'flags' field will have a value of 0, which
makes no sense to a file you want to write to (O_RDONLY). But this is
not such a clean approach, I guess.

               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir

More information about the asterisk-dev mailing list