[asterisk-users] AGI "record_file" issue... bug?

John (versimedia) john at versimedia.com
Wed May 16 15:19:13 MST 2007


I am having a problem with "record_file" working properly depending on when
it is called -- basically if it is called immediately upon a call, it acts
like it does not hear anything from the callers phone (yes, my phone is
setup properly and functions fine otherwise)... if I do a "background" or
"festival" command before calling it, it works fine.

Details below:

--------

I have an AGI script that does the following:

        $AGI->exec('AGI',"festival.pl|\"Say Message.\"");
        $AGI->record_file('/tmp/test_audio','wav','#',5*1000);
        $AGI->exec('AGI',"festival.pl|\"O k\"");
        $AGI->stream_file('/tmp/test_audio','#');
        $AGI->exec('AGI',"festival.pl|\"Done.\"");

And it is called like this:


[incoming]

exten => _XX.,1,Set(__ORIG_EXTEN=${EXTEN})
exten => _XX.,n,Goto(RealEstate,s,1)

[RealEstate]

exten => s,1,Set(TIMEOUT(digit)=2)
exten => s,n,AGI(/etc/asterisk/agi/rephone.agi,${ORIG_EXTEN})
exten => s,n,Hangup()

---------------

Then it works, to the extent that I hear the festival messages, and it waits
5 seconds during the recording time, and plays back 5 seconds of "dead
air".  It does not care if i type the # sign or not... and will not record
any audio.

(yes, my phone is working properly meaning i have audio both incoming and
outgoing, I thought of that first).

Now here is the catch -- if I add one line to incoming like this:

exten => _XX.,1,Set(__ORIG_EXTEN=${EXTEN})
exten => _XX.,n,Background(blue-eyed-polar-bear)
exten => _XX.,n,Goto(RealEstate,s,1)


Then it works fine -- also if I change that Background line to a "festival"
command, it works fine... I tried "SayAlpha" and it does not help.   Also,
if I make it so I have to press an extension number to activate the
RealEstate section it does work.

The above situation happens 100% of the time.... I am wondering if A) I am
not doing some kind of initialization or "Answer" command on the incoming
call, or B) there is some kind of bug where a communication channel is not
getting opened to the AGI or to record_file?

Thanks
-John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070516/d8262c06/attachment.htm


More information about the asterisk-users mailing list