Changeset 7567

Show
Ignore:
Timestamp:
03/31/09 10:45:50 (4 years ago)
Author:
xrobau
Message:

Righto. NOW it seems to be working, missed a couple of little things. Please test!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • contributed_modules/modules/routepermissions/agi-bin/checkperms.agi

    r7566 r7567  
    2828if (!isset($cidnum) || !is_numeric($cidnum)) { 
    2929  debug("CallerID not Parseable - received $cidnum - exiting with DENY",1); 
    30   $AGI->goto('barred'); 
     30  $AGI->exec_goto("macro-trunk-dial", "barred", "1"); 
    3131  exit; 
    3232} 
     
    3939$res = sql("SELECT allowed FROM routepermissions WHERE exten='$cidnum' and routename='$routename'", "getRow"); 
    4040if ($res[0] === "NO") { 
    41   $AGI->goto('barred'); 
     41  $AGI->exec_goto("macro-trunk-dial", "barred", "1"); 
    4242  exit; 
    4343} 
  • contributed_modules/modules/routepermissions/module.xml

    r7560 r7567  
    66  <canuninstall>yes</canuninstall> 
    77  <changelog> 
    8     *0.1.0.0* Start Development 
     8    *0.1.0.0* Original Release 
    99  </changelog> 
    1010  <description> 
  • contributed_modules/modules/routepermissions/page.routepermissions.php

    r7564 r7567  
    5757   
    5858  <tr><td colspan=2><span id="instructions"> 
     59  <p><h3>Instructions</h3></p> 
     60  <p>This module allows you to block access to certain routes from specified extensions. You can do bulk changes on this page, 
     61  and you can individually change access to routes on the extension's page.</p> 
     62  <p>Note that Asterisk is incapable of having two identical routes and trying to force calls to use the other route if 
     63  one of them is banned by this module. <b>It will not work.</b> You must have unique outbound routes for the proper selection 
     64  to work</p>  
    5965<?php 
    6066  echo "<p><h3>"._("Bulk Changes"); echo "</h3></p> "; 
     
    8086 
    8187function rp_allow($route, $range) { 
    82   $rangearray = rp_range($range); 
    8388  $extens = rp_get_extens(); 
    84   foreach ($rangearray as $r) { 
    85     if ($extens[$r] == "ok") { 
     89  if ($range == "All") { 
     90    foreach ($extens as $r=>$foo) { 
    8691      rp_do($route, $r, "YES"); 
     92    } 
     93  } else { 
     94    $rangearray = rp_range($range); 
     95    foreach ($rangearray as $r) { 
     96      if ($extens[$r] == "ok") { 
     97        rp_do($route, $r, "YES"); 
     98      } 
    8799    } 
    88100  } 
     
    90102 
    91103function rp_deny($route, $range) { 
    92   $rangearray = rp_range($range); 
    93104  $extens = rp_get_extens(); 
    94   foreach ($rangearray as $r) { 
    95     if ($extens[$r] === "ok") { 
     105  if ($range == "All") { 
     106    foreach ($extens as $r=>$foo) { 
    96107      rp_do($route, $r, "NO"); 
     108    } 
     109  } else { 
     110    $rangearray = rp_range($range); 
     111    foreach ($rangearray as $r) { 
     112      if ($extens[$r] == "ok") { 
     113        rp_do($route, $r, "NO"); 
     114      } 
    97115    } 
    98116  }