| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
// returns a associative arrays with keys 'destination' and 'description' |
|---|
| 5 |
function pbdirectory_destinations() { |
|---|
| 6 |
|
|---|
| 7 |
$extens[] = array('destination' => 'app-pbdirectory,pbdirectory,1', 'description' => 'Phonebook Directory'); |
|---|
| 8 |
return $extens; |
|---|
| 9 |
} |
|---|
| 10 |
|
|---|
| 11 |
function pbdirectory_getdestinfo($dest) { |
|---|
| 12 |
global $active_modules; |
|---|
| 13 |
|
|---|
| 14 |
if (trim($dest) == 'app-pbdirectory,pbdirectory,1') { |
|---|
| 15 |
|
|---|
| 16 |
return array('description' => _("Phonebook Directory"), |
|---|
| 17 |
'edit_url' => false, |
|---|
| 18 |
); |
|---|
| 19 |
} else { |
|---|
| 20 |
return false; |
|---|
| 21 |
} |
|---|
| 22 |
} |
|---|
| 23 |
|
|---|
| 24 |
function pbdirectory_get_config($engine) { |
|---|
| 25 |
$modulename = 'pbdirectory'; |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
global $ext; |
|---|
| 29 |
switch($engine) { |
|---|
| 30 |
case "asterisk": |
|---|
| 31 |
$fcc = new featurecode('pbdirectory', 'app-pbdirectory'); |
|---|
| 32 |
$code = $fcc->getCodeActive(); |
|---|
| 33 |
unset($fcc); |
|---|
| 34 |
|
|---|
| 35 |
if (!empty($code)) { |
|---|
| 36 |
$ext->add('app-pbdirectory', $code, '', new ext_goto(1,'pbdirectory')); |
|---|
| 37 |
} |
|---|
| 38 |
|
|---|
| 39 |
$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_answer()); |
|---|
| 40 |
$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_wait(1)); |
|---|
| 41 |
$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_macro('user-callerid')); |
|---|
| 42 |
$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_agi('pbdirectory')); |
|---|
| 43 |
$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_gotoif('$["${dialnumber}"=""]','hangup,1')); |
|---|
| 44 |
$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_noop('Got number to dial: ${dialnumber}')); |
|---|
| 45 |
$ext->add('app-pbdirectory', 'pbdirectory', '', new ext_dial('Local/${dialnumber}@from-internal/n','','')); |
|---|
| 46 |
$ext->add('app-pbdirectory', 'hangup', '', new ext_hangup()); |
|---|
| 47 |
|
|---|
| 48 |
$ext->addInclude('from-internal-additional', 'app-pbdirectory'); |
|---|
| 49 |
|
|---|
| 50 |
break; |
|---|
| 51 |
} |
|---|
| 52 |
} |
|---|
| 53 |
|
|---|
| 54 |
?> |
|---|
| 55 |
|
|---|