public function _showOptions($keys) { if (empty($keys)) { return 'None'; } $options = ''; foreach ($keys as $key) { $dest = numbering::getDestinationByNumber($key['number_id']); if ($dest) { $options .= '<p>Option ' . $key['digits'] . ' routes to ' . $dest->name . ' (' . get_class($dest) . ')</p>'; } else { $options .= '<p>The destination for option ' . $key['digits'] . ' was removed</p>'; } } if (empty($options)) { return 'None'; } else { $options = str_replace('\'', '', $options); return "<a title='Auto Attendant Options' tooltip='" . $options . "' class='addInfo' href='#'>" . count($keys) . '</a>'; } }
<?php echo form::open_section('Fax Autodetect'); ?> <div class="field"> <?php echo form::label(array('for' => 'fax[autodetect]', 'hint' => 'Enable fax autodetect on this number.', 'help' => 'If enabled, the system will attempt to autodetect inbound faxes and transfer to the chosen extension if the inbound fax tone is detected.'), 'Enable Autodetection:'); echo form::checkbox('fax[autodetect]'); ?> </div> <div class="field"> <?php echo form::label(array('for' => 'fax[autodetect_number]', 'hint' => 'Transfer to this number on fax autodetect.', 'help' => 'The system will attempt to transfer the call to this extension if fax autodetect is enabled and the inbound fax tone is detected.'), 'Autodetection Transfer Number:'); echo numbering::numbersDropdown(array('name' => 'fax[autodetect_number]', 'classType' => 'FaxProfileNumber', 'optGroups' => FALSE)); ?> </div> <?php echo form::close_section();
</div> <?php echo form::close_section(); ?> <?php echo form::open_section('Call Routing'); ?> <div class="field"> <?php echo form::label('number[location_id]', 'Location:'); echo locations::dropdown('number[location_id]'); ?> </div> <div class="field"> <?php echo form::label(array( 'for' => 'device[context_id]', 'hint' => 'Default outbound call context', 'help' => 'This field determines the phone numbers a user can call. All phone numbers and SIP trunks associated with the selected context can be dialed by this user.<BR><BR>Note that, in most cases, the user\'s device must authenticate in order for this to work. Note that if this is not set, the context for the default interface a call is received on is used instead.' ), 'Default Context:' ); ?> <?php echo numbering::selectContext('number[context_id]'); ?> </div> <?php echo form::close_section(); ?> <?php echo form::close(TRUE); ?> </div>
echo locations::dropdown(array('name' => 'sipinterface[registry][force_register_domain]', 'nullOption' => 'Auto (multitenant)', 'multitenancy' => FALSE)); ?> </div> <?php echo form::close_section(); ?> <?php echo form::open_section('Inbound Calls'); ?> <div class="field"> <?php echo form::label('sipinterface[context_id]', 'Default Incoming Context:'); echo numbering::selectContext(array('nullOption' => 'Auto (multitenant)', 'name' => 'sipinterface[context_id]', 'all' => TRUE), $sipinterface['context_id']); ?> </div> <?php echo form::close_section(); ?> <?php if (isset($views)) { echo subview::renderAsSections($views); } ?> <?php echo form::close(TRUE);
</div> <?php echo form::close_section(); ?> <?php echo form::open_section('Call Routing'); ?> <div class="field"> <?php echo form::label(array('for' => 'device[context_id]', 'hint' => 'Default outbound call context', 'help' => 'This field determines the phone numbers a user can call. All phone numbers and SIP trunks associated with the selected context can be dialed by this user.<BR><BR>Note that, in most cases, the user\'s device must authenticate in order for this to work. Note that if this is not set, the context for the default interface a call is received on is used instead.'), 'Outbound Context:'); ?> <?php echo numbering::selectContext('device[context_id]'); ?> </div> <div class="field"> <?php echo form::label('device[registry][anonymous_reject]', 'Reject Anonymous Calls'); ?> <?php echo form::checkbox('device[registry][anonymous_reject]'); ?> </div> <?php echo form::close_section(); ?>
</div> <?php echo form::close_section(); ?> <?php echo form::open_section('Dial by Extension'); ?> <div class="field"> <?php echo form::label(array('for' => 'autoattendant[extension_context_id]', 'hint' => 'Numbers that callers can directly dial into'), 'Internal Extension Context:'); ?> <?php echo numbering::selectContext(array('name' => 'autoattendant[extension_context_id]', 'nullOption' => 'Disabled')); ?> </div> <div class="field"> <?php echo form::label('autoattendant[extension_digits]', 'Maximum Extension Length:'); ?> <?php echo form::input('autoattendant[extension_digits]'); ?> <?php //javascript::codeBlock('$("#autoattendant_extension_digits").spinner({max: 9, min: 3});'); ?> </div>
echo locations::dropdown(array('name' => 'sipinterface[registry][force_register_domain]', 'nullOption' => 'None', 'multitenancy' => FALSE)); ?> </div> <?php echo form::close_section(); ?> <?php echo form::open_section('Inbound Calls'); ?> <div class="field"> <?php echo form::label('sipinterface[context_id]', 'Default Incoming Context:'); echo numbering::selectContext(array('name' => 'sipinterface[context_id]', 'all' => TRUE), $sipinterface['context_id']); ?> </div> <?php echo form::close_section(); ?> <?php if (isset($views)) { echo subview::renderAsSections($views); } ?> <?php echo form::close(TRUE);
<div> <?php echo __('If this call is not answered transfer the caller to'); ?> </div> <?php $selectedClass = NULL; if (isset($terminate['transfer'])) { $selectedClass = numbering::getAssignedPoolByNumber($terminate['transfer']); } echo numbering::poolsDropdown(array('name' => 'number{{number_id}}_transfer_class', 'forDependent' => TRUE), $selectedClass); echo __(' named '); echo numbering::numbersDropdown(array('id' => 'number{{number_id}}_targets', 'name' => 'number{{number_id}}[dialplan][terminate][transfer]', 'forDependent' => TRUE), isset($terminate['transfer']) ? $terminate['transfer'] : NULL); ?> </div> </div> <input type="hidden" value="{{terminate_action}}" name="number{{number_id}}[dialplan][terminate][action]" id="number{{number_id}}_terminate_action"/> <?php echo form::close_section(); ?> <?php jquery::addPlugin(array('accordion', 'dependent')); ?>
public static function customValidation() { $validation = Bluebox_Controller::$validation; $base = Event::$data; if (!$base or !$base instanceof Number) { return TRUE; } $base['number'] = trim($base['number']); foreach ($base['NumberPool'] as $key => $pool) { if (empty($pool['number_type_id'])) { unset($base['NumberPool'][$key]); } } foreach ($base['NumberContext'] as $key => $context) { if (empty($context['context_id'])) { unset($base->NumberContext[$key]); } } $numberContexts = $base->NumberContext->toArray(); $numberPools = $base->NumberPool->toArray(); $modified = $base->getModified(); $matches = array(); if (empty($numberContexts)) { throw new Exception('Please assign this number to at least one context'); } if (!empty($base['class_type'])) { $poolTypes = array_flip(numbering::getPoolTypes()); if (empty($poolTypes[$base['class_type']])) { kohana::log('error', $base['class_type'] . ' submitted but there is no such pool type!'); throw new Exception('Number does not belong to a pool for the new destination'); } foreach ($numberPools as $pool) { if ($pool['number_type_id'] == $poolTypes[$base['class_type']]) { $found = TRUE; break; } } if (empty($found)) { $numberPools[] = array('number_type_id' => $poolTypes[$base['class_type']]); $base['NumberPool']->synchronizeWithArray($numberPools); } } if (empty($numberPools)) { throw new Exception('Please assign this number to at least one number pool'); } }
<?php defined('SYSPATH') or die('No direct access allowed.'); ?> <div id="callmanager_header" class="modules callmanager module_header"> <h2><?php echo __('Transfer Call'); ?> </h2> </div> <?php echo form::open(); echo form::hidden('uuid', $uuid); ?> <div class="field"> <?php echo form::label(array('for' => 'destext', 'hint' => 'Number to transfer the call to.', 'help' => 'Please select the number that you would like to transfer this call to from the list'), 'Transfer call to'); echo numbering::destinationsDropdown(array('name' => 'destext', 'nullOption' => '', 'assigned' => true, 'classType' => $classType), $userext); ?> </div> <div class="field"> <?php echo form::label(array('for' => 'campon', 'hint' => 'Do you want to camp if the call is rejected?', 'help' => 'Camping is a function by which the call is placed on hold and transfered once the extension is availale.'), 'Camp On:'); echo form::checkbox(array('name' => 'campon'), 'yes'); ?> </div> <?php echo form::close('ok_cancel');
<div style="text-align: center;"> <?php echo __('If this call is not answered transfer the caller to'); ?> <?php if (isset($number['dialplan']['terminate']['transfer'])) { $selectedClass = numbering::getAssignedPoolByNumber($number['dialplan']['terminate']['transfer']); } else { $selectedClass = NULL; } echo numbering::poolsDropdown($baseName . '_transfer_class', $selectedClass); echo __(' named '); echo numbering::numbersDropdown(array('id' => $baseName . '_targets', 'name' => $baseName . '[dialplan][terminate][transfer]', 'useNames' => TRUE, 'optGroups' => FALSE), isset($number['dialplan']['terminate']['transfer']) ? $number['dialplan']['terminate']['transfer'] : NULL); ?> </div> </div> <?php $action = 'hangup'; if (isset($number['dialplan']['terminate']['action'])) { $action = $number['dialplan']['terminate']['action']; } ?> <input type="hidden" value="<?php echo empty($action) ? 'hangup' : $action;
$selectedClass = numbering::getAssignedPoolByNumber($xmpp['registry']['exten']); } else { $selectedClass = NULL; } echo numbering::poolsDropdown(array('name' => 'xmpp_class_type', 'forDependent' => TRUE), $selectedClass); echo " named "; echo numbering::numbersDropdown(array('id' => 'xmpp_inbound', 'name' => 'xmpp[registry][exten]', 'useNames' => TRUE, 'optGroups' => FALSE, 'forDependent' => TRUE), isset($xmpp['registry']['exten']) ? $xmpp['registry']['exten'] : NULL); jquery::addQuery('#xmpp_inbound')->dependent('{ parent: \'xmpp_class_type\', group: \'common_class\' }'); ?> </div> <div class="field"> <?php echo form::label('xmpp[registry][inbound_context]', 'Default Incoming Context:'); echo numbering::selectContext('xmpp[registry][inbound_context]', isset($xmpp['registry']['inbound_context']) ? $xmpp['registry']['inbound_context'] : ''); ?> </div> <?php echo form::close_section(); ?> <?php echo form::open_section('Route Outbound Calls Matching...'); ?> <?php foreach ($outboundPatterns as $pattern) { ?>
<?php echo form::checkbox('vmalert[enabled]'); ?> </div> <div id="vmalert-container"> <div class="field"> <?php echo form::label('vmalert[number]', 'Number to dial:'); echo form::input('vmalert[number]'); ?> </div> <div class="field"> <?php echo form::label('vmalert[context]', 'Context to dial from:'); echo numbering::selectContext('vmalert[context]', isset($vmalert['context']) ? $vmalert['context'] : ''); ?> </div> </div> <?php echo form::close_section(); ?> <script type="text/javascript"> $(function() { if(!$("#vmalert_enabled").attr("checked")) { $("#vmalert-container").hide(); } $("#vmalert_enabled").click(function() {
<?php echo form::open_section('Options'); ?> <div class="field"> <?php echo form::label(array('for' => 'number{{number_id}}[dialplan][dbndir][trancontextid]', 'hint' => 'Context to use when transfering', 'help' => 'Context to transfer the calls to.'), 'Transfer Context:'); echo numbering::selectContext('number{{number_id}}[dialplan][dbndir][trancontextid]'); ?> </div> <?php echo form::close_section();
<?php echo form::open_section('Incoming Context'); ?> <div class="field"> <?php echo form::label('trunk[context_id]', 'Default Incoming Context:'); echo numbering::selectContext('trunk[context_id]', $trunk['context_id']); ?> </div> <?php echo form::close_section();
echo form::open_section('Outside this Range'); ?> <div class="field" style="text-align: center;"> During all other times route calls to a <?php if (isset($timeofday['outside_number_id'])) { $selectedClass = numbering::getAssignedPoolByNumber($timeofday['outside_number_id']); } else { $selectedClass = NULL; } echo numbering::poolsDropdown(array('name' => 'outside_class_type', 'forDependent' => TRUE), $selectedClass); echo " named "; echo numbering::numbersDropdown(array('id' => 'timeofday_outside', 'name' => 'timeofday[outside_number_id]', 'useNames' => TRUE, 'optGroups' => FALSE, 'forDependent' => TRUE), isset($timeofday['outside_number_id']) ? $timeofday['outside_number_id'] : NULL); jquery::addQuery('#timeofday_outside')->dependent('{ parent: \'outside_class_type\', group: \'common_class\' }'); ?> </div> <?php echo form::close_section(); ?> <?php echo form::close_section(); ?> <?php if (isset($views)) {
<?php defined('SYSPATH') or die('No direct access allowed.'); ?> <div id="callmanager_header" class="modules callmanager module_header"> <h2><?php echo __('Park Call'); ?> </h2> </div> <?php echo form::open(); echo form::hidden('uuid', $uuid); ?> <div class="field"> <?php echo form::label(array('for' => 'destlot', 'hint' => 'Lot to park call in', 'help' => 'Please select the lot that you would like to park this call in from the list'), 'Park call in'); echo numbering::destinationsDropdown(array('name' => 'destlot', 'nullOption' => '', 'assigned' => true, 'classType' => 'ValetParkingLotNumber')); ?> </div> <?php echo form::close('ok_cancel');
?> </div> <div class="field"> <?php echo form::label('activefeaturecode[exten]', 'Destination: '); ?> <?php if (isset($activefeaturecode['exten'])) { $selectedClass = numbering::getAssignedPoolByNumber($activefeaturecode['exten']); } else { $selectedClass = NULL; } echo numbering::poolsDropdown(array('name' => 'activefeaturecode_class_type', 'forDependent' => TRUE), $selectedClass); echo " named "; echo numbering::numbersDropdown(array('id' => 'activefeaturecode_inbound', 'name' => 'activefeaturecode[exten]', 'useNames' => TRUE, 'optGroups' => FALSE, 'forDependent' => TRUE), isset($activefeaturecode['exten']) ? $activefeaturecode['exten'] : NULL); jquery::addQuery('#activefeaturecode_inbound')->dependent('{ parent: \'activefeaturecode_class_type\', group: \'common_class\' }'); ?> </div> <div class="field"> <?php echo form::label('activefeaturecode[leg]', 'Allow feature code from: '); echo form::dropdown('activefeaturecode[leg]', array('b' => 'Callee', 'a' => 'Caller')); ?> </div> </div> <script type="text/javascript"> $(function() {
<?php defined('SYSPATH') or die('No direct access allowed.'); ?> <div id="callmanager_header" class="modules callmanager module_header"> <h2><?php echo __('Monitor Call'); ?> </h2> </div> <?php echo form::open(); echo form::hidden('uuid', $uuid); echo 'Monitor call using '; echo numbering::destinationsDropdown(array('name' => 'destext', 'classType' => 'DeviceNumber', 'optGroups' => false, 'nullOption' => '', 'assigned' => true), $userext); echo form::close('ok_cancel');