Net::Fritz::Phonebook - manage the Fritz!Box phonebook from Perl
my $fb = Net::Fritz::Box->new(
username => $username,
password => $password,
upnp_url => $host,
);
my $device = $fb->discover;
if( my $error = $device->error ) {
die $error
};
my @phonebooks = Net::Fritz::Phonebook->list(device => $device);
This module uses the API exposed by the Fritz!Box via TR064 to read, create and
update contacts in a phone book. This uses the X_AVM-DE_OnTel
service, which
is specific to the AVM Fritz!Box line of products.
print $phonebook->id;
The ID of the phone book on the Fritz!Box
print $phonebook->name;
The user visible name of the phone book on the Fritz!Box
print $phonebook->url;
The URL of the phone book on the Fritz!Box
This URL is used to access the phone book contents.
for my $entry ( @{ $phonebook->entries }) {
print $entry->name
};
Arrayref of the entries in this phone book. Each entry is a Net::Fritz::PhonebookEntry.
$phonebook->create();
Creates the phone book on the FritzBox. Entries of this phone book are not saved.
$phonebook->delete();
Deletes the phone book on the FritzBox. All entries of this phone book are also deleted with the phone book.
$phonebook->add_entry( $new_contact );
Saves an entry in the phone book on the FritzBox.
my $entry = $phonebook->get_entry_by_uniqueid( $uniqueid );
Scans all phone book entries and returns the one with the matching unique id
my $entry = $phonebook->get_entry_by_index( 0 );
Retrieves a single entry in the phone book on the FritzBox by its index in the list. This avoids fetching the complete phone book, but you basically have no way of determining the order of entries.
my $device = $fb->discover;
my $phonebook = Net::Fritz::Phonebook->by_name( device => $device, name => 'Telefonbuch' );
Utility function to find a phonebook by name.
my $device = $fb->discover;
my $services = $device->find_service_names(qr/X_AVM-DE_OnTel/);
my @phonebooks = Net::Fritz::Phonebook->list( service => $services->data->[0] );
$phonebook->reload();
Refreshes the content of the phonebook from the Fritz!Box. This is useful if you have added or removed entries from the phone book and want to fetch the state on the Fritz!Box again.
https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/x_contactSCPD.pdf
The public repository of this module is https://github.com/Corion/Net-Fritz-Phonebook.
The public support forum of this module is https://perlmonks.org/.
Please report bugs in this module via the RT CPAN bug queue at https://rt.cpan.org/Public/Dist/Display.html?Name=Net-Fritz-Phonebook or via mail to [email protected].
Max Maischein [email protected]
Copyright 2017-2023 by Max Maischein [email protected]
.
This module is released under the same terms as Perl itself.