SYNOPSIS

        use NetSDS::EDR;

        my $edr = NetSDS::EDR->new(
                filename => '/mnt/billing/call-stats.dat',
        );

        ...

        $edr->write(
                {
                callerid => '80441234567',
                clip => '89001234567',
                start_time => '2006-12-55 12:21:46',
                end_time => '2008-12-55 12:33:22'
                }
        );

DESCRIPTION

\*(C`NetSDS::EDR\*(C' module implements \s-1API\s0 for writing \s-1EDR\s0 (Event Details Record) files form applications.

\s-1EDR\s0 itself is set of structured data describing details of some event. Exact structure depends on event type and so hasn't fixed structure.

In NetSDS \s-1EDR\s0 data is written to plain text files as \s-1JSON\s0 structures one row per record.

CLASS API

new(%params) - class constructor

Parameters: * filename - \s-1EDR\s0 file name Example: my $edr = NetSDS::EDR->new( filename => '/mnt/stat/ivr.dat', );

write($rec1 [,$rec2 [...,$recN]]) - write \s-1EDR\s0 to file

This methods converts records to \s-1JSON\s0 and write to file. Each record writing to one separate string. Example: $edr->write({from => '380441234567', to => '5552222', status => 'busy'});

EXAMPLES

See \*(C`samples\*(C' directory.

TODO

* Handle I/O errors when write \s-1EDR\s0 data.

AUTHOR

Michael Bochkaryov <[email protected]>

LICENSE

Copyright (C) 2008-2009 Net Style Ltd.

This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the \s-1GNU\s0 General Public License for more details.

You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, \s-1MA\s0 02111-1307 \s-1USA\s0