Skip to content

Commit

Permalink
FREEPBX-12753 make cache ignore default cnam
Browse files Browse the repository at this point in the history
  • Loading branch information
jfinstrom authored and tm1000 committed Jul 27, 2016
1 parent 27e9d43 commit 7319437
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions sources/source-Superfecta_Cache.module
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ class Superfecta_Cache extends superfecta_base {
'default' => 120
),
'CID_Exclusion_Rules' => array(
'description' => 'Incoming calls with CID matching the patterns specified here will not be cached. If this is
'description' => 'Incoming calls with CID matching the patterns specified here will not be cached. If this is
left blank, all CIDs will be cached. <br />
<br /><b>Rules:</b><br />
<strong>X</strong>&nbsp;&nbsp;&nbsp; matches any digit from 0-9<br />
<strong>Z</strong>&nbsp;&nbsp;&nbsp; matches any digit from 1-9<br />
<strong>N</strong>&nbsp;&nbsp;&nbsp; matches any digit from 2-9<br />
<strong>[1237-9]</strong>&nbsp; matches any digit or letter in the brackets (in this
example, 1,2,3,7,8,9)<br />
<strong>.</strong>&nbsp;&nbsp;&nbsp; wildcard, matches one or more characters (not
allowed before a | or +)<br />
<strong>|</strong>&nbsp;&nbsp;&nbsp; removes a dialing prefix from the number (for
example, 613|NXXXXXX would match when some one dialed "6135551234" but would only
<br /><b>Rules:</b><br />
<strong>X</strong>&nbsp;&nbsp;&nbsp; matches any digit from 0-9<br />
<strong>Z</strong>&nbsp;&nbsp;&nbsp; matches any digit from 1-9<br />
<strong>N</strong>&nbsp;&nbsp;&nbsp; matches any digit from 2-9<br />
<strong>[1237-9]</strong>&nbsp; matches any digit or letter in the brackets (in this
example, 1,2,3,7,8,9)<br />
<strong>.</strong>&nbsp;&nbsp;&nbsp; wildcard, matches one or more characters (not
allowed before a | or +)<br />
<strong>|</strong>&nbsp;&nbsp;&nbsp; removes a dialing prefix from the number (for
example, 613|NXXXXXX would match when some one dialed "6135551234" but would only
pass "5551234" to the Superfecta look up.)<br />
<strong>+</strong>&nbsp;&nbsp;&nbsp; adds a dialing prefix to the number (for
example, 1613+NXXXXXX would match when someone dialed "5551234"
and would pass "16135551234" to the Superfecta look up.)<br /><br />
<strong>+</strong>&nbsp;&nbsp;&nbsp; adds a dialing prefix to the number (for
example, 1613+NXXXXXX would match when someone dialed "5551234"
and would pass "16135551234" to the Superfecta look up.)<br /><br />

You can also use both + and |, for example: 01+0|1ZXXXXXXXXX would match
"016065551234" and dial it as "0116065551234" Note that the order does not matter, eg.
You can also use both + and |, for example: 01+0|1ZXXXXXXXXX would match
"016065551234" and dial it as "0116065551234" Note that the order does not matter, eg.
0|01+1ZXXXXXXXXX does the same thing.',
'type' => 'textarea'
)
Expand Down Expand Up @@ -79,7 +79,9 @@ class Superfecta_Cache extends superfecta_base {
//People might not have anything in Exclusion Rules, account for this
$run_param['CID_Exclusion_Rules'] = isset($run_param['CID_Exclusion_Rules']) ? $run_param['CID_Exclusion_Rules'] : '';
$rule_match = $this->match_pattern_all(!empty($run_param['CID_Exclusion_Rules']) ? $run_param['CID_Exclusion_Rules'] : '', $thenumber);

if($first_caller_id === "CID Superfecta"){
return;
}
if ((!$rule_match['status']) || (!$rule_match['number'])) {
if (!$cache_found && ($first_caller_id != '')) {
$sql = "REPLACE INTO superfectacache (number,callerid,dateentered)
Expand Down

0 comments on commit 7319437

Please sign in to comment.