Index: /usr/src/FreePBX/freepbx_2.6/amp_conf/htdocs/recordings/includes/main.conf.php =================================================================== --- /usr/src/FreePBX/freepbx_2.6/amp_conf/htdocs/recordings/includes/main.conf.php (revision 8400) +++ /usr/src/FreePBX/freepbx_2.6/amp_conf/htdocs/recordings/includes/main.conf.php (arbetskopia) @@ -201,6 +201,16 @@ $CALLMONITOR_ONLY_EXACT_MATCHING = 0; ############################### +# phone feature page settings +############################### +# +# Disallowed callforward numbers +# Numbers that begin with the following will not be allowed +# Here you can enter 00 for overseas calls etc. +# +$NOT_ALLOWED_CALLFORWARD_NUMBERS = array('011'); + +############################### # conference page settings ############################### # Index: /usr/src/FreePBX/freepbx_2.6/amp_conf/htdocs/recordings/modules/phonefeatures.module =================================================================== --- /usr/src/FreePBX/freepbx_2.6/amp_conf/htdocs/recordings/modules/phonefeatures.module (revision 8400) +++ /usr/src/FreePBX/freepbx_2.6/amp_conf/htdocs/recordings/modules/phonefeatures.module (arbetskopia) @@ -317,6 +317,7 @@ function storeCallForwardNumber( $args, $exten, $callFwdType, $databaseCallFwdType) { + global $NOT_ALLOWED_CALLFORWARD_NUMBERS; $call_forward_enable = getArgument($args, $callFwdType . '_enable'); $call_forward_number = getArgument($args, $callFwdType . '_number'); @@ -327,6 +328,17 @@ sprintf(_("Number %s must contain dial numbers (characters like '(', '-', and ')' are ok)"), $call_forward_number); } else { + // Check if the number is allowed + if (!empty($NOT_ALLOWED_CALLFORWARD_NUMBERS)){ + foreach ($NOT_ALLOWED_CALLFORWARD_NUMBERS as $nogo){ + if (substr($stripped_call_forward_number, 0, strlen($nogo)) == $nogo){ + $_SESSION['ari_error'] = _("Call forward number not changed") . "
" . + _("Call forward number not allowed"); + return; + } + } + } + $this->setCallForward( $exten, $call_forward_enable, $stripped_call_forward_number, $databaseCallFwdType); // store cookie