Changeset 1612

Show
Ignore:
Timestamp:
04/16/06 15:23:06 (7 years ago)
Author:
mheydon1973
Message:

Added option to General Settings to allow anonymous SIP calls with a huge warning about it's use and still defaulted to off

I know that some think this is a bad idea, but it was creating way to many support issues on IRC and it even caught me out this weekend too !

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/astetc/extensions.conf

    r1604 r1612  
    515515;give external sip users congestion and hangup 
    516516exten => _X.,1,Goto(s,1) 
    517 exten => s,1,Set(TIMEOUT(absolute)=15) 
     517exten => s,1,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})}) 
     518exten => s,n,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?from-trunk,${DID},1) 
     519exten => s,n,Set(TIMEOUT(absolute)=15) 
    518520exten => s,n,Answer 
    519521exten => s,n,Wait(2) 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.general.php

    r1488 r1612  
    2424            array($_REQUEST['DIAL_OPTIONS'],'DIAL_OPTIONS'), 
    2525            array($_REQUEST['TONEZONE'], 'TONEZONE'), 
     26            array($_REQUEST['ALLOW_SIP_ANON'], 'ALLOW_SIP_ANON'), 
    2627            array(isset($_REQUEST['DIRECTORY_OPTS']) ? $_REQUEST['DIRECTORY_OPTS'] : "",'DIRECTORY_OPTS'), 
    2728            ); 
     
    120121    ?> 
    121122</p> 
     123<h5><?php echo _("Security Settings")?></h5> 
     124<p> 
     125  <a href=# class="info"><?php echo _("Allow Anonymous Inbound SIP Calls?")?><span><br> 
     126<?php echo _("** WARNING **")?><br><br> 
     127<?php echo _("Setting this to 'yes' will potentially allow ANYBODY to call into your Asterisk server using the SIP protocol")?><br><br> 
     128<?php echo _("It should only be used if you fully understand the impact of allowing anonymous calls into your server")?><br> 
     129  </span></a> 
     130  <select name="ALLOW_SIP_ANON"> 
     131  <option value="<?php echo _("no"); ?>"><?php echo _("no"); ?></option> 
     132  <option <?php if ($ALLOW_SIP_ANON == "yes") echo "SELECTED "?>value="<?php echo _("yes"); ?>"><?php echo _("yes"); ?></option> 
     133  </select> 
     134</p> 
    122135<h6> 
    123136  <input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>"> 
  • freepbx/trunk/upgrades/2.1beta1/tables.php

    r1479 r1612  
    2424} 
    2525 
     26// Add default ALLOW_SIP_ANON of 'no' if no ALLOW_SIP_ANON exists already 
     27$sql = "SELECT value FROM globals WHERE variable = 'ALLOW_SIP_ANON' "; 
     28$asa = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
     29if (!is_array($asa)) { // does not exist already 
     30        // Default to 'no' 
     31        $sql = "INSERT INTO globals (variable, value) VALUES ('ALLOW_SIP_ANON', 'no') "; 
     32        $result = $db->query($sql); 
     33        if(DB::IsError($result)) { 
     34                die($result->getDebugInfo()); 
     35        } 
     36} 
     37 
    2638?>