+#returns a reason why not to rate this CDR, or false if the CDR is chargeable
+sub check_chargable {
+ my( $self, $cdr, %opt ) = @_;
+
+ #should have some better way of checking these options from a hash
+ #or something
+
+ return 'amaflags != 2'
+ if $self->option('use_amaflags') && $cdr->amaflags != 2;
+
+ return 'disposition != ANSWERED'
+ if $self->option('use_disposition') && $cdr->disposition ne 'ANSWERED';
+
+ return "disposition != 100"
+ if $self->option('use_disposition_taqua') && $cdr->disposition != 100;
+
+ return 'carrierid != '. $self->option('use_carrierid')
+ if $self->option('use_carrierid')
+ && $cdr->carrierid != $self->option('use_carrierid')
+ && ! $opt{'411_rewrite'};
+
+ return 'cdrtypenum != '. $self->option('use_cdrtypenum')
+ if $self->option('use_cdrtypenum')
+ && $cdr->cdrtypenum != $self->option('use_cdrtypenum');
+
+ #all right then, rate it
+ '';
+}
+