Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get internal numbers of phone devices aka "Telefonie - Telefoniegeraete" [Enhancement] #80

Open
bufemc opened this issue Dec 19, 2020 · 1 comment

Comments

@bufemc
Copy link
Contributor

bufemc commented Dec 19, 2020

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:

internal: **1
seen from outside: 79364
device type: FON 1 (aka fax device, connected to fon 1)

internal: **610
seen from outside: 84646
device type: DECT

These are the columns on top:
image

Values seen so far in my case for device, but there could be much more:

  • Fon1
  • integriert
  • LAN/WLAN
  • DECT

If it's not planned to integrate this, or you just know how to do it, any hint would be nice!

@bufemc
Copy link
Contributor Author

bufemc commented Dec 19, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant