[freeside-commits] freeside/FS/FS svc_phone.pm, 1.27, 1.28 svc_pbx.pm, 1.9, 1.10

Mark Wells mark at wavetail.420.am
Mon Oct 4 11:46:41 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv26258/FS/FS

Modified Files:
	svc_phone.pm svc_pbx.pm 
Log Message:
CDR matching by svcnum, RT#10044

Index: svc_phone.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_phone.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -w -d -r1.27 -r1.28
--- svc_phone.pm	27 Apr 2010 05:38:27 -0000	1.27
+++ svc_phone.pm	4 Oct 2010 18:46:39 -0000	1.28
@@ -547,6 +547,8 @@
 
 =item disable_src => 1: Only match on "charged_party", not "src".
 
+=item by_svcnum: not supported for svc_phone
+
 =back
 
 =cut

Index: svc_pbx.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_pbx.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -d -r1.9 -r1.10
--- svc_pbx.pm	29 Jun 2010 01:40:24 -0000	1.9
+++ svc_pbx.pm	4 Oct 2010 18:46:39 -0000	1.10
@@ -292,6 +292,9 @@
 
 =item disable_src => 1: No-op for svc_pbx CDR processing.
 
+=item by_svcnum => 1: Select CDRs where the svcnum field matches, instead of 
+title/charged_party.  Normally this field is set after processing.
+
 =back
 
 =cut
@@ -307,6 +310,11 @@
   
   my $for_update = $options{'for_update'} ? 'FOR UPDATE' : '';
 
+  if ( $options{'by_svcnum'} ) {
+    $hash{'svcnum'} = $self->svcnum;
+  }
+  else {
+    #matching by title
   my $title = $self->title;
 
   my $prefix = $options{'default_prefix'};
@@ -319,6 +327,7 @@
   }
 
   push @where, ' ( '. join(' OR ', @orwhere ). ' ) ';
+  }
 
   if ( $options{'begin'} ) {
     push @where, 'startdate >= '. $options{'begin'};
@@ -327,7 +336,8 @@
     push @where, 'startdate < '.  $options{'end'};
   }
 
-  my $extra_sql = ( keys(%hash) ? ' AND ' : ' WHERE ' ). join(' AND ', @where );
+  my $extra_sql = ( keys(%hash) ? ' AND ' : ' WHERE ' ). join(' AND ', @where )
+    if @where;
 
   my @cdrs =
     qsearch( {



More information about the freeside-commits mailing list