-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add contact entry to phonebook [Feature] - call_action mockup attached #50
Comments
I did a quick mockup, it works! Of course it should not be with fixed values and even the envelope hardcoded, just serve as a template. Is it worth a PR?
Update: Important is to set an empty string for NewPhonebookEntryID, first had it set to 0, so it always overwrote my first entry in the phonebook ;-) |
Why would that be desired? Is there some specific reason? I would also like to see an API for creating new entries. |
Here's some nicer code to create the needed entry data XML: import xml.etree.ElementTree as ET
def get_phonebook_entry_data(name: str, number: str) -> str:
envelope = ET.Element("Envelope", {"xmlns:s": "http://www.w3.org/2003/05/soap-envelope"})
contact = ET.SubElement(envelope, "contact")
category = ET.SubElement(contact, "category")
category.text = "0"
person = ET.SubElement(contact, "person")
real_name = ET.SubElement(person, "realName")
real_name.text = name
telephony = ET.SubElement(contact, "telephony")
number_ = ET.SubElement(telephony, "number")
number_.text = number
return ET.tostring(envelope, encoding="unicode") |
It would be nice if you could add new phone numbers by command line. Reason: I get a lot of cold calls and it drives me nuts always to have to re-login to the Fritzbox and go to the place of the correct phonebook, then to add it. How it could work I have found here:
https://forum.fhem.de/index.php?topic=64152.0
another solution (German) here: https://administrator.de/wissen/powershell-fritzbox-tr-064-netzwerk-konfigurieren-auslesen-303474.html - check method "Add-FBPhoneBookEntry".
I currently have two phonebooks: the first for normal users, and the other is called "ColdCalls". The latter one is configured to block all contained numbers. Of course it have to be ensured you add the number to the right list ;-)
The idea would be to add it by command line, something like:
fritzphonebook -i ip -p pass -add "ColdCalls | 0700123456 | CompanyXY"
or maybe add it by the phonebook id, in my case normal numbers is 0, ColdCalls is 1:
fritzphonebook -i ip -p pass -add -pbid 1 -phone 0700123456 -name CompanyXY
I would also understand if you want to keep the phonebook read-only. So I already forked this nice repository in case I have to solve it on my own ;-)
The text was updated successfully, but these errors were encountered: