X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_phone.cgi;h=6e40fea54d0a3036a48a3e9b679bf9a879c6b7d9;hb=b5c4237a34aef94976bc343c8d9e138664fc3984;hp=433ea1761ab32cd80eeb9e763be3cad25bd556af;hpb=80fa5a2f42e60bede178ff1118e7c7532fced9a5;p=freeside.git diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi index 433ea1761..6e40fea54 100644 --- a/httemplate/view/svc_phone.cgi +++ b/httemplate/view/svc_phone.cgi @@ -19,7 +19,7 @@ my %labels = map { $_ => ( ref($fields->{$_}) my @fields = qw( countrycode phonenum ); push @fields, 'domain' if $conf->exists('svc_phone-domain'); -push @fields, qw( pbx_title sip_password pin phone_name route gwlist forwarddst email ); +push @fields, qw( pbx_title sip_password pin phone_name forwarddst email ); if ( $conf->exists('svc_phone-lnp') ) { push @fields, 'lnp_status', @@ -135,21 +135,30 @@ 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";