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:
parent
352a630f42
commit
595f10ef2f
|
|
@ -495,7 +495,7 @@ include "root.php";
|
||||||
unset ($prep_statement);
|
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") {
|
if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0 and $_SESSION['provision']['directory_extensions']['boolean'] == "true") {
|
||||||
//get contacts from the database
|
//get contacts from the database
|
||||||
$sql = "select c.contact_organization, c.contact_name_given, c.contact_name_family, e.extension ";
|
$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 ";
|
$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 = $this->db->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
$contact_extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
unset ($prep_statement, $sql);
|
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
|
//assign the contacts array
|
||||||
$view->assign("extensions", $extensions);
|
$view->assign("extensions", $extensions);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,9 @@ preferred_codec: g711ulaw
|
||||||
enable_vad: 0
|
enable_vad: 0
|
||||||
dial_template: "dialplan"
|
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}_address: "{$row.server_address}"
|
||||||
proxy{$row.line_number}_port:"{$row.sip_port}"
|
proxy{$row.line_number}_port:"{$row.sip_port}"
|
||||||
line{$row.line_number}_name: "{$row.user_id}"
|
line{$row.line_number}_name: "{$row.user_id}"
|
||||||
|
|
@ -111,8 +112,11 @@ dst_stop_time: "2"
|
||||||
dst_auto_adjust: "1"
|
dst_auto_adjust: "1"
|
||||||
|
|
||||||
# Do Not Disturb Control (0-off, 1-on, 2-off with no user control, 3-on with no user control)
|
# 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)
|
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)
|
# 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)
|
callerid_blocking: "0" ; Default 0 (Disable sending all calls as anonymous)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,13 +1,18 @@
|
||||||
<CiscoIPPhoneMenu>
|
<CiscoIPPhoneMenu>
|
||||||
<Title>Contacts</Title>
|
<Title>Contacts</Title>
|
||||||
<Prompt>Please choose...</Prompt>
|
<Prompt>Please choose...</Prompt>
|
||||||
|
<MenuItem>
|
||||||
|
<Name>Our Phones</Name>
|
||||||
|
<URL>http://{$domain_name}/app/provision/file/directory-extensions.xml</URL>
|
||||||
|
</MenuItem>
|
||||||
<!--
|
<!--
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
<Name>Personal</Name>
|
<Name>Personal</Name>
|
||||||
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
|
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
--> <MenuItem> <Name>Enterprise</Name>
|
-->
|
||||||
|
<MenuItem>
|
||||||
|
<Name>Enterprise</Name>
|
||||||
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
|
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,9 @@ preferred_codec: g711ulaw
|
||||||
enable_vad: 0
|
enable_vad: 0
|
||||||
dial_template: "dialplan"
|
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}_address: "{$row.server_address}"
|
||||||
proxy{$row.line_number}_port:"{$row.sip_port}"
|
proxy{$row.line_number}_port:"{$row.sip_port}"
|
||||||
line{$row.line_number}_name: "{$row.user_id}"
|
line{$row.line_number}_name: "{$row.user_id}"
|
||||||
|
|
@ -111,8 +112,11 @@ dst_stop_time: "2"
|
||||||
dst_auto_adjust: "1"
|
dst_auto_adjust: "1"
|
||||||
|
|
||||||
# Do Not Disturb Control (0-off, 1-on, 2-off with no user control, 3-on with no user control)
|
# 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)
|
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)
|
# 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)
|
callerid_blocking: "0" ; Default 0 (Disable sending all calls as anonymous)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,13 +1,18 @@
|
||||||
<CiscoIPPhoneMenu>
|
<CiscoIPPhoneMenu>
|
||||||
<Title>Contacts</Title>
|
<Title>Contacts</Title>
|
||||||
<Prompt>Please choose...</Prompt>
|
<Prompt>Please choose...</Prompt>
|
||||||
|
<MenuItem>
|
||||||
|
<Name>Our Phones</Name>
|
||||||
|
<URL>http://{$domain_name}/app/provision/file/directory-extensions.xml</URL>
|
||||||
|
</MenuItem>
|
||||||
<!--
|
<!--
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
<Name>Personal</Name>
|
<Name>Personal</Name>
|
||||||
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
|
<URL>http://{$domain_name}/app/provision/file/directory-personal.xml</URL>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
--> <MenuItem> <Name>Enterprise</Name>
|
-->
|
||||||
|
<MenuItem>
|
||||||
|
<Name>Enterprise</Name>
|
||||||
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
|
<URL>http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac}</URL>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem>
|
<MenuItem>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue