| 1 |
<?php |
|---|
| 2 |
//This file is part of FreePBX. |
|---|
| 3 |
// |
|---|
| 4 |
// FreePBX is free software: you can redistribute it and/or modify |
|---|
| 5 |
// it under the terms of the GNU General Public License as published by |
|---|
| 6 |
// the Free Software Foundation, either version 2 of the License, or |
|---|
| 7 |
// (at your option) any later version. |
|---|
| 8 |
// |
|---|
| 9 |
// FreePBX is distributed in the hope that it will be useful, |
|---|
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 |
// GNU General Public License for more details. |
|---|
| 13 |
// |
|---|
| 14 |
// You should have received a copy of the GNU General Public License |
|---|
| 15 |
// along with FreePBX. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 16 |
// |
|---|
| 17 |
// Copyright (C) 2005 qldrob |
|---|
| 18 |
// |
|---|
| 19 |
// TODO, is this needed...? |
|---|
| 20 |
// is this global...? what if we include this files |
|---|
| 21 |
// from a function...? |
|---|
| 22 |
|
|---|
| 23 |
global $astman; |
|---|
| 24 |
|
|---|
| 25 |
// Unconditional Call Forwarding |
|---|
| 26 |
$fcc = new featurecode('callforward', 'cfon'); |
|---|
| 27 |
$fcc->delete(); |
|---|
| 28 |
unset($fcc); |
|---|
| 29 |
|
|---|
| 30 |
$fcc = new featurecode('callforward', 'cfoff'); |
|---|
| 31 |
$fcc->delete(); |
|---|
| 32 |
unset($fcc); |
|---|
| 33 |
|
|---|
| 34 |
$fcc = new featurecode('callforward', 'cfoff_any'); |
|---|
| 35 |
$fcc->delete(); |
|---|
| 36 |
unset($fcc); |
|---|
| 37 |
|
|---|
| 38 |
// Call Forward on Busy |
|---|
| 39 |
$fcc = new featurecode('callforward', 'cfbon'); |
|---|
| 40 |
$fcc->delete(); |
|---|
| 41 |
unset($fcc); |
|---|
| 42 |
|
|---|
| 43 |
$fcc = new featurecode('callforward', 'cfboff'); |
|---|
| 44 |
$fcc->delete(); |
|---|
| 45 |
unset($fcc); |
|---|
| 46 |
|
|---|
| 47 |
$fcc = new featurecode('callforward', 'cfboff_any'); |
|---|
| 48 |
$fcc->delete(); |
|---|
| 49 |
unset($fcc); |
|---|
| 50 |
|
|---|
| 51 |
// Call Forward on No Answer/Unavailable (i.e. phone not registered) |
|---|
| 52 |
$fcc = new featurecode('callforward', 'cfuon'); |
|---|
| 53 |
$fcc->delete(); |
|---|
| 54 |
unset($fcc); |
|---|
| 55 |
|
|---|
| 56 |
$fcc = new featurecode('callforward', 'cfuoff'); |
|---|
| 57 |
$fcc->delete(); |
|---|
| 58 |
unset($fcc); |
|---|
| 59 |
|
|---|
| 60 |
$fcc = new featurecode('callforward', 'cf_toggle'); |
|---|
| 61 |
$fcc->delete(); |
|---|
| 62 |
unset($fcc); |
|---|
| 63 |
|
|---|
| 64 |
// remove all Call Forward options in effect on extensions |
|---|
| 65 |
if ($astman) { |
|---|
| 66 |
$astman->database_deltree('CF'); |
|---|
| 67 |
$astman->database_deltree('CFB'); |
|---|
| 68 |
$astman->database_deltree('CFU'); |
|---|
| 69 |
} else { |
|---|
| 70 |
fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]); |
|---|
| 71 |
} |
|---|
| 72 |
?> |
|---|