| 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 |
?> |
|---|