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.
<br><br>Details below:<br><br>--------<br><br>I have an AGI script that does the following:<br><br> $AGI->exec('AGI',"festival.pl|\"Say Message.\"");<br> $AGI->record_file('/tmp/test_audio','wav','#',5*1000);
<br> $AGI->exec('AGI',"festival.pl|\"O k\"");<br> $AGI->stream_file('/tmp/test_audio','#');<br> $AGI->exec('AGI',"festival.pl|\"Done.\"");
<br><br>And it is called like this:<br><br><br>[incoming]<br><br>exten => _XX.,1,Set(__ORIG_EXTEN=${EXTEN})<br>exten => _XX.,n,Goto(RealEstate,s,1)<br><br>[RealEstate]<br><br>exten => s,1,Set(TIMEOUT(digit)=2)<br>
exten => s,n,AGI(/etc/asterisk/agi/rephone.agi,${ORIG_EXTEN})<br>exten => s,n,Hangup()<br><br>---------------<br><br>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.
<br><br>(yes, my phone is working properly meaning i have audio both incoming and outgoing, I thought of that first).<br><br>Now here is the catch -- if I add one line to incoming like this:<br><br>exten => _XX.,1,Set(__ORIG_EXTEN=${EXTEN})
<br>exten => _XX.,n,Background(blue-eyed-polar-bear)<br>exten => _XX.,n,Goto(RealEstate,s,1)<br>
<br><br>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.
<br><br>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?
<br><br>Thanks<br>-John<br><br>