[Astpp-commit] SF.net SVN: astpp:[2330] trunk/scripts
Brought to you by:
darrenkw
From: <dar...@us...> - 2011-01-15 21:45:11
|
Revision: 2330 http://astpp.svn.sourceforge.net/astpp/?rev=2330&view=rev Author: darrenkw Date: 2011-01-15 21:45:05 +0000 (Sat, 15 Jan 2011) Log Message: ----------- Fixed bugs in FreeSWITCH vendor rating. Modified Paths: -------------- trunk/scripts/astpp-common.pl trunk/scripts/astpp-rate-engine.pl Modified: trunk/scripts/astpp-common.pl =================================================================== --- trunk/scripts/astpp-common.pl 2011-01-15 21:38:29 UTC (rev 2329) +++ trunk/scripts/astpp-common.pl 2011-01-15 21:45:05 UTC (rev 2330) @@ -4001,12 +4001,14 @@ $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET cost = '0' WHERE disposition REGEXP 'USER_NOT_REGISTERED'"); $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET cost = '0' WHERE disposition REGEXP 'CHAN_NOT_IMPLEMENTED'"); $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET cost = '0' WHERE disposition REGEXP 'INVALID_NUMBER_FORMAT'"); + $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET cost = '0' WHERE disposition REGEXP 'UNALLOCATED_NUMBER'"); if ($config->{trackvendorcharges} == 1) { $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET vendor = '0' WHERE disposition REGEXP 'ORIGINATOR_CANCEL'"); $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET vendor = '0' WHERE disposition REGEXP 'CALL_REJECTED'"); $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET vendor = '0' WHERE disposition REGEXP 'USER_NOT_REGISTERED'"); $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET vendor = '0' WHERE disposition REGEXP 'CHAN_NOT_IMPLEMENTED'"); $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET vendor = '0' WHERE disposition REGEXP 'INVALID_NUMBER_FORMAT'"); + $cdr_db->do("UPDATE $config->{freeswitch_cdr_table} SET cost = '0' WHERE disposition REGEXP 'UNALLOCATED_NUMBER'"); } } sub cleanup_cdrs() { Modified: trunk/scripts/astpp-rate-engine.pl =================================================================== --- trunk/scripts/astpp-rate-engine.pl 2011-01-15 21:38:29 UTC (rev 2329) +++ trunk/scripts/astpp-rate-engine.pl 2011-01-15 21:45:05 UTC (rev 2330) @@ -72,6 +72,7 @@ } else { $config->{cdr_table} = $config->{asterisk_cdr_table}; $ASTPP->debug("Rating calls for Asterisk", $verbosity); + &cleanup_cdrs($cdr_db, $config); } if ( $uniqueid ne "" ) { @@ -181,7 +182,6 @@ exit(0); } else { - &cleanup_cdrs($cdr_db, $config); my @chargelist; my $phrase = "none"; @chargelist = &list_cdrs_status( $config, $cdr_db, $phrase ); # Grab a list of all calls with "none" assigned in the cost field @@ -190,13 +190,13 @@ @chargelist = &list_cdrs_status( $config, $cdr_db, $phrase ); # Grab a list of all calls with "none" assigned in the cost field &processlist($astpp_db, $cdr_db, $config, \@chargelist); # See if we can now bill some of the calls that are marked in "error" if ($config->{trackvendorcharges} == 1) { - print STDERR gettext("START ON VENDOR CALL RATING!") . "\n" if $config->{debug} == 1; + print STDERR gettext("START ON VENDOR CALL RATING!") . "\n" if $config->{debug} == 1; if ($config->{softswitch} == 0) { - &vendor_process_rating( $astpp_db, $cdr_db, $config, "none", 0 ); - &vendor_process_rating( $astpp_db, $cdr_db, $config. $config, "error", 0 ); + &vendor_process_rating( $astpp_db, $cdr_db, $config, "none", 0 ); + &vendor_process_rating( $astpp_db, $cdr_db, $config. $config, "error", 0 ); } elsif ($config->{softswitch} == 1) { - &vendor_process_rating_fs( $astpp_db, $cdr_db, $config, "none", 0 ); - &vendor_process_rating_fs( $astpp_db, $cdr_db, $config. $config, "error", 0 ); + &vendor_process_rating_fs( $astpp_db, $cdr_db, $config, "none", 0 ); + &vendor_process_rating_fs( $astpp_db, $cdr_db, $config, $config, "error", 0 ); } print STDERR gettext("VENDOR CALLS WHICH HAVE NOT BEEN RATED.") . "\n" if $config->{debug} == 1; # Print a list of calls which have not been rated This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |