invoice DID summary performance enhancement, RT10886
[freeside.git] / FS / FS / svc_phone.pm
index deb12c2..19bef94 100644 (file)
@@ -79,14 +79,6 @@ Voicemail PIN
 
 Optional svcnum from svc_pbx
 
-=item route
-
-Route id/number
-
-=item gwlist
-
-OpenSIPS dr_rules gwlist - OpenSIPS dynamic routing
-
 =item forwarddst
 
 Forwarding destination
@@ -179,10 +171,6 @@ sub table_info {
                            disable_inventory => 1,
                            disable_select    => 1,
                          },
-       'route' => {    label => 'Route',
-                       %dis2, 
-                   },
-       'gwlist' => { label => 'OpenSIPS gwlist', %dis2 },
        'forwarddst' => {       label => 'Forward Destination', 
                                %dis2,
                        },
@@ -482,8 +470,6 @@ sub check {
     || $self->ut_foreign_keyn('pbxsvc', 'svc_pbx',    'svcnum' )
     || $self->ut_foreign_keyn('domsvc', 'svc_domain', 'svcnum' )
     || $self->ut_foreign_keyn('locationnum', 'cust_location', 'locationnum')
-    || $self->ut_textn('route')
-    || $self->ut_textn('gwlist')
     || $self->ut_numbern('forwarddst')
     || $self->ut_textn('email')
     || $self->ut_numbern('lrn')
@@ -741,7 +727,8 @@ sub get_cdrs {
       'table'      => 'cdr',
       'hashref'    => \%hash,
       'extra_sql'  => $extra_sql,
-      'order_by'   => "ORDER BY startdate $for_update",
+      'order_by'   => $options{'billsec_sum'} ? '' : "ORDER BY startdate $for_update",
+      'select'     => $options{'billsec_sum'} ? 'sum(billsec) as billsec_sum' : '*',
     } );
 
   @cdrs;