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.<br>
-MC<br><br><span style="font-family:courier new,monospace"> <extension name="soxi sound file length"></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> <condition field="destination_number" expression="^(9904)$"></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="answer"/></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> <action application="sleep" data="500"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="set" <br> data="sound_file=${sounds_dir}/music/8000/danza-espanola-op-37-h-142-xii-arabesca.wav"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="set"</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> data="file_length=${system soxi -D ${sound_file} | tr -d '\\n' }"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="log" data="INFO Sound file length is '${file_length}'"/></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> <action application="set" data="file_length=${expr(ceil(${file_length}))}"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="log" data="INFO Sound file length is '${file_length}'"/></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> <action application="say" data="en number pronounced ${file_length}"/></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> <action application="playback" data="time/seconds.wav"/></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> </condition></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> </extension></span><br style="font-family:courier new,monospace"><br><br><div class="gmail_quote">On Mon, Jul 23, 2012 at 9:09 AM, Alexandre Fiori <span dir="ltr"><<a href="mailto:fiorix@gmail.com" target="_blank">fiorix@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>that's the problem, I don't know the length, but playback does :)</div>
<div><br></div><div>thanks anyway</div><br><div><div>On 2012-07-23, at 11:53 AM, Michael Collins <<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>> wrote:</div><br><blockquote type="cite">If you know the length of the file then you could use sched_api to schedule something. For example, if you know that your file is 12 seconds long you could do something like this:<br>
<br>sched_api +9 none uuid_broadcast <uuid> <app>::<args> bleg<br>
<br>Check out both of these on the wiki - there's a lot that these can do.<br>-MC<br><br><a href="http://wiki.freeswitch.org/wiki/Mod_commands#uuid_broadcast" target="_blank">http://wiki.freeswitch.org/wiki/Mod_commands#uuid_broadcast</a><br>
<a href="http://wiki.freeswitch.org/wiki/Mod_commands#sched_api" target="_blank">http://wiki.freeswitch.org/wiki/Mod_commands#sched_api</a><br>
_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br><br>Join Us At ClueCon - Aug 7-9, 2012<br><br>FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><div>
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
<br><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">- af</span></div>
</div>
<br></font></span></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br><br>