diff --git a/debian/control b/debian/control index 673762f..7fff467 100644 --- a/debian/control +++ b/debian/control @@ -25,5 +25,6 @@ Description: Configuration templates for rate-o-mat Package: ngcp-rate-o-mat Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends}, perl-modules, libdbd-mysql-perl, libexception-class-perl, ngcp-templates-rate-o-mat +Conflicts: ngcp-ossbss-billing (< 3) Description: Rating daemon for the NGCP Perl daemon to rate CDRs in an NGCP. diff --git a/rate-o-mat.pl b/rate-o-mat.pl index c8c9a88..56b632a 100755 --- a/rate-o-mat.pl +++ b/rate-o-mat.pl @@ -197,9 +197,9 @@ sub init_db "onpeak_follow_rate, onpeak_follow_interval, ". "offpeak_init_rate, offpeak_init_interval, ". "offpeak_follow_rate, offpeak_follow_interval, ". - "billing_zone_id, use_free_time ". - "FROM billing.billing_fees WHERE billing_profile_id = ? ". - "AND type = ? AND ? REGEXP(destination) ". + "billing_zones_history_id, use_free_time ". + "FROM billing.billing_fees_history WHERE billing_profile_id = ? ". + "AND bf_id IS NOT NULL AND type = ? AND ? REGEXP(destination) ". "ORDER BY LENGTH(destination) DESC LIMIT 1" ) or FATAL "Error preparing profile info statement: ".$billdbh->errstr; @@ -209,11 +209,11 @@ sub init_db "onpeak_follow_rate, onpeak_follow_interval, ". "offpeak_init_rate, offpeak_init_interval, ". "offpeak_follow_rate, offpeak_follow_interval, ". - "billing_zone_id, use_free_time ". - "FROM billing.billing_fees WHERE billing_profile_id = ? ". - "AND type = ? AND destination = ? ". + "billing_zones_history_id, use_free_time ". + "FROM billing.billing_fees_history WHERE billing_profile_id = ? ". + "AND bf_id IS NOT NULL AND type = ? AND destination = ? ". "LIMIT 1" - ) or FATAL "Error preparing profile info statement: ".$billdbh->errstr; + ) or FATAL "Error preparing LNP profile info statement: ".$billdbh->errstr; $sth_offpeak_weekdays = $billdbh->prepare( "SELECT weekday, TIME_TO_SEC(start), TIME_TO_SEC(end) ".