[Freeswitch-users] recording into perl script
Michael Collins
msc at freeswitch.org
Wed Oct 20 12:02:21 PDT 2010
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.
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:
<action application="set"
data="record_name=$${base_dir}/recordings/${strftime(foo)}.wav"
inline="true"/>
<action application="set" data="api_hangup_hook=perl
my_script.pl${record_name}"/>
-MC
On Wed, Oct 20, 2010 at 7:01 AM, Nikolay Kondratyev <kond at nstel.ru> wrote:
> Hi all,
> Currently i can record a call via
> <action application="record_session"
> data="$${base_dir}/recordings/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/>
> But in this way i can only record to a file.
> I have some experience with perl and mysql.
> I'd like to record a call into database (mysql or postgre).
> I hope it's possible via mod_perl... is it?
> If yes, how can i pass voice into perl script?
>
> I guess that i can just do the following
> <action application="record_session"
> data="$${base_dir}/recordings/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/>
> <action application="perl" data="recorder.pl$${base_dir}/recordings/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"
> />
> So that my perl script recorder.pl will get recorded file name as it's
> first argument.
> But when my script starts, will the recording allready be finished?
>
> 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.
> Is there a way to write directly into database?
> Something like <action application="record_session" data=" |recorder.pl"
> /> ?
>
> Thanks in advance,
> Nikolay.
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20101020/219d5752/attachment.html
More information about the FreeSWITCH-users
mailing list