What CCM version?
Up until CCM4 you could simply create a copy of the asp file(s) that constitute the directory and change the directory url on that phone.
For CCM5 and upwards, you can no longer edit files on the callmanager so you'll have to write your own service (then again, since users are now in the database it's only a matter of sending an sql query via executeSQLQuery (an AXL command), followed by parsing of the response and returing this as a CiscoIPPhoneDirectory object.