Add. Support provision programmable keys for Escene devices. (#1674)

This commit is contained in:
Alexey Melnichuk 2016-06-17 19:43:27 +03:00 committed by FusionPBX
parent e66c907fc9
commit ede2f8f57d
5 changed files with 202 additions and 23 deletions

View File

@ -1822,6 +1822,84 @@ $text['label-speed_dial_blf']['de-at'] = "";
$text['label-speed_dial_blf']['ar-eg'] = "";
$text['label-speed_dial_blf']['he'] = "";
$text['label-ent_phone_book']['en-us'] = "Enterprise Phonebook";
$text['label-ent_phone_book']['es-cl'] = "";
$text['label-ent_phone_book']['pt-pt'] = "";
$text['label-ent_phone_book']['fr-fr'] = "";
$text['label-ent_phone_book']['pt-br'] = "";
$text['label-ent_phone_book']['pl'] = "";
$text['label-ent_phone_book']['uk'] = "";
$text['label-ent_phone_book']['sv-se'] = "";
$text['label-ent_phone_book']['ro'] = "";
$text['label-ent_phone_book']['de-at'] = "";
$text['label-ent_phone_book']['ar-eg'] = "";
$text['label-ent_phone_book']['he'] = "";
$text['label-missed_calls']['en-us'] = "Missed Calls";
$text['label-missed_calls']['es-cl'] = "";
$text['label-missed_calls']['pt-pt'] = "";
$text['label-missed_calls']['fr-fr'] = "";
$text['label-missed_calls']['pt-br'] = "";
$text['label-missed_calls']['pl'] = "";
$text['label-missed_calls']['uk'] = "";
$text['label-missed_calls']['sv-se'] = "";
$text['label-missed_calls']['ro'] = "";
$text['label-missed_calls']['de-at'] = "";
$text['label-missed_calls']['ar-eg'] = "";
$text['label-missed_calls']['he'] = "";
$text['label-received_calls']['en-us'] = "Received Calls";
$text['label-received_calls']['es-cl'] = "";
$text['label-received_calls']['pt-pt'] = "";
$text['label-received_calls']['fr-fr'] = "";
$text['label-received_calls']['pt-br'] = "";
$text['label-received_calls']['pl'] = "";
$text['label-received_calls']['uk'] = "";
$text['label-received_calls']['sv-se'] = "";
$text['label-received_calls']['ro'] = "";
$text['label-received_calls']['de-at'] = "";
$text['label-received_calls']['ar-eg'] = "";
$text['label-received_calls']['he'] = "";
$text['label-dialed_calls']['en-us'] = "Dialed Calls";
$text['label-dialed_calls']['es-cl'] = "";
$text['label-dialed_calls']['pt-pt'] = "";
$text['label-dialed_calls']['fr-fr'] = "";
$text['label-dialed_calls']['pt-br'] = "";
$text['label-dialed_calls']['pl'] = "";
$text['label-dialed_calls']['uk'] = "";
$text['label-dialed_calls']['sv-se'] = "";
$text['label-dialed_calls']['ro'] = "";
$text['label-dialed_calls']['de-at'] = "";
$text['label-dialed_calls']['ar-eg'] = "";
$text['label-dialed_calls']['he'] = "";
$text['label-enable_account']['en-us'] = "Enable/Disable SIP Account";
$text['label-enable_account']['es-cl'] = "";
$text['label-enable_account']['pt-pt'] = "";
$text['label-enable_account']['fr-fr'] = "";
$text['label-enable_account']['pt-br'] = "";
$text['label-enable_account']['pl'] = "";
$text['label-enable_account']['uk'] = "";
$text['label-enable_account']['sv-se'] = "";
$text['label-enable_account']['ro'] = "";
$text['label-enable_account']['de-at'] = "";
$text['label-enable_account']['ar-eg'] = "";
$text['label-enable_account']['he'] = "";
$text['label-provison_now']['en-us'] = "Auto Provison Now";
$text['label-provison_now']['es-cl'] = "";
$text['label-provison_now']['pt-pt'] = "";
$text['label-provison_now']['fr-fr'] = "";
$text['label-provison_now']['pt-br'] = "";
$text['label-provison_now']['pl'] = "";
$text['label-provison_now']['uk'] = "";
$text['label-provison_now']['sv-se'] = "";
$text['label-provison_now']['ro'] = "";
$text['label-provison_now']['de-at'] = "";
$text['label-provison_now']['ar-eg'] = "";
$text['label-provison_now']['he'] = "";
//Additional translations
$text['header-profiles']['en-us'] = "Profiles";
$text['header-profiles']['es-cl'] = "Perfiles";

View File

@ -1044,9 +1044,9 @@ require_once "resources/require.php";
if (strlen($device_vendor) == 0) { echo "</optgroup>"; }
}
if (strtolower($device_vendor) == "escene" || strlen($device_vendor) == 0 || strlen($device_username) > 0) {
echo "<optgroup label='Escene'>";
$match_vendor = (strtolower($device_key_vendor) == "escene");
?>
<?php echo "<optgroup label='Escene'>"; ?>
<?php $match_vendor = (strtolower($device_key_vendor) == "escene"); ?>
<option value='1' <?php if ($match_vendor && $row['device_key_type'] == '1' ) { echo $selected;$found=true; } ?>><?php echo $text['label-blf'] ?></option>
<option value='7' <?php if ($match_vendor && $row['device_key_type'] == '7' ) { echo $selected;$found=true; } ?>><?php echo $text['label-call_park'] ?></option>
<option value='4' <?php if ($match_vendor && $row['device_key_type'] == '4' ) { echo $selected;$found=true; } ?>><?php echo $text['label-dtmf'] ?></option>
@ -1055,9 +1055,32 @@ require_once "resources/require.php";
<option value='8' <?php if ($match_vendor && $row['device_key_type'] == '8' ) { echo $selected;$found=true; } ?>><?php echo $text['label-intercom'] ?></option>
<option value='9' <?php if ($match_vendor && $row['device_key_type'] == '9' ) { echo $selected;$found=true; } ?>><?php echo $text['label-pickup'] ?></option>
<option value='11' <?php if ($match_vendor && $row['device_key_type'] == '11') { echo $selected;$found=true; } ?>><?php echo $text['label-broadsoft_group'] ?></option>
<?php /*BLA type 2 Paging type ?*/ ?>
<?php
if (strlen($device_vendor) == 0) { echo "</optgroup>"; }
<?php /*BLA type 3 Paging type 6*/ ?>
<?php echo "</optgroup>"; ?>
<?php echo "<optgroup label='Escene programmable'>"; ?>
<?php $match_vendor = (strtolower($device_key_vendor) == "escene programmable"); ?>
<option value='0' <?php if ($match_vendor && $row['device_key_type'] == '0' ) { echo $selected;$found=true; } ?>><?php echo $text['label-default'] ?></option> <?php /* 0 - Default */?>
<option value='1' <?php if ($match_vendor && $row['device_key_type'] == '1' ) { echo $selected;$found=true; } ?>><?php echo $text['label-redial'] ?></option> <?php /* 1 - Redial */?>
<option value='2' <?php if ($match_vendor && $row['device_key_type'] == '2' ) { echo $selected;$found=true; } ?>><?php echo $text['label-dnd'] ?></option> <?php /* 2 - DND */?>
<option value='3' <?php if ($match_vendor && $row['device_key_type'] == '3' ) { echo $selected;$found=true; } ?>><?php echo $text['label-phone_book'] ?></option> <?php /* 3 - Contacts */?>
<option value='4' <?php if ($match_vendor && $row['device_key_type'] == '4' ) { echo $selected;$found=true; } ?>><?php echo $text['label-ent_phone_book'] ?></option> <?php /* 4 - Enterprise Phonebook */?>
<option value='5' <?php if ($match_vendor && $row['device_key_type'] == '5' ) { echo $selected;$found=true; } ?>><?php echo $text['label-ldap'] ?></option> <?php /* 5 - LDAP */?>
<option value='6' <?php if ($match_vendor && $row['device_key_type'] == '6' ) { echo $selected;$found=true; } ?>><?php echo $text['label-directory'] ?></option> <?php /* 6 - Dir */?>
<option value='7' <?php if ($match_vendor && $row['device_key_type'] == '7' ) { echo $selected;$found=true; } ?>><?php echo $text['label-speed_dial'] ?></option> <?php /* 7 - Speed Dial */?>
<option value='8' <?php if ($match_vendor && $row['device_key_type'] == '8' ) { echo $selected;$found=true; } ?>><?php echo $text['label-call_log'] ?></option> <?php /* 8 - Call List */?>
<option value='9' <?php if ($match_vendor && $row['device_key_type'] == '9' ) { echo $selected;$found=true; } ?>><?php echo $text['label-missed_calls'] ?></option> <?php /* 9 - Missed Calls */?>
<option value='10' <?php if ($match_vendor && $row['device_key_type'] == '10') { echo $selected;$found=true; } ?>><?php echo $text['label-received_calls'] ?></option> <?php /* 10 - Received Calls */?>
<option value='11' <?php if ($match_vendor && $row['device_key_type'] == '11') { echo $selected;$found=true; } ?>><?php echo $text['label-dialed_calls'] ?></option> <?php /* 11 - Dialed Calls */?>
<option value='12' <?php if ($match_vendor && $row['device_key_type'] == '12') { echo $selected;$found=true; } ?>><?php echo $text['label-menu'] ?></option> <?php /* 12 - Menu */?>
<option value='13' <?php if ($match_vendor && $row['device_key_type'] == '13') { echo $selected;$found=true; } ?>><?php echo $text['label-sms'] ?></option> <?php /* 13 - SMS */?>
<option value='14' <?php if ($match_vendor && $row['device_key_type'] == '14') { echo $selected;$found=true; } ?>><?php echo $text['label-new_sms'] ?></option> <?php /* 14 - New SMS */?>
<option value='15' <?php if ($match_vendor && $row['device_key_type'] == '15') { echo $selected;$found=true; } ?>><?php echo $text['label-forward'] ?></option> <?php /* 15 - Call Forward */?>
<option value='16' <?php if ($match_vendor && $row['device_key_type'] == '16') { echo $selected;$found=true; } ?>><?php echo $text['label-status'] ?></option> <?php /* 16 - View Status */?>
<option value='17' <?php if ($match_vendor && $row['device_key_type'] == '17') { echo $selected;$found=true; } ?>><?php echo $text['label-enable_account'] ?></option> <?php /* 17 - Enable/Disable SIP Account */?>
<option value='19' <?php if ($match_vendor && $row['device_key_type'] == '19') { echo $selected;$found=true; } ?>><?php echo $text['label-provison_now'] ?></option> <?php /* 19 - Auto Provison Now */?>
<option value='20' <?php if ($match_vendor && $row['device_key_type'] == '20') { echo $selected;$found=true; } ?>><?php echo $text['label-hot_desking'] ?></option> <?php /* 20 - Hot Desking */?>
<?php /*<option value='18' <?php if ($match_vendor && $row['device_key_type'] == '18') { echo $selected;$found=true; } ?>><?php echo $text['label-xml browser'] ?></option> */?> <?php /* 18 - XML Browser */?>
<?php echo "</optgroup>"; ?>
}
if (strtolower($device_vendor) == "grandstream" || strlen($device_vendor) == 0 || strlen($device_username) > 0) {
echo "<optgroup label='Grandstream'>";

View File

@ -429,21 +429,44 @@ require_once "resources/require.php";
<?php
if (strlen($device_vendor) == 0) { echo "</optgroup>"; }
}
if (strtolower($device_vendor) == "escene" || strlen($device_vendor) == 0) {
if (strlen($device_vendor) == 0) { echo "<optgroup label='Escene'>"; }
if (strtolower($device_vendor) == "escene" || strtolower($device_vendor) == "escene programmable" || strlen($device_vendor) == 0) {
?>
<option value='1' <?php if ($row['device_key_type'] == '1' ) { echo $selected;$found=true; } ?>><?php echo $text['label-blf'] ?></option>
<option value='7' <?php if ($row['device_key_type'] == '7' ) { echo $selected;$found=true; } ?>><?php echo $text['label-call_park'] ?></option>
<option value='4' <?php if ($row['device_key_type'] == '4' ) { echo $selected;$found=true; } ?>><?php echo $text['label-dtmf'] ?></option>
<option value='5' <?php if ($row['device_key_type'] == '5' ) { echo $selected;$found=true; } ?>><?php echo $text['label-speed_dial'] ?></option>
<option value='2' <?php if ($row['device_key_type'] == '2' ) { echo $selected;$found=true; } ?>><?php echo $text['label-speed_dial_prefix'] ?></option>
<option value='8' <?php if ($row['device_key_type'] == '8' ) { echo $selected;$found=true; } ?>><?php echo $text['label-intercom'] ?></option>
<option value='9' <?php if ($row['device_key_type'] == '9' ) { echo $selected;$found=true; } ?>><?php echo $text['label-pickup'] ?></option>
<option value='11' <?php if ($row['device_key_type'] == '11') { echo $selected;$found=true; } ?>><?php echo $text['label-broadsoft_group'] ?></option>
<?php /*BLA type 2 Paging type ?*/ ?>
<?php
if (strlen($device_vendor) == 0) { echo "</optgroup>"; }
}
<?php echo "<optgroup label='Escene'>"; ?>
<?php $match_vendor = (strtolower($device_key_vendor) == "escene"); ?>
<option value='1' <?php if ($match_vendor && $row['device_key_type'] == '1' ) { echo $selected;$found=true; } ?>><?php echo $text['label-blf'] ?></option>
<option value='7' <?php if ($match_vendor && $row['device_key_type'] == '7' ) { echo $selected;$found=true; } ?>><?php echo $text['label-call_park'] ?></option>
<option value='4' <?php if ($match_vendor && $row['device_key_type'] == '4' ) { echo $selected;$found=true; } ?>><?php echo $text['label-dtmf'] ?></option>
<option value='5' <?php if ($match_vendor && $row['device_key_type'] == '5' ) { echo $selected;$found=true; } ?>><?php echo $text['label-speed_dial'] ?></option>
<option value='2' <?php if ($match_vendor && $row['device_key_type'] == '2' ) { echo $selected;$found=true; } ?>><?php echo $text['label-speed_dial_prefix'] ?></option>
<option value='8' <?php if ($match_vendor && $row['device_key_type'] == '8' ) { echo $selected;$found=true; } ?>><?php echo $text['label-intercom'] ?></option>
<option value='9' <?php if ($match_vendor && $row['device_key_type'] == '9' ) { echo $selected;$found=true; } ?>><?php echo $text['label-pickup'] ?></option>
<option value='11' <?php if ($match_vendor && $row['device_key_type'] == '11') { echo $selected;$found=true; } ?>><?php echo $text['label-broadsoft_group'] ?></option>
<?php echo "</optgroup>"; ?>
<?php echo "<optgroup label='Escene programmable'>"; ?>
<?php $match_vendor = (strtolower($device_key_vendor) == "escene programmable"); ?>
<option value='0' <?php if ($match_vendor && $row['device_key_type'] == '0' ) { echo $selected;$found=true; } ?>><?php echo $text['label-default'] ?></option> <?php /* 0 - Default */?>
<option value='1' <?php if ($match_vendor && $row['device_key_type'] == '1' ) { echo $selected;$found=true; } ?>><?php echo $text['label-redial'] ?></option> <?php /* 1 - Redial */?>
<option value='2' <?php if ($match_vendor && $row['device_key_type'] == '2' ) { echo $selected;$found=true; } ?>><?php echo $text['label-dnd'] ?></option> <?php /* 2 - DND */?>
<option value='3' <?php if ($match_vendor && $row['device_key_type'] == '3' ) { echo $selected;$found=true; } ?>><?php echo $text['label-phone_book'] ?></option> <?php /* 3 - Contacts */?>
<option value='4' <?php if ($match_vendor && $row['device_key_type'] == '4' ) { echo $selected;$found=true; } ?>><?php echo $text['label-ent_phone_book'] ?></option> <?php /* 4 - Enterprise Phonebook */?>
<option value='5' <?php if ($match_vendor && $row['device_key_type'] == '5' ) { echo $selected;$found=true; } ?>><?php echo $text['label-ldap'] ?></option> <?php /* 5 - LDAP */?>
<option value='6' <?php if ($match_vendor && $row['device_key_type'] == '6' ) { echo $selected;$found=true; } ?>><?php echo $text['label-directory'] ?></option> <?php /* 6 - Dir */?>
<option value='7' <?php if ($match_vendor && $row['device_key_type'] == '7' ) { echo $selected;$found=true; } ?>><?php echo $text['label-speed_dial'] ?></option> <?php /* 7 - Speed Dial */?>
<option value='8' <?php if ($match_vendor && $row['device_key_type'] == '8' ) { echo $selected;$found=true; } ?>><?php echo $text['label-call_log'] ?></option> <?php /* 8 - Call List */?>
<option value='9' <?php if ($match_vendor && $row['device_key_type'] == '9' ) { echo $selected;$found=true; } ?>><?php echo $text['label-missed_calls'] ?></option> <?php /* 9 - Missed Calls */?>
<option value='10' <?php if ($match_vendor && $row['device_key_type'] == '10') { echo $selected;$found=true; } ?>><?php echo $text['label-received_calls'] ?></option> <?php /* 10 - Received Calls */?>
<option value='11' <?php if ($match_vendor && $row['device_key_type'] == '11') { echo $selected;$found=true; } ?>><?php echo $text['label-dialed_calls'] ?></option> <?php /* 11 - Dialed Calls */?>
<option value='12' <?php if ($match_vendor && $row['device_key_type'] == '12') { echo $selected;$found=true; } ?>><?php echo $text['label-menu'] ?></option> <?php /* 12 - Menu */?>
<option value='13' <?php if ($match_vendor && $row['device_key_type'] == '13') { echo $selected;$found=true; } ?>><?php echo $text['label-sms'] ?></option> <?php /* 13 - SMS */?>
<option value='14' <?php if ($match_vendor && $row['device_key_type'] == '14') { echo $selected;$found=true; } ?>><?php echo $text['label-new_sms'] ?></option> <?php /* 14 - New SMS */?>
<option value='15' <?php if ($match_vendor && $row['device_key_type'] == '15') { echo $selected;$found=true; } ?>><?php echo $text['label-forward'] ?></option> <?php /* 15 - Call Forward */?>
<option value='16' <?php if ($match_vendor && $row['device_key_type'] == '16') { echo $selected;$found=true; } ?>><?php echo $text['label-status'] ?></option> <?php /* 16 - View Status */?>
<option value='17' <?php if ($match_vendor && $row['device_key_type'] == '17') { echo $selected;$found=true; } ?>><?php echo $text['label-enable_account'] ?></option> <?php /* 17 - Enable/Disable SIP Account */?>
<option value='19' <?php if ($match_vendor && $row['device_key_type'] == '19') { echo $selected;$found=true; } ?>><?php echo $text['label-provison_now'] ?></option> <?php /* 19 - Auto Provison Now */?>
<option value='20' <?php if ($match_vendor && $row['device_key_type'] == '20') { echo $selected;$found=true; } ?>><?php echo $text['label-hot_desking'] ?></option> <?php /* 20 - Hot Desking */?>
<?php /*<option value='18' <?php if ($match_vendor && $row['device_key_type'] == '18') { echo $selected;$found=true; } ?>><?php echo $text['label-xml browser'] ?></option> */?> <?php /* 18 - XML Browser */?>
<?php echo "</optgroup>"; ?>
<?php }
if (strtolower($device_vendor) == "grandstream" || strlen($device_vendor) == 0) {
if (strlen($device_vendor) == 0) { echo "<optgroup label='Grandstream'>"; }
?>

View File

@ -659,7 +659,12 @@ include "root.php";
$sql .= "or device_profile_uuid = '".$device_profile_uuid."' ";
}
$sql .= ") ";
$sql .= "AND (lower(device_key_vendor) = '".$device_vendor."' or device_key_vendor is null) ";
if(strtolower($device_vendor) == 'escene'){
$sql .= "AND (lower(device_key_vendor) = 'escene' or lower(device_key_vendor) = 'escene programmable' or device_key_vendor is null) ";
}
else {
$sql .= "AND (lower(device_key_vendor) = '".$device_vendor."' or device_key_vendor is null) ";
}
$sql .= "ORDER BY device_key_category asc, device_key_id asc, device_uuid desc";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();

View File

@ -1,18 +1,68 @@
<all>
{foreach $keys as $row}
{if $row.device_key_line==""}
{$row.device_key_line="127"}
{/if}
{/foreach}
<hotlines>
{$is_first_line='true'}
{foreach $keys as $row}
{if $row.device_key_category=="memory"}
{if $row.device_key_id!=""}
{if $row.device_key_line==""}
{$row.device_key_line="127"}
{/if}
<hotline {if $is_first_line=='true'}ExternID="0"{$is_first_line='false'}{/if} id="{$row.device_key_id-1}" SipAccounts="{$row.device_key_line}" ID="{$row.device_key_id-1}" Type="{$row.device_key_type}" HotlineNum="{$row.device_key_value}" Name="{$row.device_key_label}"/>
{/if}
{/if}
{/foreach}
</hotlines>
<ProgramKeys>
<!--
keys:
0-3 - SoftKey in Idle mode
4 - Un
5 - Down
6 - Left
7 - Right
8 - OK
9 - Conference
10 - Redial
11 - Transfer
12 - Hold
13 - Service
14 - Directories
15 - Menu
16 - Mute
17 - Message
functions:
0 - Default
1 - Redial
2 - DND
3 - Contacts
4 - Enterprise Phonebook
5 - LDAP
6 - Dir
7 - Speed Dial
8 - Call List
9 - Missed Calls
10 - Received Calls
11 - Dialed Calls
12 - Menu
13 - SMS
14 - New SMS
15 - Call Forward
16 - View Status
17 - Enable/Disable SIP Account
18 - XML Browser
19 - Auto Provison Now
20 - Hot Desking
-->
{foreach $keys as $row}
{if $row.device_key_category=="programmable"}
<ProgramKey id="{$row.device_key_id-1}" SipAccounts="{$row.device_key_line}" Type="{$row.device_key_type}" Num="{$row.device_key_value}" Name="{$row.device_key_label}"/>
{/if}
{/foreach}
</ProgramKeys>
<Extensions>
{foreach $keys as $row}
{if $row.device_key_category=="expansion"}