Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] FreeSWITCH call recording missing header information


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
dujinfang at gmail.com
Guest





PostPosted: Wed Dec 16, 2020 8:57 am    Post subject: [Freeswitch-users] FreeSWITCH call recording missing header Reply with quote

maybe listen to the RECORD_STOP event instead of the hangup hook? also inotify on OS worked for me well.



On Mon, Dec 14, 2020 at 8:14 AM Chad Phillips <chad@apartmentlines.com (chad@apartmentlines.com)> wrote:

Quote:
I have a dialplan setup that records a bridged call in FreeSWITCH, which sets the 'api_hangup_hook' variable to call a lua script when the call hangs up, and the called lua script moves the recorded .wav file from it's temporary location to a final destination.

This works, but recently I noticed that some of my .wav recordings have no header information, which results in many players choking when trying to play it.


I eventually figured out that the header information for the .wav file appears to be written *after* the call is hung up, and file move operation in the api_hangup_hook moves the file before the header information has been written. This occurs sporadically.


I've found that introducing a 1 second sleep in my lua script fixes this race condition, but that seems a bit of an ugly hack.


Curious if anybody else has run into this, and/or can offer me a cleaner solution than my sleep hack.


I'm attaching a brief summary of the dialplan and lua script for anyone that wants to see the code.

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com



--
About: http://about.me/dujinfang
Blog: http://www.dujinfang.com
Proj:  http://www.freeswitch.org.cn
Back to top
joel at textplus.com
Guest





PostPosted: Wed Dec 16, 2020 12:18 pm    Post subject: [Freeswitch-users] FreeSWITCH call recording missing header Reply with quote

Another option is to just rely on CDRs, you can have FS post them remotely AND save them to local disk...


1- record
2- end call
3- when local cdr is generated parse it (json/xml)
4- search for the var that has the recording location
5- do stuff....




Cheers,
Joel. 



On Wed, Dec 16, 2020 at 05:24 Seven Du <dujinfang@gmail.com (dujinfang@gmail.com)> wrote:

Quote:
maybe listen to the RECORD_STOP event instead of the hangup hook? also inotify on OS worked for me well.



On Mon, Dec 14, 2020 at 8:14 AM Chad Phillips <chad@apartmentlines.com (chad@apartmentlines.com)> wrote:

Quote:
I have a dialplan setup that records a bridged call in FreeSWITCH, which sets the 'api_hangup_hook' variable to call a lua script when the call hangs up, and the called lua script moves the recorded .wav file from it's temporary location to a final destination.

This works, but recently I noticed that some of my .wav recordings have no header information, which results in many players choking when trying to play it.


I eventually figured out that the header information for the .wav file appears to be written *after* the call is hung up, and file move operation in the api_hangup_hook moves the file before the header information has been written. This occurs sporadically.


I've found that introducing a 1 second sleep in my lua script fixes this race condition, but that seems a bit of an ugly hack.


Curious if anybody else has run into this, and/or can offer me a cleaner solution than my sleep hack.


I'm attaching a brief summary of the dialplan and lua script for anyone that wants to see the code.

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com



--
About: http://about.me/dujinfang
Blog: http://www.dujinfang.com
Proj:  http://www.freeswitch.org.cn
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services