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.
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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Michael Collins
-
Nikolay Kondratyev