[asterisk-dev] Re: [asterisk-commits] file: trunk r54748 - in /trunk: CHANGES apps/app_chanspy.c

Kevin P. Fleming kpfleming at digium.com
Sun Feb 18 08:38:24 MST 2007


asterisk-commits at lists.digium.com wrote:
> Author: file
> Date: Thu Feb 15 19:17:25 2007
> New Revision: 54748
> 
> URL: http://svn.digium.com/view/asterisk?view=rev&rev=54748
> Log:
> Add 'o' option to Chanspy which causes it to only listen to audio coming from the channel, and the 'X' option which allows the user to exit to a valid single digit extension. (issue #8137 reported by mnicholson)

This patch (the 'o' option part) is seriously broken.

First off, when the spy is not in MIXAUDIO mode, a call to
ast_channel_spy_read_frame will return a linked list of two frames, one
from each channel being spied on. This is then passed to ast_write(),
which currently ignores any linked frames. However, this is not
documented behavior, only a side effect, and it could change in the future.

In addition, ast_frfree() is called on this frame, which will result in
the linked frame being leaked since ast_frfree() does not traverse the
list of frames to free them all.

Finally, describing this as 'readonly' mode is very counter-intuitive;
by definition, ChanSpy() is 'read only' unless whisper mode is turned
on. We need to come up with a better description for what this option
does. Since what it does is let you listen _only_ to the channel you
explicitly requested (not the channel it is bridged to or the
application that is talking to it), then maybe 'explicit' or 'requested'
 might be better. Suggestions welcome :-)


More information about the asterisk-dev mailing list