[Freeswitch-users] dialplan commands on playback

Michael Collins msc at freeswitch.org
Tue Jul 24 03:11:05 MSD 2012


Excellent! Do you mind finding a spot up on the wiki for this?
-MC

On Mon, Jul 23, 2012 at 4:01 PM, Alexandre Fiori <fiorix at gmail.com> wrote:

>
> Amazing. This is exactly what I was looking for, and couldn't figure out
> how to do.
> Thank you!
>
>
> On 2012-07-23, at 6:55 PM, Michael Collins <msc at freeswitch.org> wrote:
>
> Well, if you have soxi installed (Linux, of course) then you could always
> use a system call to grab the file length. For kicks I whipped up a proof
> of concept dial plan to demonstrate how it could work. If anyone finds it
> useful please let me know and I'll wikify it.
> -MC
>
>   <extension name="soxi sound file length">
>     <condition field="destination_number" expression="^(9904)$">
>       <action application="answer"/>
>       <action application="sleep" data="500"/>
>       <action application="set"
>
> data="sound_file=${sounds_dir}/music/8000/danza-espanola-op-37-h-142-xii-arabesca.wav"/>
>       <action application="set"
>               data="file_length=${system soxi -D ${sound_file} | tr -d
> '\\n' }"/>
>       <action application="log" data="INFO Sound file length is
> '${file_length}'"/>
>       <action application="set"
> data="file_length=${expr(ceil(${file_length}))}"/>
>       <action application="log" data="INFO Sound file length is
> '${file_length}'"/>
>       <action application="say" data="en number pronounced
> ${file_length}"/>
>       <action application="playback" data="time/seconds.wav"/>
>     </condition>
>   </extension>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120723/dec7e116/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list