[Astpp-commit] SF.net SVN: astpp:[2230] trunk
Brought to you by:
darrenkw
From: <dar...@us...> - 2009-02-01 02:22:11
|
Revision: 2230 http://astpp.svn.sourceforge.net/astpp/?rev=2230&view=rev Author: darrenkw Date: 2009-02-01 01:41:41 +0000 (Sun, 01 Feb 2009) Log Message: ----------- Corrected the code for viewing booths. Modified Paths: -------------- trunk/scripts/astpp-common.pl trunk/web_interface/astpp-admin.cgi Modified: trunk/scripts/astpp-common.pl =================================================================== --- trunk/scripts/astpp-common.pl 2009-02-01 00:59:00 UTC (rev 2229) +++ trunk/scripts/astpp-common.pl 2009-02-01 01:41:41 UTC (rev 2230) @@ -1502,11 +1502,11 @@ # Select all the unbilled CDRS belonging to a specific account. This is mostly used by booths. sub list_cdrs_account() { - my ( $config, $cdr_db, $account, $cc ) = @_; + my ( $cdr_db,$config, $account, $cc ) = @_; my ( $sql, @cdrlist, $row ); - $sql = - $cdr_db->prepare( - "SELECT * FROM $config->{asterisk_cdr_table} WHERE cost IN ('none', 'error') AND accountcode IN (" . $cdr_db->quote($account) . ", " . $cdr_db->quote($cc) . ") AND disposition REGEXP 'ANSWE.*'"); + my $tmp = "SELECT * FROM $config->{asterisk_cdr_table} WHERE cost IN ('none', 'error') AND accountcode IN (" . $cdr_db->quote($account) . ", " . $cdr_db->quote($cc) . ") AND disposition REGEXP 'ANSWE.*'"; + print STDERR $tmp ."\n" if $config->{debug} == 1; + $sql = $cdr_db->prepare($tmp); $sql->execute; while ( $row = $sql->fetchrow_hashref ) { push @cdrlist, $row->{uniqueid}; Modified: trunk/web_interface/astpp-admin.cgi =================================================================== --- trunk/web_interface/astpp-admin.cgi 2009-02-01 00:59:00 UTC (rev 2229) +++ trunk/web_interface/astpp-admin.cgi 2009-02-01 01:41:41 UTC (rev 2230) @@ -9638,6 +9638,16 @@ $params->{secret}, $params->{context}, $number, $params ); $status .= "<br>"; } + if ( $config->{users_dids_freeswitch} == 1 ) { + my $name = + &finduniquesip_freeswitch( $fs_db, $config, + $params->{number} ); + $status .= + &add_sip_user_freeswitch( $fs_db, $config, $name, + $params->{accountpassword}, + $params->{number}, $params, $accountinfo->{cc} ); + $status .= "<br>"; + } $params->{action} = gettext("Information..."); } elsif ( $params->{action} eq gettext("Delete...") ) { @@ -11006,6 +11016,16 @@ $params->{context}, $params->{number}, $params ); $status .= "<br>"; } + if ( $config->{users_dids_freeswitch} == 1 ) { + my $name = + &finduniquesip_freeswitch( $fs_db, $config, + $params->{number} ); + $status .= + &add_sip_user_freeswitch( $fs_db, $config, $name, + $params->{accountpassword}, + $params->{number}, $params, $accountinfo->{cc} ); + $status .= "<br>"; + } } if ( $params->{IAX2} ) { $ASTPP->debug( @@ -11373,7 +11393,7 @@ } sub build_view_booth() { - my ( $config, $sql, @cdrs, $sip_login, $iax2_login ); + my ( $sql, @cdrs, $sip_login, $iax2_login ); # Prepare the booth list for the menu. @booth_list = @@ -11473,7 +11493,7 @@ $sql->finish; } my @chargelist = - &list_cdrs_account( $config, $cdr_db, $accountinfo->{number}, + &list_cdrs_account( $cdr_db,$config, $accountinfo->{number}, $accountinfo->{cc} ); &processlist( $astpp_db, $cdr_db, $config, $config->{asterisk_cdr_table}, @@ -11523,10 +11543,12 @@ push( @cdrs, $record ); } } + my $template = HTML::Template->new( filename => '/var/lib/astpp/templates/booth-view.tpl', die_on_bad_params => $config->{template_die_on_bad_params} ); + $template->param( booth_name => $params->{booth_name} ); my $balance = &accountbalance( $astpp_db, $params->{booth_name} ) / 10000; my $unrated = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |