Having a spot of bother with this bit of lua: result = os.execute(string.format([[sox --norm %s %s.new]], file_to_normalise, file_to_normalise)) It's returning -1. I believe freeswitch is running as root and that the sox file is in that location and is runnable. Any ideas?
Can you run a simple Lua script and try something like this: res=os.execute('/usr/bin/sox --version') Just to make absolutely certain that you are able to call sox from within a Lua script. -MC On Tue, Feb 19, 2013 at 8:21 AM, Alex Lake <alex@digitalmail.com> wrote:
Having a spot of bother with this bit of lua:
result = os.execute(string.format([[sox --norm %s %s.new]], file_to_normalise, file_to_normalise))
It's returning -1. I believe freeswitch is running as root and that the sox file is in that location and is runnable.
Any ideas?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
Here an example of how I execute sox from lua, to get the recording length : https://github.com/Star2Billing/newfies-dialer/blob/master/lua/libs/texttosp... You might need something like this : function simple_command(command) -- local file = assert(io.popen(command, 'r')) local output = file:read('*all') file:close() return output end res = simple_command(string.format([[sox --norm %s %s.new]], file_to_normalise, file_to_normalise)) On Tue, Feb 19, 2013 at 5:21 PM, Alex Lake <alex@digitalmail.com> wrote:
Having a spot of bother with this bit of lua:
result = os.execute(string.format([[sox --norm %s %s.new]], file_to_normalise, file_to_normalise))
It's returning -1. I believe freeswitch is running as root and that the sox file is in that location and is runnable.
Any ideas?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
-- Kind regards, /Areski ---- Arezqui Belaid, areski@gmail.com / +34650784355 Founder at Star2Billing (www.star2billing.com) Author @ A2Billing (www.a2billing.net), @ Newfies-Dialer (www.newfies-dialer.org), @ CDR-Stats (www.cdr-stats.org) ---- Twitter : http://twitter.com/areskib / LinkedIN : http://www.linkedin.com/in/areski
Now THAT does run sox - at least it shows the output of sox on the screen... Thanks. Not sure, though, that --norm does quite what I was hoping! Alex
Here an example of how I execute sox from lua, to get the recording length : https://github.com/Star2Billing/newfies-dialer/blob/master/lua/libs/texttosp...
You might need something like this :
function simple_command(command) -- local file = assert(io.popen(command, 'r')) local output = file:read('*all') file:close() return output end
res = simple_command(string.format([[sox --norm %s %s.new]], file_to_normalise, file_to_normalise))
On Tue, Feb 19, 2013 at 5:21 PM, Alex Lake <alex@digitalmail.com> wrote:
Having a spot of bother with this bit of lua:
result = os.execute(string.format([[sox --norm %s %s.new]], file_to_normalise, file_to_normalise))
It's returning -1. I believe freeswitch is running as root and that the sox file is in that location and is runnable.
Any ideas?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
Actually, using os.execute even with totally innocuous commands seems to fail. Maybe io.popen would be more appropriate? Freeswitch-specific documentation/examples for this seem somewhat thin on the ground, though. In particular, dealing with the return value.
Having a spot of bother with this bit of lua:
result = os.execute(string.format([[sox --norm %s %s.new]], file_to_normalise, file_to_normalise))
It's returning -1. I believe freeswitch is running as root and that the sox file is in that location and is runnable.
Any ideas?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
----- No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2238 / Virus Database: 2639/5614 - Release Date: 02/18/13
participants (3)
-
Alex Lake
-
Areski
-
Michael Collins