<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 15 June 2017 at 09:49, Sven Uszpelkat <span dir="ltr"><<a href="mailto:USZPELSV@comunycarse.com" target="_blank">USZPELSV@comunycarse.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="ES">
<div class="gmail-m_8740048494714013671WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">We are using FreeSWITCH as a third-party recording application, i.e. we are receiving SIP calls with the complete audio of conversations taking place on another switch and we are saving this audio to a file. To achieve
 this we are using a simple script similar to this:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">session:answer()<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">while(session:ready() == true) do<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">   test = session:recordFile("/usr/<wbr>local/freeswitch/recordings/<wbr>test.wav", 18000, 0, 300)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">   session:setAutoHangup(false)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">   session:hangup()<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">end<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">This script will be invoked by the following dialplan:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US"><extension name="Recording"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">      <condition field="destination_number" expression=".*"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">            <action application="lua" data="record.lua"/><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">      </condition><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US"></extension></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Basically it seems to work quite well, but sometimes there are missing audio at the end of the recorded file.  Usually it’s only a few seconds, but sometimes it seems to be more. (It’s like the recording sometimes goes
 behind the real call and when the hangup event is received the remaining audio is discarded.)
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">What could be the reason for this behavior? Is there something wrong with the script or is there a better way to achieve our goal?</span></p></div></div></blockquote><div><br></div><div>One first question come to my mind: why do you use a script here? A simple extension can do exactly the same, if you just want to record the session...<br><br><a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools:+record_session">https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools:+record_session</a><br><br></div><div>Anyway, if you want to use the script, why you first <br><br><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">session:setAutoHangup(false)<span class="gmail-"><br><br></span></span></div><div><span style="font-family:arial,helvetica,sans-serif"><span style="font-size:10pt" lang="EN-US"><span class="gmail-">and after that you</span></span></span><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US"><br></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US">session:hangup()</span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US"><br></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"" lang="EN-US"><span style="font-family:arial,helvetica,sans-serif">?</span><br></span></p></div><div><br></div><div>Also, you made the silence_threshold equal 0 (zero). <br>Have you has the same problems using a silence_threshold of, let's say, 30 (thirty), like in documentation? ( <a href="https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-session:recordFile">https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-session:recordFile</a> )<br></div><div><br></div><div>Hope this helps,<br><br></div><div>-giovanni<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ES"><div class="gmail-m_8740048494714013671WordSection1"><p class="MsoNormal"><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Many thanks in advance.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Verdana","sans-serif"" lang="IT">Sven Uszpelkat</span><span style="font-size:12pt;font-family:"Times New Roman","serif"" lang="IT"><br>
</span><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:teal" lang="IT">Departamento I+D<br>
</span><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:teal" lang="EN-US">Comunycarse </span><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:rgb(34,34,34)" lang="EN-US">Network
 Consultants, S.L.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:rgb(34,34,34)" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:black" lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><a href="http://www.facebook.com/pages/Comunycarse/227218309114" target="_blank"><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:purple;text-decoration:none"><img id="gmail-m_8740048494714013671facebook2" src="cid:image001.jpg@01D2E5B8.A559BAB0" alt="Descripción: Descripción: http://www.comunycarse.com/email_images/facebook_16.jpg" width="16" height="16" border="0"></span></a><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:black" lang="ES-TRAD"> </span><a href="http://www.linkedin.com/company/comunycarse-s.l." target="_blank"><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:purple;text-decoration:none"><img id="gmail-m_8740048494714013671linkedin2" src="cid:image002.jpg@01D2E5B8.A559BAB0" alt="Descripción: Descripción: http://www.comunycarse.com/email_images/linkedin_16.jpg" width="16" height="16" border="0"></span></a><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:black" lang="ES-TRAD"> </span><a href="https://twitter.com/#%21/comunycarse" target="_blank"><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:purple;text-decoration:none"><img id="gmail-m_8740048494714013671twitter2" src="cid:image003.jpg@01D2E5B8.A559BAB0" alt="Descripción: Descripción: http://www.comunycarse.com/email_images/twitter_16.jpg" width="16" height="16" border="0"></span></a><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:black" lang="ES-TRAD"> </span><a href="http://www.blog.comunycarse.com/" target="_blank"><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:purple;text-decoration:none"><img id="gmail-m_8740048494714013671blog2" src="cid:image004.jpg@01D2E5B8.A559BAB0" alt="Descripción: Descripción: http://www.comunycarse.com/email_images/wordpress_16.jpg" width="16" height="16" border="0"></span></a><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:black" lang="ES-TRAD"><br>
<br>
</span><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:gray" lang="ES-TRAD">Joaquín Turina, 2</span><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:gray"><br>
28224 Pozuelo de Alarcón MADRID<br>
Tlf. <a href="tel:+34%20917%2049%2087%2000" value="+34917498700" target="_blank">+34 917 498 700</a><br>
Fax <a href="tel:+34%20917%2049%2087%2020" value="+34917498720" target="_blank">+34 917 498 720</a></span><span style="font-size:10pt;font-family:"Arial","sans-serif""> <br>
<br>
</span><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:gray">Sabino Arana, 18<br>
08028 BARCELONA<br>
Tlf. <a href="tel:+34%20934%2009%2084%2080" value="+34934098480" target="_blank">+34 934 098 480</a><br>
Fax <a href="tel:+34%20934%2009%2084%2090" value="+34934098490" target="_blank">+34 934 098 490</a><br>
<br>
</span><a href="http://www.comunycarse.com/" title="http://www.comunycarse.com/" target="_blank"><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:gray">http://www.comunycarse.com</span></a><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:black" lang="ES-TRAD"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:silver"><br>
</span><span style="font-size:9pt;font-family:"Verdana","sans-serif";color:silver">AVISO LEGAL</span><span style="color:silver"><br>
</span><span style="font-size:7pt;font-family:"Verdana","sans-serif";color:silver">La presente comunicación y sus anexos tiene como destinatario la persona a la que va dirigida, por lo que si usted lo recibe por error debe notificarlo
 al remitente y eliminarlo de su sistema, no pudiendo utilizarlo, total o parcialmente, para ningún fin. Su contenido puede tener información confidencial o protegida legalmente y únicamente expresa la opinión del remitente. El uso del correo electrónico vía
 internet no permite asegurar ni la confidencialidad de los mensajes ni su correcta recepción. En el caso de que el destinatario no consintiera la utilización del correo electrónico deberá ponerlo en nuestro conocimiento inmediatamente.<br>
<br>
</span><span style="font-size:7pt;font-family:"Verdana","sans-serif";color:silver" lang="EN-GB">DISCLAIMER<br>
This message and its attachments are intended exclusively for the named addressee. If you receive this message by mistake, please delete it immediately from your system and notify the sender. You may not use this message or any part of it for any purpose. The
 message may contain information that is confidential or protected by law, and any opinions expressed are those of the individual sender. Internet email guarantees neither the confidentiality nor the proper receipt of the message sent. If the addressee of this
 message does not consent to the use of internet e-mail, please inform us immediately.</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
</div>

<br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span><span><br>Sincerely,<br></span><span><font color="#888888"><br>
Giovanni Maruzzelli<br>
OpenTelecom.IT</font></span><br><span>cell: +39 347 266 56 18<span><font color="#888888"><br></font></span></span></span></div></div></div>
</div></div>