Virtual Spring Cleaning (part 1 of XX / 2017) - in which I hear CPANs call

Virtual Spring Cleaning (part 1 of XX / 2017) - in which I look who's calling

I really like the products by AVM, especially their Fritz!Box line of VoIP+DSL modems. For a long time, I've wanted to synchronize my CardDAV contacts from my server to my Fritz!Box, so that the reverse number lookup works on my landline as well as my mobile phone.

AVM have been fairly open and published the protocols for accessing their hardware. Some kind soul already implemented the low-level transport for TR-064 via Net::Fritz::Box. Net::CardDAVTalk does the fetching from my CardDAV server or .vcf files, and all I needed was just a little fighting with XML::Simple and SOAP::Lite to talk to the Fritz!Box.

I've released Net::Fritz::Phonebook , a module which allows you to manage the contacts in the phone books on the Fritz!Box.

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);
print $_->name for @phonebooks;

There still are some nasty niggles, as it seems to me that the Fritz!Box double-encodes data that is sent to it via TR-064. So for the time being, I have to transliterate all umlauts before sending them to the Fritz!Box phone book.

Leave a comment

About Max Maischein

user-pic I'm the Treasurer for the Frankfurt Perlmongers e.V. . I have organized Perl events including 7 German Perl Workshops one YAPC::Europe.