Asterisk AGI AddOns

As proposed on dev list, in this message, I've coded 3 commands: You can get .c file here. You shuld load resulting module after res_agi.so
Here is a php test agi.

PUT SOUNDFILE

Put sound file named <soundfile> of size <size> to path_to_sounds/context/<soundfile>
Returns:
200 result=0 (Wait for data) if agi can send base64 72 characters per line data
200 result=-11 (Cound not create directory) file=<soundfile> context=<ChannelContext> otherwise
200 result=-10 (Cound not create file) file=<soundfile> context=<ChannelContext> if we can't create file
After user has sent data, returns:
200 result=0 if all is OK
else returns:
200 result=-9 (Not enough data) is there's not enough data
200 result=-8 (Bad line) is line is has not 72 characters + newline (except for last line)
200 result=-7 (Too much data) is agi send too much data
200 result=-6 (Problem writing to file) if we can't write more data (disk full,..)

GET SOUNDFILE <soundfile>

Get sound file named <soundfile>i from path_to_sounds/context/<soundfile>
Returns:
200 result=-1 (File doesn't exist) file=<soundfile> context=<ChannelContext> if we can't get file size
200 result=-2 (Could not read file) file=<soundfile> context=<ChannelContext> if we can't read the file
200 result=0 (no data following) size=0 if the file is empty
200 result=0 (data following) size=<FileSize> if it's OK. Base64 72 characters per line will be sent after
If something goes wrong sending data, it will return
200 result=-3 (Coud not read enough data)

ISEXISTING SOUNDFILE <soundfile>

if sound file exists at path path_to_sounds/context/<soundfile>
returns: 200 result=0 (File exists) size=<FileSize>
else returns: 200 result=-1 (File doesn't exist) file=<soundfile> context=<ChannelContext>


Manuel Guesdon / Oxymium. email: mguesdon <at> oxymium <dot> net