2

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.

  • 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 Nov 21 '14 at 17:11
  • 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 Nov 21 '14 at 17:15
  • 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 Nov 21 '14 at 17:18

1 Answers1

0

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

  • You should mark this answer as accepted so the question is "closed off." (You're allowed to do that for your own answers!) – miken32 Nov 21 '14 at 23:09