Dave's Free Press

Technology: Palm-TreoPhoneCallDB-1.2

 

Older stuff

Palm::TreoPhoneCallDB - Handler for Treo PhoneCallDB databases


NAME

Palm::TreoPhoneCallDB - Handler for Treo PhoneCallDB databases


SYNOPSIS

    use Palm::PDB;
    use Palm::TreoPhoneCallDB timezone => 'Europe/London';
    my $pdb = Palm::PDB->new();
    $pdb->Load("PhoneCallDB.pdb");
    print Dumper(@{$pdb->{records}})'


DESCRIPTION

This is a helper class for the Palm::PDB package, which parses the database generated by Palm Treos as a record who you called, when, and for how long.


OPTIONS

You can set some global options when you 'use' the module:

timezone
Defaults to 'Europe/London'.

incl_raw
Whether to include the raw binary blob of data in the parsed records. Only really useful for debuggering, and so defaults to false.


METHODS

This class inherits from Palm::Raw, so has all of its methods. The following are over-ridden, and differ from that in the parent class thus:

ParseRecord

Returns data structures with the following keys:

rawdata
The raw data blob passed to the method. This is only present if the incl_raw option is true.

date
The date the call started, in YYYY-MM-DD format

time
The time the call started, in HH:MM format

epoch
The epoch time the call started. Note that because the database doesn't store the timezone, we assume 'Europe/London'. If you want to change that, then suppy a timezone option when you 'use' the module.

Internally, this uses the DateTime module. In the case of ambiguous times then it uses the latest UTC time. For invalid local times, the epoch is set to -1, an impossible number as it's before Palm even existed.

Note that this is always the Unix epoch time. See DateTime for details of what this means.

duration
The length of the call in seconds

name
The name of the other party, which the Treo extracts from the SIM phone-book or from the Palm address book at the time the call is connected.

number
The number of the other party. This is not normalised so you might see the same number in different formats, eg 02079813000 and +442079813000. I may add number normalisation in the future.

direction
Either 'Incoming', 'Outgoing' or 'Missed'.

Other fields may be added in the future.


LIMITATIONS

There is currently no support for creating a new database, or for editing the contents of an existing database. If you need that functionality, please submit a patch with tests. I will *not* write this myself unless I need it.

Behaviour if you try to create or edit a database is currently undefined.


BUGS and FEEDBACK

Online documentation claims that there are various flags in the records to indicate whether calls are incoming or outgoing and so on. I can't find these flags anywhere in the data generated by my Treo 680. Instead, it seems to be stored in the 'category' field. It is, however, possible that the category numbers for each type of call vary from one Treo to another maybe depending on the order in which the first calls are made.

If you find any other bugs please report them either using http://rt.cpan.org/ or by email. Ideally, I would like to receive a sample database and a test file, which fails with the latest version of the module but will pass when I fix the bug.


SEE ALSO

Palm::PDB

DateTime


AUTHOR

David Cantrell <david@cantrell.org.uk>


COPYRIGHT and LICENCE

Copyright 2007 David Cantrell

This module is free-as-in-speech software, and may be used, distributed, and modified under the same terms as Perl itself.


CONSPIRACY

This module is also free-as-in-mason software.