Definitely record it to a file first and then dump it into your database. I recommend you record the file with the filename as you have it and then use api_hangup_hook to launch the cleanup script that puts the recording into the database.<br>
<br>Note: you probably want to create a chan var with the file name and use the inline=&quot;true&quot; tag so that you pass it to your script:<br><br>&lt;action application=&quot;set&quot; data=&quot;record_name=$${base_dir}/recordings/${strftime(foo)}.wav&quot; inline=&quot;true&quot;/&gt;<br>
&lt;action application=&quot;set&quot; data=&quot;api_hangup_hook=perl <a href="http://my_script.pl">my_script.pl</a> ${record_name}&quot;/&gt;<br><br>-MC<br><br><div class="gmail_quote">On Wed, Oct 20, 2010 at 7:01 AM, Nikolay Kondratyev <span dir="ltr">&lt;<a href="mailto:kond@nstel.ru">kond@nstel.ru</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">



<div>
<div><font face="Arial" size="2"><span>Hi 
all,</span></font></div>
<div><font face="Arial" size="2"><span>Currently i can 
record a call via </span></font></div>
<div><font face="Arial" size="2"><span>&lt;action 
application=&quot;record_session&quot; 
data=&quot;$${base_dir}/recordings/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav&quot;/&gt;</span></font></div>
<div><font face="Arial" size="2"><span>But in this way i 
can only record to a file.</span></font></div>
<div><font face="Arial" size="2"><span>I have some 
experience with perl and mysql.</span></font></div>
<div><font face="Arial" size="2"><span>I&#39;d like to record a 
call into database (mysql or postgre). </span></font></div>
<div><font face="Arial" size="2"><span>I hope it&#39;s possible 
via mod_perl... is it? </span></font></div>
<div><font face="Arial" size="2"><span>If yes, how can i 
pass voice into perl script?</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font face="Arial" size="2"><span>I guess that i can 
just do the following</span></font></div>
<div><font face="Arial" size="2"><span><span>&lt;action application=&quot;record_session&quot; 
data=&quot;$${base_dir}/recordings/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav&quot;/&gt;</span></span></font></div>
<div><font face="Arial" size="2"><span>&lt;action 
application=&quot;perl&quot; data=&quot;<a href="http://recorder.pl" target="_blank">recorder.pl</a> 
$${base_dir}/recordings/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav&quot; 
/&gt;</span></font></div>
<div><font face="Arial" size="2"><span>So that my perl 
script <a href="http://recorder.pl" target="_blank">recorder.pl</a> will get recorded file name as it&#39;s first 
argument.</span></font></div>
<div><font face="Arial" size="2"><span>But when my script 
starts, will the recording allready be finished?</span></font></div>
<div><font face="Arial" size="2"><span></span></font> </div>
<div><font size="2"></font><font face="Arial"><span><font size="2">In this way (if it will work at all) i will first record a call in a 
file, and then put this file into database.</font></span></font></div>
<div><font face="Arial"><span><font size="2">Is there a way 
to write directly into database? </font></span></font></div>
<div><font face="Arial"><span><font size="2">Something like 
<span><span>&lt;action 
application=&quot;record_session&quot; data=&quot; |<a href="http://recorder.pl" target="_blank">recorder.pl</a>&quot; /&gt; 
?</span></span></font></span></font><font face="Arial"><span></span></font></div>
<div><font size="2"><br></font></div>
<div><font face="Arial" size="2"><span>Thanks in 
advance,</span></font></div>
<div><font face="Arial" size="2"><span>Nikolay.</span></font></div></div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>