NAME
Polycom::Contact - Class representing local contact directory contacts of Polycom VoIP phones.
SYNOPSIS
use Polycom::Contact;
# Create a new contact
my $contact = Polycom::Contact->new(
first_name => 'Bob',
last_name => 'Smith',
contact => '1234',
);
# The contact can be interpolated in strings
# Prints: "The contact is: Bob Smith at 1234"
print "The contact is: $contact\n";
# The contact can also be compared with other contacts
my $otherContact = Polycom::Contact->new(first_name => 'Jimmy', contact => '5678');
if ($otherContact != $contact)
{
print "$otherContact is not the same as $contact\n";
}
# Or, of course, you can simply query the contact's fields
my $first_name = $contact->first_name;
my $last_name = $contact->last_name;
DESCRIPTION
The Polycom::Contact class is used to represent a contact in a Polycom VoIP phone's local contact directory. This class is intended to be used with Polycom::Contact::Directory, which parses entire contact directory files, extracting the contacts, and enabling you to read or modify them.
Methods
- Polycom::Contact->new()
-
use Polycom::Contact; my $contact = Polycom::Contact->new(first_name => 'Bob', contact => 1234);
Returns a newly created
Polycom::Contact
object.In all, each
Polycom::Contact
object can have the following fields: =over =item first_name =item last_name =item contact =item speed_index =item label =item ring_type =item divert =item auto_reject =item auto_divert =item buddy_watching =item buddy_block =backOf those fields, the contact field is the only required field; without a unique contact field, the phone will not load the contact.
- $contact->is_valid
-
if (!$contact->is_valid) { print "$contact is invalid.\n"; }
Returns undef if the contact is invalid (i.e. it has no contact value specified), or 1 otherwise.
- $contact->diff($contact2)
-
my @differences = $contact1->diff($contact2);
Returns an array of contact field names that do not match (e.g. "First Name", "Speed Dial").
SEE ALSO
Polycom::Contact::Directory - A closely related module that parses the XML-based local contact directory file used by Polycom VoIP phones, and can be used to read, modify, or create contacts in the file.
AUTHOR
Zachary Blair, <zachary.blair@polycom.com>
COPYRIGHT AND LICENSE
Copyright (C) 2010 by Polycom Canada
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.