[asterisk-dev] Avoid audio loss in ChanSpy (ref: ASTERISK-25866)

Joshua Colp jcolp at digium.com
Fri Apr 1 07:00:58 CDT 2016

Jean Aunis wrote:
> Hello,
> As described in the issue ASTERISK-25866
> <https://issues.asterisk.org/jira/browse/ASTERISK-25866>, it appears
> that ChanSpy is randomly loosing audio frames, because it sets the flags
> the audiohook: these option cause the audiohook's queue to be flushed of
> "old" frames at very short intervals.
> I have submitted a patch on gerrit which does two things :
> 1- do not set the flag AST_AUDIOHOOK_TRIGGER_SYNC if ChanSpy has been
> called with the option "o": in this case we only listen to the audio
> coming from this channel so this flag is useless
> 2- create a new option "l" which prevents the flag
> AST_AUDIOHOOK_SMALL_QUEUE from being set. I find it better than just
> removing the flag in all cases, because this may introduce some delay in
> the audio, which may not be acceptable for many ChanSpy users.
> What do you think of the idea ?

I think this is fine, provided there is still some high ceiling value. 
Allowing a queue to potentially grow out of control would be bad.

I think if we were able to switch things to using a timer instead we 
could actually get rid of this synchronization. It exists because it has 
to bring together two directions and then provide the media.

I also don't see your review on gerrit. Java (yay Java!) ran out of 
memory somewhat overnight it seems and I've restarted gerrit this 
morning. That may have caused the review to not actually get submitted. 
If you do so again it should work fine and if not we can help figure out 


Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

More information about the asterisk-dev mailing list