[freeside-commits] branch FREESIDE_3_BRANCH updated. e2a259accc043578fb16dac20043f4b9a05f94e6

Mark Wells mark at 420.am
Tue Jun 14 10:31:20 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  e2a259accc043578fb16dac20043f4b9a05f94e6 (commit)
      from  092526ed67705660e1fb0ac12ed93753310171e3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e2a259accc043578fb16dac20043f4b9a05f94e6
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jun 14 10:30:50 2016 -0700

    option to rewrite certain "international" calls into domestic calls, #71004

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index c7bf65f..e1b2db8 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5314,6 +5314,13 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'cdr-intl_to_domestic_rewrite',
+    'section'     => 'telephony',
+    'description' => 'Strip the "011" international prefix from CDR destination numbers if the rest of the number is 7 digits or shorter, and so probably does not contain a country code.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'cdr-gsm_tap3-sender',
     'section'     => 'telephony',
     'description' => 'GSM TAP3 Sender network (5 letter code)',
diff --git a/FS/bin/freeside-cdrrewrited b/FS/bin/freeside-cdrrewrited
index 16f931f..0087590 100644
--- a/FS/bin/freeside-cdrrewrited
+++ b/FS/bin/freeside-cdrrewrited
@@ -198,6 +198,12 @@ while (1) {
 
     }
 
+    if ( $conf->exists('cdr-intl_to_domestic_rewrite') and
+         $cdr->dst =~ /^(011)(\d{0,7})$/ ) {
+      $cdr->dst($2);
+      push @status, 'intl_to_domestic';
+    }
+
     $cdr->freesiderewritestatus(
       scalar(@status) ? join('/', @status) : 'skipped'
     );
@@ -233,6 +239,7 @@ sub _shouldrun {
   || $conf->exists('cdr-charged_party_rewrite')
   || $conf->exists('cdr-taqua-accountcode_rewrite')
   || $conf->exists('cdr-taqua-callerid_rewrite')
+  || $conf->exists('cdr-intl_to_domestic_rewrite')
   || 0
   ;
 }
@@ -252,8 +259,44 @@ freeside-cdrrewrited - Real-time daemon for CDR rewriting
 =head1 DESCRIPTION
 
 Runs continuously, searches for CDRs and does forwarded-call rewriting if any
-of the "cdr-asterisk_forward_rewrite", "cdr-charged_party_rewrite" or
-"cdr-taqua-accountcode_rewrite" config options are enabled.
+of the following config options are enabled:
+
+=over 4
+
+=item cdr-asterisk_australia_rewrite
+
+Classifies Australian numbers as domestic, mobile, tollfree, international, or
+"other", and tries to assign a cdrtypenum based on that.
+
+=item cdr-asterisk_forward_rewrite
+
+Identifies Asterisk forwarded calls using the 'dstchannel' field. If the
+dstchannel is "Local/" followed by a number, but the number doesn't match the
+dst field, the dst field will be rewritten to match.
+
+=item cdr-charged_party_rewrite
+
+Calls set_charged_party on all calls.
+
+=item cdr-taqua-accountcode_rewrite
+
+=item cdr-taqua-callerid_rewrite
+
+These actually have the same effect. Taqua uses cdrtypenum = 1 to tag accessory
+records. They will have "sessionnum" = that of the primary record, and
+"lastapp" indicating their function:
+
+- "acctcode": "lastdata" contains the dialed account code. Insert this into the
+accountcode field of the primary record.
+
+- "CallerId": "lastdata" contains "allowed" or "restricted". If "restricted"
+then the clid field of the primary record is set to "PRIVATE".
+
+=item cdr-intl_to_domestic_rewrite
+
+Finds records where the destination number has the "011" international prefix,
+but with seven or fewer digits in the rest of the number, and strips the "011"
+prefix so that they will be treated as domestic calls. This is very uncommon.
 
 =head1 SEE ALSO
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Conf.pm               |    7 +++++++
 FS/bin/freeside-cdrrewrited |   47 +++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 52 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list