Sources from http://phpagi.sourceforge.net/
Signed-off-by: Arbuzov <arbuzov@mcn.ru>