Change array extensins to contact_extensions and add a new extension array. Remove trailing spaces. And add a new cisco 79xx directory called Our Phones.

This commit is contained in:
markjcrane 2016-01-12 02:42:59 -07:00
parent 352a630f42
commit 595f10ef2f
9 changed files with 134 additions and 48 deletions

View File

@ -495,7 +495,7 @@ include "root.php";
unset ($prep_statement);
}
//get the extensions array and add to the template engine
//get the contact extensions array and add to the template engine
if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0 and $_SESSION['provision']['directory_extensions']['boolean'] == "true") {
//get contacts from the database
$sql = "select c.contact_organization, c.contact_name_given, c.contact_name_family, e.extension ";
@ -511,9 +511,27 @@ include "root.php";
$sql .= "order by c.contact_organization desc, c.contact_name_given asc, c.contact_name_family asc ";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();
$extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$contact_extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
//assign the contacts array
$view->assign("contact_extensions", $contact_extensions);
}
//get the extensions array and add to the template engine
if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0 and $_SESSION['provision']['directory_extensions']['boolean'] == "true") {
//get contacts from the database
$sql = "select directory_full_name, description ";
$sql .= "effective_caller_id_name, effective_caller_id_number ";
$sql .= "from v_extensions ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and enabled = 'true' ";
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
$extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
}
//assign the contacts array
$view->assign("extensions", $extensions);
}

View File

@ -11,8 +11,9 @@ preferred_codec: g711ulaw
enable_vad: 0
dial_template: "dialplan"
{foreach $lines as $row}reg.{$row.line_number}.displayName="{$row.display_name}"
#registration information
# Registration information
{foreach $lines as $row}
reg.{$row.line_number}.displayName="{$row.display_name}"
proxy{$row.line_number}_address: "{$row.server_address}"
proxy{$row.line_number}_port:"{$row.sip_port}"
line{$row.line_number}_name: "{$row.user_id}"
@ -111,8 +112,11 @@ dst_stop_time: "2"
dst_auto_adjust: "1"
# Do Not Disturb Control (0-off, 1-on, 2-off with no user control, 3-on with no user control)
{if isset($cisco_dnd_control)}
dnd_control: "{$cisco_dnd_control}" ; Default 0 (Do Not Disturb feature is off)
{else}
dnd_control: "2" ; Default 0 (Do Not Disturb feature is off)
{/if}
# Caller ID Blocking (0-disabled, 1-enabled, 2-disabled no user control, 3-enabled no user control)
callerid_blocking: "0" ; Default 0 (Disable sending all calls as anonymous)

View File

@ -3,7 +3,7 @@
<TEMPLATE MATCH="1..." Timeout="0" User="Phone"/> <!-- 4 digits intra-office -->
<TEMPLATE MATCH=".11" Timeout="0" User="Phone"/> <!-- Service numbers -->
<TEMPLATE MATCH="1.........." Timeout="0" User="Phone"/> <!-- Long Distance -->
<TEMPLATE MATCH="*" Timeout="2"/> <!-- Anything else -->
<TEMPLATE MATCH="*" Timeout="2"/> <!-- Anything else -->
<TEMPLATE MATCH="972......." Timeout="0" User="Phone"/> <!-- 10 digits -->
<TEMPLATE MATCH="214......." Timeout="0" User="Phone"/> <!-- 10 digits -->
<TEMPLATE MATCH="469......." Timeout="0" User="Phone"/> <!-- 10 digits -->

View File

@ -0,0 +1,25 @@
<CiscoIPPhoneDirectory>
<Title>Our Phones</Title>
<Prompt>Please choose...</Prompt>
{assign var=x value=1}
{foreach $extensions as $row}{
<DirectoryEntry>
{if $row.directory_full_name != ""}
<Name>{$row.directory_full_name}</Name>
{else}
<Name>{$row.effective_caller_id_name}</Name>
{/if}
{if $row.number_alias != ""}
<Telephone>{$row.number_alias}</Telephone>
{else}
<Telephone>{$row.extension}</Telephone>
{/if}
</DirectoryEntry>
{/if}
{assign var=x value=$x+1}
{/foreach}
</CiscoIPPhoneDirectory>

View File

@ -1,13 +1,18 @@
<CiscoIPPhoneMenu>
<Title>Contacts</Title>
<Prompt>Please choose...</Prompt>
<MenuItem>
<Name>Our Phones</Name>
<URL>http://{$domain_name}/app/provision/file/directory-extensions.xml</URL>
</MenuItem>
<!--
<MenuItem>
<Name>Personal</Name>
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
</MenuItem>
--> <MenuItem> <Name>Enterprise</Name>
-->
<MenuItem>
<Name>Enterprise</Name>
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
</MenuItem>
<MenuItem>

View File

@ -11,8 +11,9 @@ preferred_codec: g711ulaw
enable_vad: 0
dial_template: "dialplan"
{foreach $lines as $row}reg.{$row.line_number}.displayName="{$row.display_name}"
#registration information
# Registration information
{foreach $lines as $row}
reg.{$row.line_number}.displayName="{$row.display_name}"
proxy{$row.line_number}_address: "{$row.server_address}"
proxy{$row.line_number}_port:"{$row.sip_port}"
line{$row.line_number}_name: "{$row.user_id}"
@ -111,8 +112,11 @@ dst_stop_time: "2"
dst_auto_adjust: "1"
# Do Not Disturb Control (0-off, 1-on, 2-off with no user control, 3-on with no user control)
{if isset($cisco_dnd_control)}
dnd_control: "{$cisco_dnd_control}" ; Default 0 (Do Not Disturb feature is off)
{else}
dnd_control: "2" ; Default 0 (Do Not Disturb feature is off)
{/if}
# Caller ID Blocking (0-disabled, 1-enabled, 2-disabled no user control, 3-enabled no user control)
callerid_blocking: "0" ; Default 0 (Disable sending all calls as anonymous)

View File

@ -3,7 +3,7 @@
<TEMPLATE MATCH="1..." Timeout="0" User="Phone"/> <!-- 4 digits intra-office -->
<TEMPLATE MATCH=".11" Timeout="0" User="Phone"/> <!-- Service numbers -->
<TEMPLATE MATCH="1.........." Timeout="0" User="Phone"/> <!-- Long Distance -->
<TEMPLATE MATCH="*" Timeout="2"/> <!-- Anything else -->
<TEMPLATE MATCH="*" Timeout="2"/> <!-- Anything else -->
<TEMPLATE MATCH="972......." Timeout="0" User="Phone"/> <!-- 10 digits -->
<TEMPLATE MATCH="214......." Timeout="0" User="Phone"/> <!-- 10 digits -->
<TEMPLATE MATCH="469......." Timeout="0" User="Phone"/> <!-- 10 digits -->

View File

@ -0,0 +1,25 @@
<CiscoIPPhoneDirectory>
<Title>Our Phones</Title>
<Prompt>Please choose...</Prompt>
{assign var=x value=1}
{foreach $extensions as $row}{
<DirectoryEntry>
{if $row.directory_full_name != ""}
<Name>{$row.directory_full_name}</Name>
{else}
<Name>{$row.effective_caller_id_name}</Name>
{/if}
{if $row.number_alias != ""}
<Telephone>{$row.number_alias}</Telephone>
{else}
<Telephone>{$row.extension}</Telephone>
{/if}
</DirectoryEntry>
{/if}
{assign var=x value=$x+1}
{/foreach}
</CiscoIPPhoneDirectory>

View File

@ -1,13 +1,18 @@
<CiscoIPPhoneMenu>
<Title>Contacts</Title>
<Prompt>Please choose...</Prompt>
<MenuItem>
<Name>Our Phones</Name>
<URL>http://{$domain_name}/app/provision/file/directory-extensions.xml</URL>
</MenuItem>
<!--
<MenuItem>
<Name>Personal</Name>
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
</MenuItem>
--> <MenuItem> <Name>Enterprise</Name>
-->
<MenuItem>
<Name>Enterprise</Name>
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
</MenuItem>
<MenuItem>