[Astpp-commit] SF.net SVN: astpp:[2214] trunk
Brought to you by:
darrenkw
|
From: <dar...@us...> - 2008-12-02 03:35:42
|
Revision: 2214
http://astpp.svn.sourceforge.net/astpp/?rev=2214&view=rev
Author: darrenkw
Date: 2008-12-02 03:35:36 +0000 (Tue, 02 Dec 2008)
Log Message:
-----------
Repair the thirdlane DID billing handling.
Modified Paths:
--------------
trunk/astpp-common.pl
trunk/contrib/auto_dialer/aleph-autocall.pl
Modified: trunk/astpp-common.pl
===================================================================
--- trunk/astpp-common.pl 2008-12-02 02:39:15 UTC (rev 2213)
+++ trunk/astpp-common.pl 2008-12-02 03:35:36 UTC (rev 2214)
@@ -1732,7 +1732,7 @@
}
elsif ($config->{thirdlane_mods} == 1 && $type =~ m/.\d\d\d-IN/) {
print STDERR "Call belongs to a Thirdlane(tm) DID.\n";
- $destination = $type =~ s/-IN//g;
+ ($destination = $type) =~ s/-IN//g;
print STDERR "Destination: $destination \n";
$record = &get_did_reseller($astpp_db,$destination,$carddata->{reseller}) if $carddata->{reseller} ne "";
$record = &get_did($astpp_db,$destination) if $carddata->{reseller} eq "";
@@ -4116,17 +4116,17 @@
print STDERR gettext("Processing Uniqueid: ") . $uniqueid . "\n";
$cdrinfo = ($vars) ? $vars : &get_cdr( $config, $cdr_db,$cdr_table, $uniqueid );
my $savedcdrinfo = $cdrinfo;
- if(!$vars) {
- my $tmp = "UPDATE $cdr_table SET cost = 'rating' WHERE uniqueid = "
- . $cdr_db->quote($uniqueid)
- . " AND cost = 'none'"
- . " AND dst = "
- . $cdr_db->quote($cdrinfo->{dst})
- . " LIMIT 1";
- $cdr_db->do($tmp);
- } else {
- $cdrinfo->{'cost'} = 'rating';
- }
+# if(!$vars) {
+# my $tmp = "UPDATE $cdr_table SET cost = 'rating' WHERE uniqueid = "
+# . $cdr_db->quote($uniqueid)
+# . " AND cost = 'none'"
+# . " AND dst = "
+# . $cdr_db->quote($cdrinfo->{dst})
+# . " LIMIT 1";
+# $cdr_db->do($tmp);
+# } else {
+# $cdrinfo->{'cost'} = 'rating';
+# }
if ( $cdrinfo->{accountcode} ) {
my $carddata = &get_account( $astpp_db, $cdrinfo->{accountcode} );
if ($carddata->{number}) {
@@ -4145,7 +4145,7 @@
print STDERR "----------------------\n";
}
elsif ( $cdrinfo->{accountcode} ) {
- $status = &rating( $astpp_db, $cdr_db, $config, $cdrinfo, $carddata, $vars);
+ $status = &rating( $astpp_db, $cdr_db,$cdr_table, $config, $cdrinfo, $carddata, $vars);
$cdrinfo = &get_cdr( $config, $cdr_db,$cdr_table, $uniqueid ) if !$vars;
if ( $status == 1 ) {
my $previous_account = $carddata->{number};
@@ -4153,7 +4153,7 @@
$cdrinfo = &get_cdr( $config, $cdr_db,$cdr_table, $uniqueid ) if !$vars;
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, $vars);
+ $status = &rating( $astpp_db, $cdr_db, $cdr_table,$config, $cdrinfo, $carddata, $vars);
my $tmp = "SELECT id FROM cdrs WHERE uniqueid = '" . $uniqueid
. "' AND cardnum = '" . $previous_account . "' LIMIT 1";
print STDERR "$tmp\n" if $config->{debug} == 1;
Modified: trunk/contrib/auto_dialer/aleph-autocall.pl
===================================================================
--- trunk/contrib/auto_dialer/aleph-autocall.pl 2008-12-02 02:39:15 UTC (rev 2213)
+++ trunk/contrib/auto_dialer/aleph-autocall.pl 2008-12-02 03:35:36 UTC (rev 2214)
@@ -125,22 +125,20 @@
}
sub perform_callout() {
- my ($number) = @_;
- my $out = new Asterisk::Outgoing;
- my $channel = "Local\/" . $number->{number} . "\@$config->{destcontext}";
- $out->setvariable( 'Channel', $channel );
- $out->setvariable( 'MaxRetries', $config->{maxretries} );
- $out->setvariable( 'RetryTime', 60 );
- $out->setvariable( 'WaitTime', 60 );
-# $out->setvariable( "context", $config->{context} );
-# $out->setvariable( "extension", $number );
+ my ($number) = @_;
+ my $out = new Asterisk::Outgoing;
+ my $channel = "Local\/" . $number->{number} . "\@$config->{destcontext}";
+ $out->setvariable( 'Channel', $channel );
+ $out->setvariable( 'MaxRetries', $config->{maxretries} );
+ $out->setvariable( 'RetryTime', 60 );
+ $out->setvariable( 'WaitTime', 60 );
$out->setvariable( 'Application', "DeadAGI");
$out->setvariable( 'Data', "aleph-aac.agi|" . $number->{id});
$out->setvariable( "CallerID",
"<$number->{clidname}> $number->{clidnumber}" );
- $out->setvariable( "Account", "$number->{accountcode}" );
- $out->outtime( time() + 15 );
- $out->create_outgoing;
+ $out->setvariable( "Account", "$number->{accountcode}" );
+ $out->outtime( time() + 15 );
+ $out->create_outgoing;
print STDERR "Created Call to: $number->{number}\n";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|