2
votes

I'm trying to convert and move 2 audio files that were recorded earlier in the call using ffmpeg. The code in using is:

#Convert and move the audio
$AGI->exec("system","ffmpeg|/olddir/$FILENAME.flac|/newdir/$FILENAME.wav");
$AGI->exec("system","ffmpeg|/olddir/$FILENAME.flac|/newdir/$FILENAME.wav");

When the AGI runs, this is what appears on the CLI:

    -- AGI Script Executing Application: (system) Options: (ffmpeg|/olddir/stt_P4J3v6.flac|/newdir/stt_P4J3v6.wav)
WARNING[1796]: app_system.c:138 system_exec_helper: Unable to execute 'ffmpeg|/olddir/stt_P4J3v6.flac|/newdir/stt_P4J3v6.wav'

I'm not sure why it will not execute, the same command works fine on the console.

EDIT: retested command WITH the pipes in it and it returned weird errors. However, trying to use

$AGI->exec("system","ffmpeg /olddir/$FILENAME.flac /newdir/$FILENAME.wav");

only returns

-- AGI Script Executing Application: (system) Options: (ffmpeg)

so it's not taking the rest of the arguments.

1
I've never used ffmpeg but I wouldn't expect it to work on the console using that syntax. There's nothing in the man page that indicates you can separate the arguments by the pipe symbol. According to the man page, this is how I'd expect to execute it. $AGI->exec("system", "ffmpeg -i /olddir/$FILENAME.flac /newdir/$FILENAME.wav");Ron Bergin
I tried it without using the pipes like you said there and it doesn't receive any of the arguments after "ffmpeg." I ran it with the pipes and it worked fine on the console.Cody RedCloud
I no longer have access to our asterisk boxes so I can't do any real testing. Sorry I can't help further.Ron Bergin
All good, thanks for trying :)Cody RedCloud

1 Answers

0
votes

I didn't need to use the "Exec" command. I didn't think "system" ran in AGIs. I was wrong.