When we get passed a destination directory, create it instead of
die'ing, which is a more user-friendly behavior.
Change-Id: I45fa502ac76ce4d8602a8bd69ec51c18fa7c7f08
perl 5.36 seems to be sensitive when auto-vivifying new
elements of array refs.
Attempt to free unreferenced scalar: ..
panic: attempt to copy freed scalar ..
so this should be done with dereferenced array (lists)
only instead.
Change-Id: Ifb728021df21deb50e1b1222d077a3623dc3c580
This syntax is discouraged, and it is not enabled by default any longer
starting with the 5.36 feature bundles. Stop using it so that we can
eventually bump our minimum required Perl version.
Fixes: Objects::ProhibitIndirectSyntax
Warned-by: perlcritic
Ref: https://metacpan.org/pod/feature#The-'indirect'-feature
Change-Id: Ia1bfb1eac370a7a5e9ebea0247243c4a56fb4db8
this recognizes a "reseller" filter list option of the
cdrexporter config, to be able to configure cdr streams
that each should export resellers the given filter list
only.
Change-Id: Ibd1a5e14d384e3cce4bfbccfc69ac985ea13ee0b
using the CSV_HEADER pattern parameter to print .csv-style
column names means to hardcode the columnnames in config.yml,
where they easily get out-of-sync with the actual configured
export_fields.
the new pattern parameter ${colnames} allows to print the
comma-separated list of the currently configured export_fields.
Change-Id: Iba4205584f2461e98357ced53b598520f838b5b2
int-cdr-exporter.pl is added to export intermediate
cdr records in the same format configured for regular
cdrs. the files are written to the same folders and
therefor have a distinctive extension suffix and
separated file sequence numbers.
Change-Id: I9801bc1a4221f22a169bd64ed7956b75fc52a3f2
to prevent a conflict when saving file sequence numbers
for both cdr and intcdr export when using streams,
the accounting.mark.collector name will be prefixed
with the exporter type.
Change-Id: I939c7bee59676b5d64967a7d57b1ed515cc80506
it will be possible to specify cdr-exporter configurations
multiple times in config.yml. this results in multiple
blocks in cdr-exporter.conf. each block represents a
"stream". The export is executed with each stream config,
one after the other.
+ the export_status is managed separetely per stream
+ the lastseq mark is managed separately per stream
+ total backward-compat handling for the standard stream ('default')
+ stream configs can be defined independently
+ the "export_status = 'unexported'" filter condition is extended
and implied for streams other than 'default' implicitly
(so no need to add them in the config)
+ optional "enabled" config flag per stream
+ mysql_auto_reconnect MUST NOT be used with AutoCommit = 0
Change-Id: Idb6b510f5e43729a5e67653db100ac43e364ffaf
* csv header and footer can now be specified in the config
as as formatted string, ${version},{rows,%04i}
where the values are applied to it when the csv is created.
currently supported names where optinally sprintf spec
is supported after comma:
- version
- rows
- checksum (only for footer)
- first_seq (first sequence id)
- last_seq (last sequence id)
- datetime (instead of the sprintf spec,
strftime spec is expected)
Change-Id: Ifadfbdb1d40a3be32b869f50070c5ba3d3f63f67
Fixes:
1) use move() instead of copy() to get already processed files out of
the way
2) fix off-by one bug when MAX_ROWS_PER_FILE isn't set
Change-Id: I9ee949f8df10bfa04f913f59d9ac16012be22484
Assign the temporary directory object directly to the $tempdir scalar,
so that the scope is package-wide, and the directory can be cleaned up
when the programs finish instead of when the function finishes.
Given that the scalar is always used in string context, the object will
transparently call the dirname method which preserves the previous
behavior.
Let's remove also the CLEANUP option which is the default.
Change-Id: I36e23ccbef7060c2d1acd16fc20af1fcfc881022
On a stock master CE, running edr exporter results in this error:
$ /usr/sbin/event-exporter
Can't use string ("{ accounting.events.export_statu"...) as an ARRAY ref
while "strict refs" in use at /usr/share/perl5/NGCP/CDR/Exporter.pm line 135.
Reason is that EXPORT_CONDITION only has one element in the default config,
and therefore confval() returns a scalar instead of an array ref. Using
get_config_fields() instead always forces an array we can iterate over.
Change-Id: Id6d049b4275a52dc5760a636472082de625d2ac8