$AGI->record_file doesn't record anything

hi All

I am testing the record function on my asterisk and I have a problem which the record_file doesn’t record anything to the wav/gsm file.

agi file looks like this

[code]#!/usr/bin/perl

use Asterisk::AGI;
my $AGI = new Asterisk::AGI;
%input = $AGI->ReadParse();

$AGI->stream_file(“beep”,’""’);
$AGI->record_file("/tmp/$$",‘gsm’,0,-1);
$AGI->stream_file(“beep”,’""’);

exit;[/code]

When I called extension, asterisk console shows

-- Executing [7000@from-internal:1] AGI("SIP/2003-09ac1590", "sphinx_test.agi") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/sphinx_test.agi -- Playing 'beep' (escape_digits=) (sample_offset 0) -- Playing 'beep' (escape_digits=) (sample_offset 0) -- AGI Script sphinx_test.agi completed, returning 0 -- Executing [7000@from-internal:2] Hangup("SIP/2003-09ac1590", "") in new stack == Spawn extension (from-internal, 7000, 2) exited non-zero on 'SIP/2003-09ac1590' -- Executing [h@from-internal:1] Macro("SIP/2003-09ac1590", "hangupcall") in new stack -- Executing [s@macro-hangupcall:1] ResetCDR("SIP/2003-09ac1590", "w") in new stack -- Executing [s@macro-hangupcall:2] NoCDR("SIP/2003-09ac1590", "") in new stack -- Executing [s@macro-hangupcall:3] GotoIf("SIP/2003-09ac1590", "1?skiprg") in new stack -- Goto (macro-hangupcall,s,6) -- Executing [s@macro-hangupcall:6] GotoIf("SIP/2003-09ac1590", "1?skipblkvm") in new stack -- Goto (macro-hangupcall,s,9) -- Executing [s@macro-hangupcall:9] GotoIf("SIP/2003-09ac1590", "1?theend") in new stack -- Goto (macro-hangupcall,s,11) -- Executing [s@macro-hangupcall:11] Hangup("SIP/2003-09ac1590", "") in new stack == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/2003-09ac1590' in macro 'hangupcall' == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/2003-09ac1590'

The tmp folder output

-rw-r--r-- 1 asterisk asterisk 44 Aug 8 13:30 7327.wav -rw-r--r-- 1 asterisk asterisk 44 Aug 8 13:34 7338.wav -rw-r--r-- 1 asterisk asterisk 44 Aug 8 13:35 7388.wav -rw-r--r-- 1 asterisk asterisk 0 Aug 8 13:36 7414.gsm -rw-r--r-- 1 asterisk asterisk 0 Aug 8 13:43 7699.gsm -rw-r--r-- 1 asterisk asterisk 0 Aug 8 13:49 7722.gsm -rw-r--r-- 1 asterisk asterisk 0 Aug 8 13:56 7835.gsm -rw-r--r-- 1 asterisk asterisk 0 Aug 8 14:36 8268.gsm

Anyone have an idea what’s wrong with this…