Thread: [Astpp-commit] SF.net SVN: astpp: [2129] trunk/astpp-common.pl
Brought to you by:
darrenkw
From: <dar...@us...> - 2007-09-22 05:15:37
|
Revision: 2129 http://astpp.svn.sourceforge.net/astpp/?rev=2129&view=rev Author: darrenkw Date: 2007-09-21 22:15:34 -0700 (Fri, 21 Sep 2007) Log Message: ----------- Resolve Bug: [ 1800039 ] Call rating issue The "post_cdr" subroutine was being called incorrectly. Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2007-09-19 01:57:11 UTC (rev 2128) +++ trunk/astpp-common.pl 2007-09-22 05:15:34 UTC (rev 2129) @@ -1077,21 +1077,21 @@ $didinfo = &get_did_reseller($astpp_db,$did,$accountdata->{reseller}); if ($didinfo->{disconnectionfee} != 0) { $dest = gettext("DID:") . $did . gettext(" disconnection fee"); - &post_cdr($astpp_db,'',$accountdata->{number},'',$dest,'','',$didinfo->{disconnectionfee},$callstart,$accountdata->{postexternal},'',$notes); + &post_cdr($astpp_db,$config,'',$accountdata->{number},'',$dest,'','',$didinfo->{disconnectionfee},$callstart,$accountdata->{postexternal},'',$notes); } $accountdata = &get_account($astpp_db, $accountdata->{reseller}); } $didinfo = &get_did($astpp_db,$did,$account); if ($didinfo->{disconnectionfee} != 0) { $dest = gettext("DID:") . $did . gettext(" disconnection fee"); - &post_cdr($astpp_db,'',$accountdata->{number},'',$dest,'','',$didinfo->{disconnectionfee},$callstart,$accountdata->{postexternal},'',$notes); + &post_cdr($astpp_db,$config,'',$accountdata->{number},'',$dest,'','',$didinfo->{disconnectionfee},$callstart,$accountdata->{postexternal},'',$notes); } $accountdata = &get_account($astpp_db,$account); } else { $didinfo = &get_did($astpp_db,$did,$account); if ($didinfo->{disconnectionfee} != 0) { $dest = gettext("DID:") . $did . gettext(" disconnection fee"); - &post_cdr($astpp_db,,'',$accountdata->{number},'',$dest,'','',$didinfo->{disconnectionfee},$callstart,$accountdata->{postexternal},'',$notes); + &post_cdr($astpp_db,$config,'',$accountdata->{number},'',$dest,'','',$didinfo->{disconnectionfee},$callstart,$accountdata->{postexternal},'',$notes); } } # If we got this far the cdrs have been posted and we're ready to cancel the DID. @@ -1196,11 +1196,11 @@ if ($didinfo->{chargeonallocation} == 1) { my $dest = gettext("DID:") . $did . gettext(" from ") . $start_date . gettext(" to ") . $end_date; - &post_cdr($astpp_db,'',$accountdata->{number},'',$dest,'','',$cost,$callstart,$accountinfo->{postexternal},'',$notes); + &post_cdr($astpp_db,$config,'',$accountdata->{number},'',$dest,'','',$cost,$callstart,$accountinfo->{postexternal},'',$notes); } if ($didinfo->{setup} != 0) { my $dest = gettext("DID:") . $did . gettext(" setup fee"); - &post_cdr($astpp_db,'',$accountdata->{number},'',$dest,'','',$didinfo->{setup},$callstart,$accountinfo->{postexternal},'',$notes); + &post_cdr($astpp_db,$config,'',$accountdata->{number},'',$dest,'','',$didinfo->{setup},$callstart,$accountinfo->{postexternal},'',$notes); } $accountdata = &get_account($astpp_db,$accountdata->{reseller}); } @@ -1215,11 +1215,11 @@ if ($didinfo->{chargeonallocation} == 1) { my $dest = gettext("DID:") . $did . gettext(" from ") . $start_date . gettext(" to ") . $end_date; - &post_cdr($astpp_db,'',$accountdata->{number},'',$dest,'','',$cost,$callstart,$accountdata->{postexternal},'',$notes); + &post_cdr($astpp_db,$config,'',$accountdata->{number},'',$dest,'','',$cost,$callstart,$accountdata->{postexternal},'',$notes); } if ($didinfo->{setup} != 0) { $dest = gettext("DID:") . $did . gettext(" setup fee"); - &post_cdr($astpp_db,'',$accountdata->{number},'',$dest,'','',$didinfo->{setup},$callstart,$accountdata->{postexternal},'',$notes); + &post_cdr($astpp_db,$config,'',$accountdata->{number},'',$dest,'','',$didinfo->{setup},$callstart,$accountdata->{postexternal},'',$notes); } } else { my $did_min_available = $didinfo->{monthlycost} + $didinfo->{setup} + $didinfo->{disconnectionfee}; @@ -1235,11 +1235,11 @@ if ($didinfo->{chargeonallocation} == 1) { my $dest = gettext("DID:") . $did . gettext(" from ") . $start_date . gettext(" to ") . $end_date; - &post_cdr($astpp_db,'',$accountinfo->{number},'',$dest,'','',$cost,$callstart,$accountinfo->{postexternal},'',$notes); + &post_cdr($astpp_db,$config,'',$accountinfo->{number},'',$dest,'','',$cost,$callstart,$accountinfo->{postexternal},'',$notes); } if ($didinfo->{setup} != 0) { $dest = gettext("DID:") . $did . gettext(" setup fee"); - &post_cdr($astpp_db,'',$accountinfo->{number},'',$dest,'','',$didinfo->{setup},$callstart,$accountinfo->{postexternal},'',$notes); + &post_cdr($astpp_db,$config,'',$accountinfo->{number},'',$dest,'','',$didinfo->{setup},$callstart,$accountinfo->{postexternal},'',$notes); } } } @@ -2166,7 +2166,7 @@ # Write ASTPP cdr. I think this one is mostly deprecated but should probably be completely removed. sub post_cdr() { my ( - $astpp_db, $uniqueid, $account, $clid, + $astpp_db, $config, $uniqueid, $account, $clid, $dest, $disp, $seconds, $cost, $callstart, $postexternal, $trunk, $notes ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2007-11-02 05:39:51
|
Revision: 2148 http://astpp.svn.sourceforge.net/astpp/?rev=2148&view=rev Author: darrenkw Date: 2007-11-01 22:39:54 -0700 (Thu, 01 Nov 2007) Log Message: ----------- A test for the packages issue. Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2007-11-02 05:13:00 UTC (rev 2147) +++ trunk/astpp-common.pl 2007-11-02 05:39:54 UTC (rev 2148) @@ -3686,7 +3686,7 @@ print STDERR "pricelistData: $branddata->{name} $branddata->{markup} $branddata->{inc} $branddata->{status}\n"; -my $package = &get_package( $astpp_db, $carddata, $cdrinfo->{dst} ); + my $package = &get_package( $astpp_db, $carddata, $cdrinfo->{dst} ); if ($package->{name}) { my $counter = &get_counter( $astpp_db, $package->{name}, @@ -3829,6 +3829,7 @@ my $uniqueid = $_; print STDERR gettext("Processing Uniqueid: ") . $_; my $cdrinfo = &get_cdr( $cdr_db, $uniqueid ); + my $savedcdrinfo = $cdrinfo; my $tmp = "UPDATE $config->{asterisk_cdr_table} SET cost = 'rating' WHERE uniqueid = " . $cdr_db->quote($uniqueid) . " AND cost = 'none'" @@ -3858,6 +3859,7 @@ } elsif ( $cdrinfo->{accountcode} ) { $status = &rating( $astpp_db, $cdr_db, $config, $cdrinfo, $carddata); + $cdrinfo = $savedcdrinfo; if ( $status == 1 ) { my $previous_account = $carddata->{number}; while ( $carddata->{reseller} ne "" ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2007-11-04 22:32:25
|
Revision: 2154 http://astpp.svn.sourceforge.net/astpp/?rev=2154&view=rev Author: darrenkw Date: 2007-11-04 14:32:27 -0800 (Sun, 04 Nov 2007) Log Message: ----------- Updated the packages/counters code. Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2007-11-03 23:06:13 UTC (rev 2153) +++ trunk/astpp-common.pl 2007-11-04 22:32:27 UTC (rev 2154) @@ -3859,7 +3859,9 @@ print STDERR "----------------------\n"; } elsif ( $cdrinfo->{accountcode} ) { + my $savedcdrinfo = $cdrinfo; $status = &rating( $astpp_db, $cdr_db, $config, $cdrinfo, $carddata); + $cdrinfo = $savedcdrinfo; if ( $status == 1 ) { my $previous_account = $carddata->{number}; while ( $carddata->{reseller} ne "" ) { @@ -3868,7 +3870,7 @@ print STDERR "Charge $uniqueid to $carddata->{reseller}" if $config->{debug} == 1; $carddata = &get_account( $astpp_db, $carddata->{reseller} ); $status = &rating( $astpp_db, $cdr_db, $config, $cdrinfo, $carddata); - + $cdrinfo = $savedcdrinfo; my $tmp = "SELECT id FROM cdrs WHERE uniqueid = '" . $uniqueid . "' AND cardnum = '" . $previous_account . "' LIMIT 1"; print STDERR "$tmp\n" if $config->{debug} == 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2007-11-06 03:33:04
|
Revision: 2155 http://astpp.svn.sourceforge.net/astpp/?rev=2155&view=rev Author: darrenkw Date: 2007-11-05 19:33:07 -0800 (Mon, 05 Nov 2007) Log Message: ----------- Resolve problem with packages. Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2007-11-04 22:32:27 UTC (rev 2154) +++ trunk/astpp-common.pl 2007-11-06 03:33:07 UTC (rev 2155) @@ -3686,7 +3686,7 @@ print STDERR "pricelistData: $branddata->{name} $branddata->{markup} $branddata->{inc} $branddata->{status}\n"; - my $package = &get_package( $astpp_db, $carddata, $cdrinfo->{dst} ); + $package = &get_package( $astpp_db, $carddata, $cdrinfo->{dst} ); if ($package->{id}) { my $counter = &get_counter( $astpp_db, $package->{id}, @@ -3859,18 +3859,15 @@ print STDERR "----------------------\n"; } elsif ( $cdrinfo->{accountcode} ) { - my $savedcdrinfo = $cdrinfo; $status = &rating( $astpp_db, $cdr_db, $config, $cdrinfo, $carddata); - $cdrinfo = $savedcdrinfo; + $cdrinfo = &get_cdr( $cdr_db, $uniqueid ); if ( $status == 1 ) { my $previous_account = $carddata->{number}; while ( $carddata->{reseller} ne "" ) { -# my $cdrinfo = &get_cdr( $cdr_db, $uniqueid ); -# my $reseller = $carddata->{reseller}; + $cdrinfo = &get_cdr( $cdr_db, $uniqueid ); print STDERR "Charge $uniqueid to $carddata->{reseller}" if $config->{debug} == 1; $carddata = &get_account( $astpp_db, $carddata->{reseller} ); $status = &rating( $astpp_db, $cdr_db, $config, $cdrinfo, $carddata); - $cdrinfo = $savedcdrinfo; my $tmp = "SELECT id FROM cdrs WHERE uniqueid = '" . $uniqueid . "' AND cardnum = '" . $previous_account . "' LIMIT 1"; print STDERR "$tmp\n" if $config->{debug} == 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2007-11-19 10:00:21
|
Revision: 2168 http://astpp.svn.sourceforge.net/astpp/?rev=2168&view=rev Author: darrenkw Date: 2007-11-19 02:00:21 -0800 (Mon, 19 Nov 2007) Log Message: ----------- Card_inuse was being declared twice and the second time was marked as empty. Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2007-11-19 09:47:43 UTC (rev 2167) +++ trunk/astpp-common.pl 2007-11-19 10:00:21 UTC (rev 2168) @@ -3640,7 +3640,6 @@ $sound->{pin} = "astpp-pleasepin"; #Please enter your pin followed by pound. $sound->{pin_incorrect} = "astpp-invalidpin"; #Incorrect pin. $sound->{point} = "astcc-point"; #point. -$sound->{card_inuse} = ""; $sound->{register_ani} = "astpp-register" ; # "Register ANI to this card? Press 1 for yes or any other key for no." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2007-12-29 04:26:13
|
Revision: 2170 http://astpp.svn.sourceforge.net/astpp/?rev=2170&view=rev Author: darrenkw Date: 2007-12-28 20:26:16 -0800 (Fri, 28 Dec 2007) Log Message: ----------- Resolved: [ 1847735 ] refill bugs Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2007-11-19 10:12:08 UTC (rev 2169) +++ trunk/astpp-common.pl 2007-12-29 04:26:16 UTC (rev 2170) @@ -3549,17 +3549,17 @@ # Status 2 means the card has expired. # Status 3 means the card is empty. my ($astpp_db,$cardinfo) = @_; - my $now = $astpp_db->selectall_arrayref("SELECT NOW() + 0")->[0][0]; + my $now = $astpp_db->selectall_arrayref("SELECT NOW()")->[0][0]; print STDERR "Present Time: $now\n"; print STDERR "Expiration Date: $cardinfo->{expiry}\n"; print STDERR "Valid for Days: $cardinfo->{validfordays}\n"; - print STDERR "First Use: $cardinfo->{firstuse}\n"; + print STDERR "First Use: $cardinfo->{firstused}\n"; if ( $cardinfo->{inuse} != 0 ) { return 1; #Status 1 means card is in use. } if ( $cardinfo->{validfordays} > 0 ) { - $now = $astpp_db->selectall_arrayref("SELECT NOW() + 0")->[0][0]; + $now = $astpp_db->selectall_arrayref("SELECT NOW()")->[0][0]; if ( $now gt $cardinfo->{expiry} && $cardinfo->{expiry} ne "0000-00-00 00:00:00" ) { my $sql = "UPDATE callingcards SET status = 2 WHERE cardnumber = " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2007-12-29 04:59:54
|
Revision: 2172 http://astpp.svn.sourceforge.net/astpp/?rev=2172&view=rev Author: darrenkw Date: 2007-12-28 20:59:59 -0800 (Fri, 28 Dec 2007) Log Message: ----------- Fix a minor typo. Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2007-12-29 04:58:01 UTC (rev 2171) +++ trunk/astpp-common.pl 2007-12-29 04:59:59 UTC (rev 2172) @@ -4076,7 +4076,7 @@ } } } else { - $cardinfo = $vars; + my $cdrinfo = $vars; my $tmp = "SELECT * FROM outbound_routes WHERE " . $astpp_db->quote( $cdrinfo->{dst} ) . " RLIKE pattern AND status = 1 AND trunk = " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2008-05-03 22:07:49
|
Revision: 2176 http://astpp.svn.sourceforge.net/astpp/?rev=2176&view=rev Author: darrenkw Date: 2008-05-03 15:07:56 -0700 (Sat, 03 May 2008) Log Message: ----------- Resolved Bug [ 1956259 ] Incorrect uniqueid shown in output Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2008-05-03 22:03:34 UTC (rev 2175) +++ trunk/astpp-common.pl 2008-05-03 22:07:56 UTC (rev 2176) @@ -3899,7 +3899,7 @@ my ( $status, $cdrinfo); foreach (@$chargelist) { my $uniqueid = $_; - print STDERR gettext("Processing Uniqueid: ") . @$chargelist; + print STDERR gettext("Processing Uniqueid: ") . $uniqueid . "\n"; $cdrinfo = ($vars) ? $vars : &get_cdr( $config, $cdr_db, $uniqueid ); my $savedcdrinfo = $cdrinfo; if(!$vars) { @@ -3926,7 +3926,7 @@ print STDERR "\n----------------------\n"; print STDERR "CDR Written - No Billable Seconds\n"; print STDERR - "uniqueid $uniqueid, cardno $cdrinfo->{accountcode}, phoneno $cdrinfo->{dst}\n"; + "uniqueid $cdrinfo->{uniqueid}, cardno $cdrinfo->{accountcode}, phoneno $cdrinfo->{dst}\n"; print STDERR "disposition $cdrinfo->{disposition}\n"; print STDERR "----------------------\n"; } @@ -3988,7 +3988,7 @@ print STDERR "ERROR - ERROR - ERROR - ERROR - ERROR \n"; print STDERR "NO ACCOUNTCODE IN DATABASE\n"; print STDERR - "uniqueid: $uniqueid, cardno: $cdrinfo->{accountcode}, phoneno: $cdrinfo->{dst}\n"; + "uniqueid: $cdrinfo->{uniqueid}, cardno: $cdrinfo->{accountcode}, phoneno: $cdrinfo->{dst}\n"; print STDERR "disposition: $cdrinfo->{disposition}\n"; print STDERR "----------------------\n"; if(!$vars) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2008-05-06 02:02:07
|
Revision: 2178 http://astpp.svn.sourceforge.net/astpp/?rev=2178&view=rev Author: darrenkw Date: 2008-05-05 19:02:09 -0700 (Mon, 05 May 2008) Log Message: ----------- Resolved Bug: [1956264 ] Email invoices Modified Paths: -------------- trunk/astpp-common.pl Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2008-05-06 01:11:34 UTC (rev 2177) +++ trunk/astpp-common.pl 2008-05-06 02:02:09 UTC (rev 2178) @@ -437,6 +437,7 @@ # configured per reseller. sub email_refill_account() { my ( $astpp_db,$reseller,$config, $vars ) = @_; + $vars->{email} = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $vars->{email}, From => $config->{company_email}, @@ -460,6 +461,7 @@ # configured per reseller. sub email_reactivate_account() { my ( $astpp_db,$reseller,$config, $vars ) = @_; + $vars->{email} = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $vars->{email}, From => $config->{company_email}, @@ -483,6 +485,7 @@ # configured per reseller. sub email_add_user() { my ( $astpp_db,$reseller,$config, $vars ) = @_; + $vars->{email} = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $vars->{email}, From => $config->{company_email}, @@ -508,6 +511,7 @@ # configured per reseller. sub email_add_device() { my ( $astpp_db,$reseller, $config, $vars ) = @_; + $vars->{email} = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $vars->{email}, From => $config->{company_email}, @@ -581,6 +585,7 @@ # configured per reseller. sub email_del_user() { my ( $astpp_db,$reseller,$config, $vars) = @_; + $vars->{email} = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $vars->{email}, From => $config->{company_email}, @@ -604,6 +609,7 @@ # configured per reseller. sub email_add_callingcard() { my ( $astpp_db,$reseller,$config, $vars, $cc, $pin ) = @_; + $vars->{email} = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $vars->{email}, From => $config->{company_email}, @@ -627,7 +633,7 @@ # configured per reseller. sub email_add_did() { my ( $astpp_db, $reseller,$vars, $did, $config, $email ) = @_; - $email = $config->{company_email} if ( $email eq "" ); + $email = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $email, From => $config->{company_email}, @@ -658,7 +664,7 @@ # configured per reseller. sub email_del_did() { my ( $astpp_db, $reseller,$vars, $did, $config, $email ) = @_; - $email = $config->{company_email} if ( $email eq "" ); + $email = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $email, From => $config->{company_email}, @@ -684,6 +690,7 @@ # configured per reseller. sub email_new_invoice() { my ( $astpp_db,$reseller,$config, $email, $invoice, $total ) = @_; + $email = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $email, From => $config->{company_email}, @@ -707,6 +714,7 @@ # configured per reseller. sub email_low_balance() { my ( $astpp_db, $reseller,$config, $email, $balance ) = @_; + $email = $config->{company_email} if $config->{user_email} == 0; my %mail = ( To => $email, From => $config->{company_email}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |