Index: sipXconfig/plugins/polycom/src/org/sipfoundry/sipxconfig/phone/polycom/DirectoryConfiguration.java
===================================================================
--- sipXconfig/plugins/polycom/src/org/sipfoundry/sipxconfig/phone/polycom/DirectoryConfiguration.java	(revision 18494)
+++ sipXconfig/plugins/polycom/src/org/sipfoundry/sipxconfig/phone/polycom/DirectoryConfiguration.java	(working copy)
@@ -16,6 +16,7 @@
 
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.sipfoundry.sipxconfig.device.Device;
 import org.sipfoundry.sipxconfig.device.ProfileContext;
 import org.sipfoundry.sipxconfig.phonebook.PhonebookEntry;
 import org.sipfoundry.sipxconfig.speeddial.Button;
@@ -25,8 +26,8 @@
     private final Collection<PhonebookEntry> m_entries;
     private List<Button> m_buttons;
 
-    public DirectoryConfiguration(Collection<PhonebookEntry> entries, SpeedDial speedDial) {
-        super(null, "polycom/mac-address-directory.xml.vm");
+    public DirectoryConfiguration(Collection<PhonebookEntry> entries, SpeedDial speedDial, Device device) {
+        super(device, "polycom/mac-address-directory.xml.vm");
         m_entries = entries;
         if (speedDial != null) {
             m_buttons = speedDial.getButtons();
Index: sipXconfig/plugins/polycom/src/org/sipfoundry/sipxconfig/phone/polycom/PolycomPhone.java
===================================================================
--- sipXconfig/plugins/polycom/src/org/sipfoundry/sipxconfig/phone/polycom/PolycomPhone.java	(revision 18494)
+++ sipXconfig/plugins/polycom/src/org/sipfoundry/sipxconfig/phone/polycom/PolycomPhone.java	(working copy)
@@ -297,7 +297,7 @@
             PhoneContext phoneContext = phone.getPhoneContext();
             Collection<PhonebookEntry> entries = phoneContext.getPhonebookEntries(phone);
             SpeedDial speedDial = phoneContext.getSpeedDial(phone);
-            return new DirectoryConfiguration(entries, speedDial);
+            return new DirectoryConfiguration(entries, speedDial, phone);
         }
     }
 }
Index: sipXconfig/plugins/polycom/etc/polycom/phone.properties
===================================================================
--- sipXconfig/plugins/polycom/etc/polycom/phone.properties	(revision 18494)
+++ sipXconfig/plugins/polycom/etc/polycom/phone.properties	(working copy)
@@ -1041,6 +1123,22 @@
 directory.volatile.dir.local.volatile.maxSize.description=Maximum size in Kbytes of volatile storage that the directory will be permitted to \
 	 consume.
 
+directory.raw-frag-file-cumulative.label=Raw directory frag file / Cumulative
+directory.raw-frag-file-cumulative.description=The name of a file on the \
+tftp server containing a fragment of polycom directory XML. If this appears \
+multiple times (phone, groups) all the fragments are included. The fragments \
+are included after all other system generated directory entries and any \
+exclusive directory fragment. This feature \
+is only intended to be used when Polycom specific directory features \
+are needed (such as distinctive ring).
+
+directory.raw-frag-file-exclusive.label=Raw directory frag file / Exclusive
+directory.raw-frag-file-exclusive.description=The name of a file on the \
+tftp server containing a fragment of polycom directory XML. \
+The fragment is included after all other system generated directory entries. \
+This feature is only intended to be used when Polycom specific directory  \
+features are needed (such as distinctive ring).
+
 presence.label=Presence
 presence.description=
 
Index: sipXconfig/plugins/polycom/etc/polycom/mac-address-directory.xml.vm
===================================================================
--- sipXconfig/plugins/polycom/etc/polycom/mac-address-directory.xml.vm	(revision 18494)
+++ sipXconfig/plugins/polycom/etc/polycom/mac-address-directory.xml.vm	(working copy)
@@ -26,5 +26,32 @@
        <bb>0</bb>
      </item>
 #end
+
+## Include any exclusive raw directory fragment
+#set ($cdir = $cfg.Device.Settings.getSetting('directory'))
+#set ($xfile = false)
+#set ($xfile = $cdir.getSetting('raw-frag-file-exclusive').Value)
+#if ($xfile)
+<!-- Included from $xfile -->
+#parse($xfile)
+#end
+## Include any telephone/group specific raw directory fragments
+#set ($cset = $cfg.Device.Settings.getSetting('directory').getSetting('raw-frag-file-cumulative'))
+#set ($topval = false)
+#set ($topval = $cset.getValue())
+#if ($topval)
+
+<!-- Included from $topval -->
+#parse($topval)
+#end
+#foreach ($grp in $cfg.Device.getGroups())
+  #set ($xf = false)
+  #set ($xf = $grp.getSettingValue($cset))
+  #if ($xf && $xf != $topval)
+
+<!-- Included from $xf -->
+#parse($xf)
+  #end
+#end
   </item_list>
 </directory>
Index: sipXconfig/plugins/polycom/etc/polycom/phone.xml
===================================================================
--- sipXconfig/plugins/polycom/etc/polycom/phone.xml	(revision 18494)
+++ sipXconfig/plugins/polycom/etc/polycom/phone.xml	(working copy)
@@ -1510,6 +1615,18 @@
       </type>
       <value />
     </setting>
+    <setting name="raw-frag-file-cumulative" advanced="yes">
+      <type>
+        <string />
+      </type>
+      <value />
+    </setting>
+    <setting name="raw-frag-file-exclusive" advanced="yes">
+      <type>
+        <string />
+      </type>
+      <value />
+    </setting>
     <group name="2mb">
       <setting name="dir.local.volatile.2meg">
         <type>
Index: sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/system.beans.xml
===================================================================
--- sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/system.beans.xml	(revision 18494)
+++ sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/system.beans.xml	(working copy)
@@ -263,7 +263,7 @@
   -->
   <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
     <property name="resourceLoaderPath">
-      <value>file:${sysdir.etc}</value>
+      <value>file:${sysdir.etc}, file:${sysdir.phone}/profile/tftproot</value>
     </property>
     <property name="velocityPropertiesMap">
       <map>
