<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Texto de globo Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.TextodegloboCar
        {mso-style-name:"Texto de globo Car";
        mso-style-priority:99;
        mso-style-link:"Texto de globo";
        font-family:"Tahoma","sans-serif";}
span.EstiloCorreo19
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ES" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">session:answer()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">while(session:ready() == true) do<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">   test = session:recordFile("/usr/local/freeswitch/recordings/test.wav", 18000, 0, 300)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">   session:setAutoHangup(false)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">   session:hangup()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">end<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">This script will be invoked by the following dialplan:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""><extension name="Recording"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">      <condition field="destination_number" expression=".*"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">            <action application="lua" data="record.lua"/><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">      </condition><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""></extension></span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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.)
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Many thanks in advance.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-language:ES">Sven Uszpelkat</span><span lang="IT" style="font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:ES"><br>
</span><span lang="IT" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:teal;mso-fareast-language:ES">Departamento I+D<br>
</span><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:teal;mso-fareast-language:ES">Comunycarse </span><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#222222;mso-fareast-language:ES">Network
 Consultants, S.L.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#222222;mso-fareast-language:ES"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:ES"> <o:p></o:p></span></p>
<p class="MsoNormal"><a href="http://www.facebook.com/pages/Comunycarse/227218309114"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:purple;mso-fareast-language:ES;text-decoration:none"><img border="0" width="16" height="16" id="facebook2" src="cid:image001.jpg@01D2E5B8.A559BAB0" alt="Descripción: Descripción: http://www.comunycarse.com/email_images/facebook_16.jpg"></span></a><span lang="ES-TRAD" style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:ES"> </span><a href="http://www.linkedin.com/company/comunycarse-s.l."><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:purple;mso-fareast-language:ES;text-decoration:none"><img border="0" width="16" height="16" id="linkedin2" src="cid:image002.jpg@01D2E5B8.A559BAB0" alt="Descripción: Descripción: http://www.comunycarse.com/email_images/linkedin_16.jpg"></span></a><span lang="ES-TRAD" style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:ES"> </span><a href="https://twitter.com/#!/comunycarse"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:purple;mso-fareast-language:ES;text-decoration:none"><img border="0" width="16" height="16" id="twitter2" src="cid:image003.jpg@01D2E5B8.A559BAB0" alt="Descripción: Descripción: http://www.comunycarse.com/email_images/twitter_16.jpg"></span></a><span lang="ES-TRAD" style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:ES"> </span><a href="http://www.blog.comunycarse.com/"><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:purple;mso-fareast-language:ES;text-decoration:none"><img border="0" width="16" height="16" id="blog2" src="cid:image004.jpg@01D2E5B8.A559BAB0" alt="Descripción: Descripción: http://www.comunycarse.com/email_images/wordpress_16.jpg"></span></a><span lang="ES-TRAD" style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:ES"><br>
<br>
</span><span lang="ES-TRAD" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:gray;mso-fareast-language:ES">Joaquín Turina, 2</span><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:gray;mso-fareast-language:ES"><br>
28224 Pozuelo de Alarcón MADRID<br>
Tlf. +34 917 498 700<br>
Fax +34 917 498 720</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";mso-fareast-language:ES"> <br>
<br>
</span><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:gray;mso-fareast-language:ES">Sabino Arana, 18<br>
08028 BARCELONA<br>
Tlf. +34 934 098 480<br>
Fax +34 934 098 490<br>
<br>
</span><a href="http://www.comunycarse.com/" title="http://www.comunycarse.com/"><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:gray;mso-fareast-language:ES">http://www.comunycarse.com</span></a><span lang="ES-TRAD" style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:ES"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:silver;mso-fareast-language:ES"><br>
</span><span style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:silver;mso-fareast-language:ES">AVISO LEGAL</span><span style="color:silver;mso-fareast-language:ES"><br>
</span><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:silver;mso-fareast-language:ES">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 lang="EN-GB" style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:silver;mso-fareast-language:ES">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" style="mso-fareast-language:ES"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>