NetSDS::EDR(3pm)

πŸ“¦
version 1.301 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

πŸ’– NetSDS::EDR πŸ’–

okay bestie, sit DOWN, because we're talking about NetSDS::EDR β€” the Perl module (it lives in the 3pm manual section, iykyk) that reads and writes Event Details Records. no cap, it's giving "billing backend but make it cute". πŸŽ€


✨ NAME ✨

NetSDS::EDR β€” read/write Event Details Records πŸ¦‹


🌸 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'
    }
);

see how chill that is?? you make one object, you hand it a hash, it writes a row. periodt. πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so like, NetSDS::EDR implements an API for writing EDR (Event Details Record) files from applications. that's the whole vibe. πŸ’–

and what even is an EDR? it's a set of structured data describing the details of some event. the exact structure depends on the event type, so it lowkey doesn't have a fixed structure β€” it's flexible like that, main character energy fr fr. 🌈

in NetSDS, EDR data gets written to plain text files as JSON structures, one row per record. literally one record, one line. no notes. ⭐


🧚 CLASS API 🧚

new(%params) β€” class constructor ✨

parameters, bestie:

  • filename β€” the EDR file name πŸ“

example:

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

write($rec1 [,$rec2 [...,$recN]]) β€” write EDR to file πŸ”₯

this method converts records to JSON and writes them to the file. each record goes onto one separate string. so if you pass it a whole little squad of records, each one gets its own line. obsessed. 🫢

example:

    $edr->write({from => '380441234567', to => '5552222', status => 'busy'});

πŸ“ EXAMPLES πŸ“

go peek in the samples directory. it's right there. πŸ’œ


πŸ’€ TODO πŸ’€

  • Handle I/O errors when write EDR data. (yeah bestie, that one's still on the list, not me pretending it's done πŸ™ˆ)

🌟 AUTHOR 🌟

Michael Bochkaryov <misha@rattler.kiev.ua>


πŸ“œ 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 GNU 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 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

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

⚠️ real talk: that "WITHOUT ANY WARRANTY" bit is not a joke, bestie β€” it's the actual legal vibe, so don't come for anyone if it breaks. 😭

okay that's the whole page, we ate and left no crumbs πŸ‘‘βœ¨ this was NetSDS::EDR from perl v5.32.1, dated 2021-12-26 β€” mwah, love u, bye πŸ’…πŸ’–πŸ¦‹