diff options
author | Mark Wells <mark@freeside.biz> | 2012-03-08 13:37:53 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2012-03-08 13:38:33 -0800 |
commit | a5fba19707ec1a01db18fa55862e742170feccdf (patch) | |
tree | 66eb6e525959474e3392c12924ba95bad98b6a6e /FS/FS/svc_pbx.pm | |
parent | 2e7f1e27ead9a8837b5516e2cd2e1795d51e5ee1 (diff) |
match CDRs to services by IP address, #16723
Diffstat (limited to 'FS/FS/svc_pbx.pm')
-rw-r--r-- | FS/FS/svc_pbx.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/FS/FS/svc_pbx.pm b/FS/FS/svc_pbx.pm index 37ab174..f8b9605 100644 --- a/FS/FS/svc_pbx.pm +++ b/FS/FS/svc_pbx.pm @@ -283,6 +283,10 @@ with the chosen prefix. =item by_svcnum => 1: Select CDRs where the svcnum field matches, instead of title/charged_party. Normally this field is set after processing. +=item by_ip_addr => 'src' or 'dst': Select CDRs where the src_ip_addr or +dst_ip_addr field matches title. In this case, some special logic is applied +to allow title to indicate a range of IP addresses. + =item begin, end: Start and end of date range, as unix timestamp. =item cdrtypenum: Only return CDRs with this type number. @@ -309,6 +313,10 @@ sub get_cdrs { if ( $options{'by_svcnum'} ) { $hash{'svcnum'} = $self->svcnum; } + elsif ( $options{'by_ip_addr'} =~ /^src|dst$/) { + my $field = 'cdr.'.$options{'by_ip_addr'}.'_ip_addr'; + push @where, FS::cdr->ip_addr_sql($field, $self->title); + } else { #matching by title my $title = $self->title; |