On 15 June 2017 at 09:49, Sven Uszpelkat <USZPELSV@comunycarse.com> wrote:

Hello,

 

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:

 

session:answer()

while(session:ready() == true) do

   test = session:recordFile("/usr/local/freeswitch/recordings/test.wav", 18000, 0, 300)

   session:setAutoHangup(false)

   session:hangup()

end

 

This script will be invoked by the following dialplan:

 

<extension name="Recording">

      <condition field="destination_number" expression=".*">

            <action application="lua" data="record.lua"/>

      </condition>

</extension>

 

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.)

 

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?


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...

https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools:+record_session

Anyway, if you want to use the script, why you first

session:setAutoHangup(false)

and after that you


session:hangup()


?


Also, you made the silence_threshold equal 0 (zero).
Have you has the same problems using a silence_threshold of, let's say, 30 (thirty), like in documentation? ( https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-session:recordFile )

Hope this helps,

-giovanni

 

 

Many thanks in advance.

 

Best regards,

 

Sven Uszpelkat
Departamento I+D
Comunycarse Network Consultants, S.L.

 

 

Descripción: Descripción: http://www.comunycarse.com/email_images/facebook_16.jpg Descripción: Descripción: http://www.comunycarse.com/email_images/linkedin_16.jpg Descripción: Descripción: http://www.comunycarse.com/email_images/twitter_16.jpg Descripción: Descripción: http://www.comunycarse.com/email_images/wordpress_16.jpg

Joaquín Turina, 2
28224 Pozuelo de Alarcón MADRID
Tlf. +34 917 498 700
Fax +34 917 498 720
 

Sabino Arana, 18
08028 BARCELONA
Tlf. +34 934 098 480
Fax +34 934 098 490

http://www.comunycarse.com


AVISO LEGAL
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.

DISCLAIMER
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.

 


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--

Sincerely,

Giovanni Maruzzelli
OpenTelecom.IT

cell: +39 347 266 56 18