Before you go the route of hacking modules be sure to examine the extensive list of dialplan tools and FS cmd line APIs. Personally, I would experiment with the sched_api and uuid_broadcast API&#39;s. You could create a generic dialplan extension and then have the sched_api perform a uuid_broadcast that does an execute_extension on the uuid of the call leg. The (generic) extension you execute can stop the current recording, start up a new recording, and schedule another uuid_broadcast for 30 seconds later.<div>
<br></div><div>It should be a fun exercise! :)</div><div><br></div><div>-MC<br><br><div class="gmail_quote">On Wed, Nov 2, 2011 at 7:56 AM, P. Broennimann <span dir="ltr">&lt;<a href="mailto:peter@enovatiq.com">peter@enovatiq.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font face="&#39;courier new&#39;, monospace">Thx Eliot 4 ur answer</font><div><font face="&#39;courier new&#39;, monospace"><br>
</font></div><div><font face="&#39;courier new&#39;, monospace">Unfortunately post-processing in not an option -&gt; This needs to happen on-the-fly.</font></div>

<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">I am not scared of work and I have time so I will dig deep and try to figure out how to write/modify FreeSwitch C modules...</font></div>


<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">Thanks &amp; cheers,</font></div><div><font face="&#39;courier new&#39;, monospace">P. </font></div><div>
<div></div><div class="h5">

<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace"><br></font>
<br><br><div class="gmail_quote">2011/11/2 Eliot Gable <span dir="ltr">&lt;<a href="mailto:egable%2Bfreeswitch@gmail.com" target="_blank">egable+freeswitch@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Maybe just record the entire call and then split it up afterwards using a wav-file post-processing program. Maybe sox or ffmpeg or something similar might work? Alternatively, you could use the API in FreeSWITCH to start and stop and start and stop the recording every 30 seconds, but that seems like overkill and lots of extra work compared to just using post-processing software. Plus, you&#39;ll miss bits of the recording between when you stop one segment and start the next. Is there some reason you need to be doing this on the fly versus post-processing? Alternatively, you could write a module in C for FreeSWITCH which taps the audio and you could buffer it internally in your module and then save out 30-second segments. This would let you get all of the audio with micro-second precision splits so you wouldn&#39;t loose any audio between segments, but it&#39;s an awful lot of work to go through compared to post-processing.<div>


<div></div><div><br>
<br><div class="gmail_quote">On Tue, Nov 1, 2011 at 6:50 PM, P. Broennimann <span dir="ltr">&lt;<a href="mailto:peter@enovatiq.com" target="_blank">peter@enovatiq.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<font face="&#39;courier new&#39;, monospace">Hi Michael</font><div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">Thx for answering. Sorry next time I&#39;ll post on the other list...</font></div>





<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">Basically I am looking for a solution to split &quot;on-the-fly&quot; recordings on answer. The result for each call should be a consecutive/sequential set of wav files of each X seconds (saved on-the-fly in a specific directory and using a specific filename stucture)... </font></div>





<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><span style="font-family:&#39;courier new&#39;, monospace">I don&#39;t want to reinvent the wheel so that&#39;s why I asked if something similar already exists. Performance is quiet important here (small latency).</span></div>





<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">P.S: I bought the FreeSwitch book and I am making progress learning :)</font></div>

<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">Thx &amp; cheers,</font></div><div><font face="&#39;courier new&#39;, monospace">P.  </font></div><div>



<div></div><div>

<div><font face="&#39;courier new&#39;, monospace"><br></font><br><div class="gmail_quote">2011/11/1 Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;</span><br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Welcome to FreeSWITCH!<div><br></div><div>First off, let me just mention that this question is probably better suited to our -users list. (This is the -dev list which has a smaller audience and is reserved for more intense discussions.) If you don&#39;t get a satisfactory answer here then re-post on freeswitch-users list.</div>






<div><br></div><div>Now, as far as your question goes... you have different options available to you but it really depends on how you are generating your calls. Also, do you want the call to last more than 30 seconds and have only the recording be 30 seconds? Do you want recording to start on early media or on answer? </div>






<div><br></div><div>As an example of how to do a simple 30-second recording here&#39;s one that when you call it, it will start recording, play music for 30 sec, then end the recording and disconnect:</div><div><br></div>






<div><font face="&#39;courier new&#39;, monospace" size="1">&lt;extension name=&quot;record 30 sec of MOH&quot;&gt;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">  &lt;condition field=&quot;destination_number&quot; expression=&quot;^732664$&quot;&gt;</font></div>






<div><font face="&#39;courier new&#39;, monospace" size="1">    &lt;action application=&quot;answer&quot;/&gt;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">    &lt;action application=&quot;record_session&quot; data=&quot;$${recordings_dir}/${uuid}.wav&quot;/&gt;</font></div>






<div><font face="&#39;courier new&#39;, monospace" size="1">    &lt;action application=&quot;sched_hangup&quot; data=&quot;+30&quot;/&gt;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">    &lt;action application=&quot;playback&quot; data=&quot;${hold_music}&quot;/&gt;</font></div>






<div><font face="&#39;courier new&#39;, monospace" size="1">  &lt;/condition&gt;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">&lt;/extension&gt;</font></div>
<div><br></div><div>Dial 732664 (i.e. &quot;REC MOH&quot; :) and just wait. You&#39;ll hear music and then at 30 seconds it will stop recording.</div><div><br></div><div>Happy FreeSWITCHing! </div><div><br></div><div>-MC<br>






<br><div class="gmail_quote"><div><div></div><div>On Tue, Nov 1, 2011 at 1:27 PM, P. Broennimann <span dir="ltr">&lt;<a href="mailto:peter@enovatiq.com" target="_blank">peter@enovatiq.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>
<font face="&#39;courier new&#39;, monospace">Hi there</font>
<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">I am new to FreeSwitch and I have a question...</font></div>

<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">I&#39;d like to record a call/session outputing same length .wav files (all .wav files to be exactly 30 seconds long).</font></div>








<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">I browsed through the FreeSwitch sources from GIT and I found the module &#39;mod_snapshot&#39;. Would this module be the best start/base for the functionality I am looking for resp. are there other modules/scripts that I should better check first?</font></div>








<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">-&gt; I tried to build the module in MSVC Express 2010 but I get errors -&gt; Anyone was </font><span style="font-family:&#39;courier new&#39;, monospace">recently </span><span style="font-family:&#39;courier new&#39;, monospace">successful building it?</span></div>








<div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="&#39;courier new&#39;, monospace">Thx in advance,</font></div><div><font face="&#39;courier new&#39;, monospace">P.</font></div><font color="#888888">

<div><font face="&#39;courier new&#39;, monospace"><br></font></div>
</font><br></div></div>_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><font color="#888888">-- <br>Eliot Gable<br><br>&quot;We do not inherit the Earth from our ancestors: we borrow it from our children.&quot; ~David Brower <br>


<br>&quot;I decided the words were too conservative for me. We&#39;re not borrowing from our children, we&#39;re stealing from them--and it&#39;s not even considered to be a crime.&quot; ~David Brower<br>
<br>&quot;Esse oportet ut vivas, non vivere ut edas.&quot; (Thou shouldst eat to live; not live to eat.) ~Marcus Tullius Cicero<br>
</font><br>_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>