diff --git a/app/provision/resources/classes/provision.php b/app/provision/resources/classes/provision.php
index 595db49b91..3f5d5ef57e 100644
--- a/app/provision/resources/classes/provision.php
+++ b/app/provision/resources/classes/provision.php
@@ -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);
}
diff --git a/resources/templates/provision/cisco/7940/SIP{$mac}.cnf b/resources/templates/provision/cisco/7940/SIP{$mac}.cnf
index 4a4bb88bdb..9c1258c199 100644
--- a/resources/templates/provision/cisco/7940/SIP{$mac}.cnf
+++ b/resources/templates/provision/cisco/7940/SIP{$mac}.cnf
@@ -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}"
@@ -29,11 +30,11 @@ proxy_emergency_port: "{$proxy_emergency_port}"
# Backup Proxy info
proxy_backup: "{$proxy_backup}"
proxy_backup_port: "{$proxy_backup_port}"
-
+
# Outbound Proxy info
outbound_proxy: "{$outbound_proxy}"
outbound_proxy_port: "{$outbound_proxy_port}"
-
+
# NAT/Firewall Traversal
voip_control_port: "5060"
start_media_port: "16384"
@@ -47,50 +48,50 @@ sync: 1 ; Default 1
# Proxy Registration (0-disable (default), 1-enable)
proxy_register: "1"
-
+
# Phone Registration Expiration [1-3932100 sec] (Default - 3600)
timer_register_expires: "80"
-
+
# Codec for media stream (g711ulaw (default), g711alaw, g729)
preferred_codec: "none"
-
+
# TOS bits in media stream [0-5] (Default - 5)
tos_media: "5"
# Enable VAD (0-disable (default), 1-enable)
enable_vad: "0"
-
+
# Allow for the bridge on a 3way call to join remaining parties upon hangup
cnf_join_enable: "1" ; 0-Disabled, 1-Enabled (default)
-
+
# Allow Transfer to be completed while target phone is still ringing
semi_attended_transfer: "0" ; 0-Disabled, 1-Enabled (default)
-
+
# Telnet Level (enable or disable the ability to telnet into this phone
telnet_level: "2" ; 0-Disabled (default), 1-Enabled, 2-Privileged
# Inband DTMF Settings (0-disable, 1-enable (default))
dtmf_inband: "1"
-
+
# Out of band DTMF Settings (none-disable, avt-avt enable (default), avt_always - always avt )
dtmf_outofband: "avt"
-
+
# DTMF dB Level Settings (1-6dB down, 2-3db down, 3-nominal (default), 4-3db up, 5-6dB up)
dtmf_db_level: "3"
-
+
# SIP Timers
timer_t1: "500" ; Default 500 msec
timer_t2: "4000" ; Default 4 sec
sip_retx: "10" ; Default 11
sip_invite_retx: "6" ; Default 7
timer_invite_expires: "180" ; Default 180 sec
-
+
# Setting for Message speeddial to UOne box
messages_uri: "*97"
# TFTP Phone Specific Configuration File Directory
tftp_cfg_dir: ""
-
+
# Time Server
sntp_mode: "unicast"
sntp_server: "{$ntp_server_primary}"
@@ -109,22 +110,25 @@ dst_stop_day_of_week: "Sunday"
dst_stop_week_of_month: "1"
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)
-
+
# Anonymous Call Blocking (0-disbaled, 1-enabled, 2-disabled no user control, 3-enabled no user control)
anonymous_call_block: "0" ; Default 0 (Disable blocking of anonymous calls)
-
+
# Call Waiting (0-disabled, 1-enabled, 2-disabled with no user control, 3-enabled with no user control)
call_waiting: "1" ; Default 1 (Call Waiting enabled)
# DTMF AVT Payload (Dynamic payload range for AVT tones - 96-127)
dtmf_avt_payload: "101" ; Default 100
-
+
# XML file that specifies the dialplan desired
dial_template: "dialplan"
diff --git a/resources/templates/provision/cisco/7940/dialplan.xml b/resources/templates/provision/cisco/7940/dialplan.xml
index 0f50b67357..107a8d9896 100644
--- a/resources/templates/provision/cisco/7940/dialplan.xml
+++ b/resources/templates/provision/cisco/7940/dialplan.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/resources/templates/provision/cisco/7940/directory-extensions.xml b/resources/templates/provision/cisco/7940/directory-extensions.xml
new file mode 100644
index 0000000000..91bf7b0550
--- /dev/null
+++ b/resources/templates/provision/cisco/7940/directory-extensions.xml
@@ -0,0 +1,25 @@
+
+ Our Phones
+ Please choose...
+{assign var=x value=1}
+{foreach $extensions as $row}{
+
+{if $row.directory_full_name != ""}
+ {$row.directory_full_name}
+{else}
+ {$row.effective_caller_id_name}
+{/if}
+{if $row.number_alias != ""}
+ {$row.number_alias}
+{else}
+ {$row.extension}
+{/if}
+
+{/if}
+{assign var=x value=$x+1}
+{/foreach}
+
+
+
+
+
diff --git a/resources/templates/provision/cisco/7940/directory.xml b/resources/templates/provision/cisco/7940/directory.xml
index 24351b9b2d..6bb0637022 100644
--- a/resources/templates/provision/cisco/7940/directory.xml
+++ b/resources/templates/provision/cisco/7940/directory.xml
@@ -1,13 +1,18 @@
Contacts
Please choose...
-
+