[Freeswitch-users] mod_format_cdr and mod_json_cdr are writing too much data

Michael Giagnocavo mgg at giagnocavo.net
Mon Jan 18 19:19:23 MSK 2016


CSV CDRs allow you to set the format. So you could setup a template that emits JSON, but only containing the fields you need.

Before doing this, you should really have done performance profiling to make sure this is actually a bottleneck. Unless you’re already CPU or IO bound, it’s probably not worth the hassle. Yes, it does take a noticeable amount of resources to handle the big CDR files, but a: as Ken says it’s handy for debugging and b: hopefully you’re making enough profit margin that it doesn’t matter – just add another box.

As far as pushing CDRs to a remote server, you probably don’t want to do this inside FS. This is because if the send fails (networking, remote server reboot, etc.) you may still want the CDR. The default behaviour of writing to disk if the send fails means you need a backup codepath that reads off disk and processes CDRs. This codepath won’t be as well tested or used, making it more likely to fail when you least want it to (i.e. when normal CDR sending is failing). Might as well write to disk in every case, then use a message queue to move the CDRs off. If you mainly want to reduce network IO, then pre-process the CDRs before enqueueing them.

-Michael

From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Jurijs Ivolga
Sent: Monday, 18 January, 2016 8:49
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
Subject: Re: [Freeswitch-users] mod_format_cdr and mod_json_cdr are writing too much data

Hi,
I appreciate a lot your help, but it will be much more helpful if you can just point where too look or maybe you can send more detailed instructions?
I need to decrease json CDRs, so I'm little bit lost, why you pointing to csv cdr.
I need to use either mod_format_cdr or mod_json_cdr modules, cause I plan to push later CDRs to remote server.
Is it possible somehow decrease logs generated by mod_format_cdr or mod_json_cdr modules?
If yes, please let me know how.
Thank you for your help!

With kind regards,
Jurijs

2016-01-18 16:33 GMT+02:00 Sergey Safarov <s.safarov at gmail.com<mailto:s.safarov at gmail.com>>:
Please look format of csv cdr format.

Sergey

On Mon, Jan 18, 2016 at 4:43 PM, Jurijs Ivolga <jurij.ivo at gmail.com<mailto:jurij.ivo at gmail.com>> wrote:
Hi,
Thank you for your answer!
Maybe you can provide more detailed info how I can decrease json cdr?
Currently I'm getting way too much data and almost all of them are not needed. I need just regular cdr stuff: to, from, billsec, call length, disposition, start, end, uuid, bleg_uuid.
Is it possible to limit json just to 10-15 fields, because currently I'm getting around 500 fields of data for each call?
With kind regards,
Jurijs

2016-01-18 15:34 GMT+02:00 Sergey Safarov <s.safarov at gmail.com<mailto:s.safarov at gmail.com>>:
You can split sip call to two sip calls with different dialplan context.
For one dialplan set variable process_cdr<https://freeswitch.org/confluence/display/FREESWITCH/Channel+Variables> - instruction for this dialplan will not writed to cdr



On Mon, Jan 18, 2016 at 3:23 PM, Jurijs Ivolga <jurij.ivo at gmail.com<mailto:jurij.ivo at gmail.com>> wrote:
Hi,
It looks like mod_format_cdr & mod_json_cdr are saving too much data, I'm getting around 10-20K for each call. Is it possible somehow to limit what data we would like to save with this modules? Something similar to mod_cdr_csv? In mod_cdr_csv you can set in template what data to save.
Thank you!
With kind regards,
Jurijs

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at 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 at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at 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 at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at 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 at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at 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 at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160118/931ad174/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list