Yealink Forums
cli friendly API for import/export/delete handset directories & blacklists? - Printable Version

+- Yealink Forums (http://forum.yealink.com/forum)
+-- Forum: Dect Phone Series (/forumdisplay.php?fid=6)
+--- Forum: W60B(Wireless) (/forumdisplay.php?fid=59)
+--- Thread: cli friendly API for import/export/delete handset directories & blacklists? (/showthread.php?tid=45359)



cli friendly API for import/export/delete handset directories & blacklists? - warthog9 - 09-06-2021 04:51 AM

So I'll preface this that I know the W60's web interface has a directory section the ability to export and import the local handset directories, that's not what I'm looking for (though I have no scripting up a selenium browser puppeting to get me access to these, I'll be publishing that once I've got it cleaned up some).

What I'm really looking for is some mechanism to call into the W60 from (preferably) a restful api and get the dump of the handset directories, and wipe them (I personally need the upload anything back, but if this exists it could be useful). My intention is to pull whatever edits / contacts are on the handset and slowly merge them upwards in the stack (remote directory, and up into the fully centralized directory that's more easily shareable across not only the W60 and it's handsets but other phones and situations).

Other Yealink phones have a bit of an API under /cgi-bin/ConfigManApp.com however in attempting to poke at that to get anything useful I didn't get anywhere, and there's precious little documentation about that (in particular with respect to the W60). In an ideal world there would be 3 (ok 4) commands under that:
/cgi-bin/ConfigManApp.com?9990&username=<username>&password=<password> (list handsets to query)
/cgi-bin/ConfigManApp.com?9991&handset=1&addressbook=[xml|csv]&username=<username>&password=<password> (where handset is either an index or name from 9990)
/cgi-bin/ConfigManApp.com?9992&handset=1&delete_addressbook&username=<username>&password=<password> (again where handset is either an index or name from 9990)

I don't actually care about the number involved 999[012] are there for illustrative purposes only. But I'm not seeing that kind of API. I've gone ahead and scripted up basically that API through Selenium, but that's not entirely ideal (although obviously better than nothing).

I've also noticed that handsets note a directory group of "Blacklist"

<group display_name="Blacklist" />

but Blacklist entries in the handset(s) don't seem to actually be stored / exported there. As far as I can tell the blacklist is not accessible in any way from the W60 which seems odd, and I suspect is a bug that those aren't being included in the directory export and the directory delete. Is anyone familiar with what's going on there?

(09-06-2021 04:51 AM)warthog9 Wrote:  [...]

but Blacklist entries in the handset(s) don't seem to actually be stored / exported there. As far as I can tell the blacklist is not accessible in any way from the W60 which seems odd, and I suspect is a bug that those aren't being included in the directory export and the directory delete. Is anyone familiar with what's going on there?

Also as a note the XML that the exporter generates is technically invalid as an empty root_contact generates:

<root_contact />

which generates

# xmllint somefile.xml
somefile.xml:6: parser error : Extra content at the end of the document
<root_contact />
^
#

It's also worth noting that the exported xml files have multiple roots and realistically need to be wrapped in a central single root element to be correct


RE: cli friendly API for import/export/delete handset directories & blacklists? - Kylo_Yealink - 09-09-2021 07:47 PM

Dear Customer,

This is Kylo from Yealink technical support team, nice to work with you.

1. We don't have any API for W60B.
2. The "/cgi-bin/ConfigManApp.com" you mentioned is one of our phone's features, Action URI, for more information, you can refer to page 443 of Administrator Guide, and FAQ below.
https://support.yealink.com/en/portal/docDetail?documentCode=be688eadf39aab72
https://support.yealink.com/en/portal/knowledge/show?id=03d0477da77204eb70693585
3. Blacklist is a server-based feature, but our phone can support another feature called Blocklist which prevents numbers on the list from calling you.
The "group display_name=Blacklist" may have been written by programmers incorrectly.

I also created a Ticket for you, and you can contact us through Ticket.
https://ticket.yealink.com/page/question-detail.html?id=160457

Thank you.

Regards,
Kylo


RE: cli friendly API for import/export/delete handset directories & blacklists? - warthog9 - 09-11-2021 12:55 PM

1) That's unfortunate, I think having a basic API (at least for getting the phonebook and being able to wipe it) would be particularly useful. I do have a selenium setup that can handle this, and I may publish it since I know I've seen requests from others looking for a way to interact with those without having to manually log into the website as a normal user.

2) Thanks for those pointers, it looks like that might be close to what I want, but it doesn't (at least currently) support interacting with the handset phonebooks. The closest thing looks like it might be the "phonecfg=set" and "phonecfg=get", but those don't get me quite close enough. It would be nice if this could be extended to just output (even just straight text) the handset directory, and provide a mechanism to wipe it. This would actually eliminate my need for selenium entirely.

3) The handsets have the ability to add numbers to a blocklist / blacklist that seems to be blocked at the w60 itself, which is fine. I was just hoping to be able to access those, at least similarly to the local handset directory, so that they can be aggregated further up the stack and not directly live on the w60 itself. Since the directory export included the category, I'm definitely hoping that can be included in the export, as well as allow for erasing them at the same time as the local handset directory.

As for the bug I'm getting permission denied, but I do greatly appreciate the bug being opened :-)


RE: cli friendly API for import/export/delete handset directories & blacklists? - Kylo_Yealink - 09-13-2021 06:05 PM

Hi there,

Trust you had a nice weekend.

You can add numbers to Blocklist on W60, a photo is attached for your reference.
About how to add numbers to Blocklist, press History (Left shortcut), select the desired number then press Options (Right shortcut).

We can't search blocklist on the handset (GUI), but we can find it on the web page (WUI).

If you can't access our Ticket system, could you send us a photo when you access the Ticket I made for you?


Regards,
Kylo