cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1651
Views
0
Helpful
5
Replies

Local phonebook management on SX codecs with xCommand

seanscott83
Level 1
Level 1

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
 

5 Replies 5

thobonho2
Level 1
Level 1

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

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.

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:

  1. Read each folder on the unit by ID (one per remote office site)
  2. Delete each folder by ID
  3. Recreate each folder and populate the directory

 

 

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.

Wayne

Please remember to mark helpful responses and to set your question as answered if appropriate.

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...