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="true" tag so that you pass it to your script:<br><br><action application="set" data="record_name=$${base_dir}/recordings/${strftime(foo)}.wav" inline="true"/><br>
<action application="set" data="api_hangup_hook=perl <a href="http://my_script.pl">my_script.pl</a> ${record_name}"/><br><br>-MC<br><br><div class="gmail_quote">On Wed, Oct 20, 2010 at 7:01 AM, Nikolay Kondratyev <span dir="ltr"><<a href="mailto:kond@nstel.ru">kond@nstel.ru</a>></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><action
application="record_session"
data="$${base_dir}/recordings/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/></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'd like to record a
call into database (mysql or postgre). </span></font></div>
<div><font face="Arial" size="2"><span>I hope it'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><action application="record_session"
data="$${base_dir}/recordings/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/></span></span></font></div>
<div><font face="Arial" size="2"><span><action
application="perl" data="<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"
/></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'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><action
application="record_session" data=" |<a href="http://recorder.pl" target="_blank">recorder.pl</a>" />
?</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>