Open bufemc opened 3 years ago
Okay, I maybe re-invented the wheel.. what you have to do seems to be this:
First retrieve the list: ('X_AVM-DE_OnTel:1', 'GetDECTHandsetList')
Then, for each retrieve the entry, e.g. for 1: ('X_AVM-DE_OnTel:1', 'GetDECTHandsetInfo', arguments={'NewDectId': 1})
Returns e.g. {'NewHandsetName': 'I1 84646', 'NewPhonebookID': 0}
Then maybe split by space, and take the 2nd, so "84646", plus maybe add the regional prefix before..
Quick & dirty code snippet:
res = self.fc.call_action('X_AVM-DE_OnTel:1', 'GetDECTHandsetList')
ids = res['NewDectIDList'].split(',')
for id in ids:
res = self.fc.call_action('X_AVM-DE_OnTel:1', 'GetDECTHandsetInfo', arguments={'NewDectId': id})
print(res['NewHandsetName'])
REMARK: this is not the optimum yet. It misses the fax device connected to "fon 1" and phone numbers not assigned to handsets (I have 2 more phone numbers, which are currently not used). Maybe those could be retrieved by "deflections"? See https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/X_contactSCPD.pdf
NOTE: Other possibility could be to use: https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/x_voip-avm.pdf and from that 2.22 X_AVM-DE_GetClient
Update: seems to be a better way:
fc.call_action('X_VoIP:1', 'X_AVM-DE_GetNumbers')
But: you have to parse the returned XML..
I am currently trying to get the internal numbers of all "Telefonie - Telefoniegeraete" in the Fritzbox UI.. any ideas? I searched the documentation but could only find how to get e.g. Wifi devices and their mac uids. If this is missing in the current implementation I would like to propose it for an enhancement.
What: Phone devices connected to the Fritzbox, their internal number and their assigned phone number. E.g.:
Examples:
These are the columns on top:![image](https://user-images.githubusercontent.com/18305092/102688004-fc426480-41f3-11eb-944e-5eb2eb69545e.png)
Values seen so far in my case for device, but there could be much more:
If it's not planned to integrate this, or you just know how to do it, any hint would be nice!