diff options
author | Mark Wells <mark@freeside.biz> | 2016-02-27 19:13:54 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-02-27 19:23:53 -0800 |
commit | fd6aec2041579fbb5d790371c5e5e5152e3075ce (patch) | |
tree | 4665fda82448418d57bd97b6b9e212bd11b2f227 /FS/FS/svc_acct.pm | |
parent | 5ebeeda12a588c1db792fcc8954aeeedb54a84b2 (diff) |
sipwise export, part 3, #40097
Diffstat (limited to 'FS/FS/svc_acct.pm')
-rw-r--r-- | FS/FS/svc_acct.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 67fce41..8283e6f 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -2319,8 +2319,8 @@ sub last_login_text { Returns a paged search (L<FS::PagedSearch>) for Call Detail Records associated with this service. For svc_acct, "associated with" means that -either the "src" or the "charged_party" field of the CDR matches the -"username" field of the service. +either the "src" or the "charged_party" field of the CDR matches either +the "username" field of the service or the username@domain label. =cut @@ -2331,6 +2331,7 @@ sub psearch_cdrs { my @where; my $did = dbh->quote($self->username); + my $diddomain = dbh->quote($self->label); my $prefix = $options{'default_prefix'} || ''; #convergent.au '+61' my $prefixdid = dbh->quote($prefix . $self->username); @@ -2346,12 +2347,16 @@ sub psearch_cdrs { if (!$options{'disable_charged_party'}) { push @orwhere, "charged_party = $did", - "charged_party = $prefixdid"; + "charged_party = $prefixdid", + "charged_party = $diddomain" + ; } if (!$options{'disable_src'}) { push @orwhere, "src = $did AND charged_party IS NULL", - "src = $prefixdid AND charged_party IS NULL"; + "src = $prefixdid AND charged_party IS NULL", + "src = $diddomain AND charged_party IS NULL" + ; } push @where, '(' . join(' OR ', @orwhere) . ')'; |