root/freepbx/trunk/upgrades/2.1beta1/tables.php

Revision 1612, 1.3 kB (checked in by mheydon1973, 7 years ago)

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 !

  • Property svn:mime-type set to text/html
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1 <?php
2
3 // Add default TONEZONE of 'us' if no TONEZONE exists already
4 $sql = "SELECT value FROM globals WHERE variable = 'TONEZONE' ";
5 $tz = $db->getRow($sql, DB_FETCHMODE_ASSOC);
6 if (!is_array($tz)) { // does not exist already
7         // Default to 'us'
8         $sql = "INSERT INTO globals (variable, value) VALUES ('TONEZONE', 'us') ";
9         $result = $db->query($sql);
10         if(DB::IsError($result)) {
11                 die($result->getDebugInfo());
12         }
13 }
14
15 // Add column 'channel' to incoming routing
16 $sql = "SELECT channel FROM incoming";
17 $check = $db->getRow($sql, DB_FETCHMODE_ASSOC);
18 if(DB::IsError($check)) {
19         $sql = "ALTER TABLE incoming ADD channel VARCHAR( 20 ) DEFAULT \"\"";
20         $result = $db->query($sql);
21         if(DB::IsError($result)) {
22                 die($result->getDebugInfo());
23         }
24 }
25
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);
29 if (!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
38 ?>
Note: See TracBrowser for help on using the browser.