Esempio n. 1
0
 public function _showStatus($null, $plugins, $location_id)
 {
     if (empty($plugins['sip']['username']) or empty($location_id)) {
         return 'Unknown';
     }
     try {
         $username = $plugins['sip']['username'];
         $domain = locations::getLocationDomain($location_id);
         return SofiaManager::isDeviceActive($username, $domain);
     } catch (Exception $e) {
         kohana::log('error', 'Unable to determine the status of ' . $username . ': ' . $e->getMessage());
     }
     return 'Unknown';
 }
Esempio n. 2
0
<?php

/* get all locations*/
if (isset($_GET['location_id']) && !empty($_GET['location_id'])) {
    $location_id = $_GET['location_id'];
    require_once 'includes/config.php';
    require_once ROOT . '/lib/locations.php';
    $obj_loc = new locations();
    $results = $obj_loc->get_location_detail($location_id);
    //print_r($results);
    echo '<a href="index.php">Back to List</a><br /><br />';
    echo 'Title:' . $results['title'] . '<br /><br />';
    echo 'City:' . $results['city'] . '<br /><br />';
    echo 'Zip:' . $results['zip'] . '<br /><br />';
    echo 'Lat:' . $results['lat'] . '<br /><br />';
    echo 'Log:' . $results['log'] . '<br /><br />';
    echo 'Description:' . $results['description'] . '<br /><br />';
    echo '<img src="' . $results['loc_image'] . '"><br /><br />';
    ?>
<div id="googleMap" style="width:800px;height:500px;"></div>
<script>
	var marker;
	function initMap() {
	  var map = new google.maps.Map(document.getElementById('googleMap'), {
		zoom: 13,
		center: {lat: <?php 
    echo $results['lat'];
    ?>
, lng: <?php 
    echo $results['log'];
    ?>
Esempio n. 3
0
echo form::label(array('for' => 'sipinterface[auth]', 'hint' => 'Require a SIP username/password?', 'help' => 'Whether or not to require a username/password for SIP registrations. Usually you want this checked. Note that ACLs are checked first and if someone matches an ACL it overrides the requirement for a SIP username/password challenge.<BR><BR>WARNING: Turning this option off on a publicly exposed IP is usually considered dangerous unless you are careful with what destinations you make accessible. Everyone on the Internet will be able to use all numbers and features on your system via this IP address and the context you select below if you uncheck this box. This warning only applies to public IP addresses.!'), 'Enable Auth/Challenge?');
echo form::checkbox('sipinterface[auth]');
?>
        </div>

        <div class="field">
        <?php 
echo form::label(array('for' => 'sipinterface[multiple]', 'help' => 'Allow more than one device to register using the same credintials at a time. When calls are placed to the SIP user all registered phones will ring simultaneously. The first phone to answer gets the call.'), 'Allow multiple registrations:');
echo form::checkbox('sipinterface[multiple]');
?>
        </div>

        <div class="field">
        <?php 
echo form::label(array('for' => 'sipinterface[registry][force_register_domain]', 'hint' => 'Equivalent to forcing rport', 'help' => 'All inbound registrations will be considered for this domain, ignoring the domain provided by the registration request.  Setting this to none uses the domain specified in the registration.'), 'Force Registration Domain');
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']);
Esempio n. 4
0
                    'help' => 'Caller ID information used when calling phones outside this network.'
                ),
                'External CID Number:'
            );
            echo form::input('callerid[external_number]');
        ?>
        </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>
Esempio n. 5
0
echo form::label('user[last_name]', 'Last Name:');
echo form::input('user[last_name]');
?>
        </div>

        <div class="field">
        <?php 
echo form::label('user[user_type]', 'User Type:');
echo usermanager::dropdownUserType('user[user_type]');
?>
        </div>

        <div class="field">
        <?php 
echo form::label('user[location_id]', 'Location:');
echo locations::dropdown('user[location_id]');
?>
        </div>

    <?php 
echo form::close_section();
?>

    <?php 
echo form::open_section('Credentials');
?>

        <div class="field">
        <?php 
echo form::label('user[email_address]', 'Email:');
echo form::input('user[email_address]');
Esempio n. 6
0
<?php

/* get all locations*/
require_once 'includes/config.php';
require_once ROOT . '/lib/locations.php';
$obj_loc = new locations();
$results = $obj_loc->get_location();
/* loop through the results*/
foreach ($results as $result) {
    echo '<a href="template.php?location_id=' . $result['location_id'] . '">' . $result['city'] . '</a><br />';
}