View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Zachary Blair > Polycom-Config-File-0.04 > Polycom::Config::File



Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  


Polycom::Config::File - Parser for Polycom VoIP phone config files.


  use Polycom::Config::File;

  # Load an existing config file
  my $cfg = Polycom::Config::File->new('0004f21ac123-regLine.cfg');

  # Read the 'dialplan.digitmap' parameter
  my $digitmap = $cfg->params->{'dialplan.digitmap'};

  # Modify the 'voIpProt.server.1.address' parameter 
  $cfg->params->{'voIpProt.server.1.address'} = '';

  # Save the file


This module can be used to read, modify, or create config files for Polycom's SoundPoint IP, SoundStation IP, and VVX series of VoIP phones.

Configuration files enable administrators to configure phone parameters ranging from line registrations, to preferred codecs, to background images.

The files are structured using XML, where each attribute is named after a configuration parameter. For instance, the XML below would constitute a valid configuration file that specifies a SIP registration server and a dial plan digit map.

  <?xml version="1.0" standalone="yes"?>
     <server voIpProt.server.1.address=""/>

For more information about managing configuration files on Polycom SoundPoint IP, SoundStation IP, or VVX VoIP phones, see the "Configuration File Management on Polycom SoundPoint IP Phones" document at

For a detailed list of available configuration parameters, consult the "SoundPoint IP, SoundStation IP and Polycom VVX Administrator's Guide" document at



  # Create a new empty config file
  my $cfg = Polycom::Config::File->new();

  # Load a directory from a filename or file handle
  my $cfg2 = Polycom::Config::File->new('0004f21ac123-sip.cfg');
  my $cfg3 = Polycom::Config::File->new($fh);

If you have already slurped the contents of a config file into a scalar, you can also pass that scalar to new to parse those XML contents.



  # Read the 'dialplan.digitmap' parameter
  my $dialmap = $cfg->params->{'dialplan.digitmap'};

  # Modify the 'voIpProt.server.1.address' parameter
  $cfg->params->{'voIpProt.server.1.address'} = '';

Returns a reference to a hash containing all of the config parameters in the config file. If you modify this hash, your changes will be written to the file when you call save.


If this object was created by passing a file path to new, then this function will return that file path. Otherwise, path simply returns undef.

equals ( $cfg2 )

  if ($cfg1->equals($cfg2))
    print "The config files are equal\n";

Returns true if both config files are equal (i.e. they contain the same config parameters, and all of those config parameters have the same value).

Because the == and != operators have also been overloaded for Polycom::Config::File, it is equivalent to compare two config files using:

  if ($cfg1 == $cfg2)
    print "The config files are equal\n";

save ( $filename )


Writes the configuration parameters to the specified file.

For the phone to load the parameters in the file, you will need to place the file on the phone's boot server and add its filename to the CONFIG_FILES field in <Ethernet address>.cfg, as described in the "Configuration File Management on Polycom SoundPoint IP Phones" document listed at the bottom of this page. The phone must then be restarted for it to pick up the changes to its configuration.


  my $xml = $cfg->to_xml;

Returns the XML representation of the config. It is exactly this XML representation that the save method writes to the config file.


Polycom::Contact::Directory - parses the XML-based local contact directory files used by Polycom SoundPoint IP, SoundStation IP, and VVX VoIP phones.
Configuration File Management on Polycom SoundPoint IP Phones -
SoundPoint IP, SoundStation IP and Polycom VVX Administrator's Guide -


Zachary Blair, <>


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.

syntax highlighting: