[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm,1.24,1.25

Ivan,,, ivan at wavetail.420.am
Mon Sep 8 19:24:34 PDT 2008


Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv17473/FS/FS/part_pkg

Modified Files:
	voip_cdr.pm 
Log Message:
additional QIS/Taqua-specific CDR handling details, RT#3838

Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- voip_cdr.pm	30 Aug 2008 21:34:44 -0000	1.24
+++ voip_cdr.pm	9 Sep 2008 02:24:32 -0000	1.25
@@ -80,6 +80,19 @@
                            'type' => 'checkbox',
                          },
 
+    'use_disposition_taqua' => { 'name' => 'Do not charge for CDRs where the disposition is not set to "100" (Taqua).',
+                                 'type' => 'checkbox',
+                               },
+
+    'use_carrierid' => { 'name' => 'Do not charge for CDRs where the Carrier ID is not set to: ',
+                         },
+
+    'use_cdrtypenum' => { 'name' => 'Do not charge for CDRs where the CDR Type is not set to: ',
+                         },
+
+    '411_rewrite' => { 'name' => 'Rewrite these (comma-separated) destination numbers to 411 for rating purposes: ',
+                      },
+
     'output_format' => { 'name' => 'Simple output format',
                          'type' => 'select',
                          'select_options' => { FS::cdr::invoice_formats() },
@@ -182,15 +195,39 @@
          )
       {
 
+        #should have some better way of checking these options than a long
+        #if-else tree...
+        my $notchg = "not charging for CDR";
+
         if ( $self->option('use_amaflags') && $cdr->amaflags != 2 ) {
 
-          warn "not charging for CDR (amaflags != 2)\n" if $DEBUG;
+          warn "$notchg (amaflags != 2)\n" if $DEBUG;
           $charge = 0;
 
         } elsif ( $self->option('use_disposition')
                   && $cdr->disposition ne 'ANSWERED' ) {
 
-          warn "not charging for CDR (disposition != ANSWERED)\n" if $DEBUG;
+          warn "$notchg (disposition != ANSWERED)\n" if $DEBUG;
+          $charge = 0;
+
+        } elsif ( $self->option('use_disposition_taqua')
+                  && $cdr->disposition != 100 ) {
+
+          warn "$notchg (disposition != 100)\n" if $DEBUG;
+          $charge = 0;
+
+        } elsif ( $self->option('use_carrierid')
+                  && $cdr->carrierid != $self->option('use_carrierid') ) {
+
+          warn "$notchg (carrierid != ". $self->option('use_carrierid'). ")\n"
+            if $DEBUG;
+          $charge = 0;
+
+        } elsif ( $self->option('use_cdrtypenum')
+                  && $cdr->cdrtypenum != $self->option('use_cdrtypenum') ) {
+
+          warn "$notchg (cdrtypenum != ". $self->option('use_cdrtypenum'). ")\n"
+            if $DEBUG;
           $charge = 0;
 
         } else {
@@ -200,6 +237,11 @@
           # (or calling station id for toll free calls)
           ###
 
+          if ( $self->option('411_rewrite') ) {
+            my @dirass = split(/\s*,\s*/, $self->option('411_rewrite'));
+            $cdr->dst('411') if grep $cdr->dst eq $_, @dirass;
+          }
+
           my( $to_or_from, $number );
           if ( $cdr->dst =~ /^(\+?1)?8([02-8])\1/ ) { #tollfree call
             $to_or_from = 'from';



More information about the freeside-commits mailing list