[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 9522160ccc5308b8dcd09e85925382532ed3274e

Mark Wells mark at 420.am
Tue Feb 26 16:49:37 PST 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  9522160ccc5308b8dcd09e85925382532ed3274e (commit)
      from  86c903255c2d6bdef69b7a63be9d059292c905e6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9522160ccc5308b8dcd09e85925382532ed3274e
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Feb 26 16:47:57 2013 -0800

    add U4 CDR format, #20032

diff --git a/FS/FS/cdr/u4.pm b/FS/FS/cdr/u4.pm
new file mode 100644
index 0000000..1b7a660
--- /dev/null
+++ b/FS/FS/cdr/u4.pm
@@ -0,0 +1,104 @@
+package FS::cdr::u4;
+
+use strict;
+use vars qw(@ISA %info);
+use FS::cdr qw(_cdr_date_parser_maker);
+
+ at ISA = qw(FS::cdr);
+
+%info = (
+  'name'          => 'U4',
+  'weight'        => 490,
+  'type'          => 'fixedlength',
+  'fixedlength_format' => [qw(
+    CDRType:3:1:3
+    MasterAccountID:12:4:15
+    SubAccountID:12:16:27
+    BillToNumber:18:28:45
+    AccountCode:12:46:57
+    CallDateStartTime:14:58:71
+    TimeOfDay:1:72:72
+    CalculatedSeconds:12:73:84
+    City:30:85:114
+    State:2:115:116
+    Country:40:117:156
+    Charges:21:157:177
+    CallDirection:1:178:178
+    CallIndicator:1:179:179
+    ReportIndicator:1:180:180
+    ANI:10:181:190
+    DNIS:10:191:200
+    PIN:16:201:216
+    OrigNumber:10:217:226
+    TermNumber:10:227:236
+    DialedNumber:18:237:254
+    DisplayNumber:18:255:272
+    RecordSource:1:273:273
+    LECInfoDigits:2:274:275
+    OrigNPA:4:276:279
+    OrigNXX:5:280:284
+    OrigLATA:3:285:287
+    OrigZone:1:288:288
+    OrigCircuit:12:289:300
+    OrigTrunkGroupCLLI:12:301:312
+    TermNPA:4:313:316
+    TermNXX:5:317:321
+    TermLATA:3:322:324
+    TermZone:1:325:325
+    TermCircuit:12:326:337
+    TermTrunkGroupCLLI:12:338:349
+    TermOCN:5:350:354
+  )],
+  # at least that's how they're defined in the spec we have.
+  # the real CDRs have several differences.
+  'import_fields' => [
+    '',               #CDRType (for now always 'V')
+    '',               #MasterAccountID
+    '',               #SubAccountID
+    'charged_party',  #BillToNumber
+    'accountcode',    #AccountCode
+    _cdr_date_parser_maker('startdate'),
+                      #CallDateTime
+    '',               #TimeOfDay (always 'S')
+    sub {             #CalculatedSeconds
+      my($cdr, $sec) = @_;
+      $cdr->duration($sec);
+      $cdr->billsec($sec);
+    },
+    '',               #City
+    '',               #State
+    '',               #Country
+    'upstream_price', #Charges
+    sub {             #CallDirection
+      my ($cdr, $dir) = @_;
+      $cdr->set('direction', $dir);
+      if ( $dir eq 'O' ) {
+        $cdr->set('src', $cdr->charged_party);
+      } elsif ( $dir eq 'I' ) {
+        $cdr->set('dst', $cdr->charged_party);
+      }
+    },
+    '',               #CallIndicator  #calltype?
+    '',               #ReportIndicator
+    sub {             #ANI
+      # it appears that it's the "other" number, not necessarily ANI.
+      my ($cdr, $number) = @_;
+      if ( $cdr->direction eq 'O' ) {
+        $cdr->set('dst', $number);
+      } elsif ( $cdr->direction eq 'I' ) {
+        $cdr->set('src', $number);
+      }
+    },
+    '',               #DNIS
+    '',               #PIN
+    '',               #OrigNumber
+    '',               #TermNumber
+    '',               #DialedNumber
+    '',               #DisplayNumber
+    '',               #RecordSource
+    '',               #LECInfoDigits
+    ('') x 13,
+  ],
+);
+
+1;

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cdr/u4.pm |  104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 104 insertions(+), 0 deletions(-)
 create mode 100644 FS/FS/cdr/u4.pm




More information about the freeside-commits mailing list