05-14-2015 11:10 AM - edited 03-18-2019 04:28 AM
I'm in the process of writing a script utilizing the xCommand API that generates a directory of our conference rooms in the local phonebook section of the SX codecs at my company. My end goal is to run the script nightly to wipe the local directory and generate a new one based on any updates we have.
My script for generating the directory work as expected, but I can't seem to find a command to wipe the entire directory. Does anyone know of a way to do that with a single command or am I going to have to query the device and delete entries based on the results.
Thanks,
Sean
05-14-2015 03:31 PM
Hi Sean
If you have root access (but it has been removed from TC7.1), you could just delete /config/pb.xml.
Another way for erasing the entire phonebook with a single command would be to have a root folder at the top of your phonebook structure and then to delete that folder. See: xCommand Phonebook Folder Delete.
Hope that helps!
Thomas
05-15-2015 08:51 AM
What Thomas listed is correct, the easiest and only method to do a bulk delete of phone book entries is to put them into a top level folder and delete that folder when you need to do a refresh.
06-17-2015 08:57 AM
Unfortunately, when you delete a folder and create a new one, it doesn't always re-use the folder ID. Sometimes it just uses the next available id making it impossible to hard-code any folder IDs.
I ended up just writing in some more logic to:
06-17-2015 06:27 PM
How may endpoints are you talking about? If there's a lot fo them, it could be worthwihile looking at putting in a TMS server to provision the phonebooks to the devices (and get all the other benefits of the additonal management and reporting features as well).
Wayne
--
Please remember to rate responses and to mark your question as answered if appropriate.
Please remember to mark helpful responses and to set your question as answered if appropriate.
05-15-2015 11:42 AM
Thanks guys. Unfortunately, it seems when you delete the folders on the codec, the codec doesn't always assign localGroupId-1 to the next folder created so I can't reliable guarantee that running the below is going to delete the root folder.
xcommand Phonebook Folder Delete FolderId: localGroupId-1
If I'm still going to have to rely on logic to read the folder list from the codec prior to deleting them, it's not really much work to read all the folders rather than the top folder.
It's really unfortunate that they removed root access because it would be much easier to just generate an XML file and drop it on the device...
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide