X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_phone.cgi;h=f848f93e0eb011e734fed53dd723161b3db31c30;hb=143ea0473ca61fa5e2d7eea4da3d6b63505cacec;hp=e4dc335ca29304976f06161490eade0f12cce7f5;hpb=17fb1dfa5d5e5d9dec1cc57fee2c34835ccb4a77;p=freeside.git
diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi
index e4dc335ca..f848f93e0 100644
--- a/httemplate/view/svc_phone.cgi
+++ b/httemplate/view/svc_phone.cgi
@@ -135,21 +135,29 @@ my $html_foot = sub {
unless $svc_phone->countrycode eq '1';
#src & charged party as per voip_cdr.pm
- my $search;
+ #XXX handle toll free too
+
+ my $search = "charged_party_or_src=";
+
my $cust_pkg = $svc_phone->cust_svc->cust_pkg;
- if ( $cust_pkg && $cust_pkg->part_pkg->option('disable_src') ) {
- $search = "charged_party=$number";
- } else {
- $search = "charged_party_or_src=$number";
+
+ if ( $cust_pkg ) {
+
+ #XXX handle voip_inbound too
+
+ my @part_pkg = grep { $_->plan eq 'voip_cdr' }
+ $cust_pkg->part_pkg->self_and_bill_linked;
+
+ foreach my $prefix (grep $_, map $_->option('default_prefix'), @part_pkg) {
+ $number .= ",$prefix$number";
+ }
+
+ $search = 'charged_party='
+ unless !@part_pkg || grep { ! $_->option('disable_src',1) } @part_pkg;
}
- #XXX default prefix as per voip_cdr.pm
- #XXX handle toll free too
+ $search .= $number;
- #my @links = map {
- # qq().
- # "View $_ CDRs";
- #} keys(%what);
my @links = map {
qq().
"View $_ CDRs";