[asterisk-bugs] [Asterisk 0008921]: EAGI buffer overflow in IPC corrupts sound transfer

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Aug 21 07:47:58 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=8921 
====================================================================== 
Reported By:                devil_slayer
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   8921
Category:                   Resources/res_agi
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.4.0 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        No 
Request Review:              
====================================================================== 
Date Submitted:             01-27-2007 14:48 CST
Last Modified:              08-21-2007 07:47 CDT
====================================================================== 
Summary:                    EAGI buffer overflow in IPC corrupts sound transfer
Description: 
This may be a bug or a feature depending on how you look at it. It would be
nice to fix it in some perceivable future.

The problem is that because of the lack of buffering on part of Asterisk,
the EAGI starts skipping samples if the communication pipe gets full.
Therefore, if the EAGI client doesn't read the data fast enough, it gets
irrecoverably lost.

The solution to this is for the EAGI client program to implement it's own
buffer and read the pipe as fast as possible, possibly in a separate
thread. This can be tricky in some situation and since all the AGI programs
should be small and simple it would be nice if this wasn't necessary.

Luckily, a quick glance at the source code reveals a simple solution. It
should be easy to create a buffer inside Asterisk and allow the client EAGI
programs to read the pipe at their own pace...

The explanation follows in additional information section:
====================================================================== 

---------------------------------------------------------------------- 
 devil_slayer - 08-21-07 07:47  
---------------------------------------------------------------------- 
I made a workaround to the problem I've described here and it seems to be
most reasonable solution at this time. The program I posted above is a
proxy that allows the same functionality of EAGI but on TCP/IP sockets.
It's different from FastAGI in that it also sends the sound from asterisk
through a second socket. It creates 3 threads and has a big enough internal
buffer (1 minute) that no sound is lost if the signal is not read
immediately. Everything else is described in the file.

I'm not sure what to do with the file, but if anyone reads this, they may
find a proper place for it in the project. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-21-07 07:47  devil_slayer   Note Added: 0069152                          
======================================================================




More information about the asterisk-bugs mailing list