[Astpp-commit] SF.net SVN: astpp:[2232] trunk/scripts/astpp-common.pl
Brought to you by:
darrenkw
From: <dar...@us...> - 2009-02-03 17:15:26
|
Revision: 2232 http://astpp.svn.sourceforge.net/astpp/?rev=2232&view=rev Author: darrenkw Date: 2009-02-03 17:15:20 +0000 (Tue, 03 Feb 2009) Log Message: ----------- Corrected code so that calls where an accountcode does not exist in ASTPP will be marked as being in error. Modified Paths: -------------- trunk/scripts/astpp-common.pl Modified: trunk/scripts/astpp-common.pl =================================================================== --- trunk/scripts/astpp-common.pl 2009-02-02 19:43:38 UTC (rev 2231) +++ trunk/scripts/astpp-common.pl 2009-02-03 17:15:20 UTC (rev 2232) @@ -1727,6 +1727,7 @@ $record = &get_did($astpp_db,$destination) if $carddata->{reseller} eq ""; $record->{comment} = $record->{city} . "," . $record->{province} . "," . $record->{country}; $record->{pattern} = "DID:" . $destination; + $record->{pricelist} = $pricelist; my $branddata = &get_pricelist( $astpp_db, $pricelist); print STDERR "pattern: $record->{pattern}\n" if $record->{pattern}; } @@ -3519,7 +3520,7 @@ my ($astpp_db) = @_; my ( $sql, @brandlist, $result ); $sql = - $astpp_db->prepare("SELECT name FROM callingcardbrands WHERE status = 1 AND reseller IN (NULL,'')"); + $astpp_db->prepare("SELECT name FROM callingcardbrands WHERE status = 1 AND (reseller IS NULL OR reseller = '')"); $sql->execute; while ( $result = $sql->fetchrow_hashref ) { push @brandlist, $result->{name}; @@ -3936,7 +3937,7 @@ $cdr_db->do("UPDATE $config->{asterisk_cdr_table} SET vendor = '0' WHERE disposition REGEXP 'CANCEL'"); } if ($config->{thirdlane_mods} == 1) { - $cdr_db->do("UPDATE cdr SET accountcode = userfield WHERE accountcode IN ('',NULL)"); + $cdr_db->do("UPDATE cdr SET accountcode = userfield WHERE (accountcode IS NULL or accountcode = '')"); } } } @@ -4206,11 +4207,11 @@ print STDERR "disposition: $cdrinfo->{disposition}\n"; print STDERR "----------------------\n"; if(!$vars) { - my $tmp = "UPDATE $config->{asterisk_cdr_table} SET cost = 'none' WHERE uniqueid = " + my $tmp = "UPDATE $config->{asterisk_cdr_table} SET cost = 'error' WHERE uniqueid = " . $uniqueid . " AND cost = 'rating' LIMIT 1"; $cdr_db->do($tmp); } else { - $cdrinfo->{cost} = 'none'; + $cdrinfo->{cost} = 'error'; } } } @@ -4356,13 +4357,13 @@ if (!$sweep || $sweep eq "" ) { $sql = $astpp_db->prepare( -"SELECT number FROM accounts WHERE status < 2 AND reseller IN (NULL,'') AND posttoexternal = 0 " +"SELECT number FROM accounts WHERE status < 2 AND (reseller IS NULL OR reseller = '') AND posttoexternal = 0 " ); } else { $sql = $astpp_db->prepare( -"SELECT number FROM accounts WHERE status < 2 AND reseller IN (NULL,'') AND sweep = " +"SELECT number FROM accounts WHERE status < 2 AND ( reseller IS NULL OR reseller = '') AND sweep = " . $astpp_db->quote($sweep) ); } $sql->execute; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |