Switchvox::API - Perl interface to the Switchvox Extend API.
This module provides a simple interface to interface with the Extend API on a Digium, Switchvox PBX. For more complete documentation on the entire Switchvox Extend API please visit http://developers.digium.com/switchvox. For more information on the Digium, Switchvox PBX product please visit the project home page at http://www.switchvox.com.
Note: The Switchvox::API object is a subclass of LWP::UserAgent so you can use all functionality of LWP::UserAgent.
Switchvox::API
An example of requesting information about two accounts (1106,1107) from the Switchvox PBX.
my $api = new Switchvox::API( hostname => '192.168.0.50', username => 'admin', password => 'your_admin_password' ); my $response = $api->api_request( method => 'switchvox.extensions.getInfo', parameters => { account_ids => [ { 'account_id' => [1106,1107] } ], } ); if($response->{api_status} eq 'success') { my $extensions = $response->{api_result}{response}[0]{result}[0]{extensions}[0]{extension}; foreach my $extension (@$extensions) { print "Extension:$extension->{number}, Full Name:$extension->{first_name} $extension->{last_name}\n"; } } else { print "Encountered Errors:\n"; foreach my $error ( @{$response->{api_errors}} ) { print "-Code:$error->{code},Message:$error->{message}\n"; } }
Written by David W. Podolsky <api at switchvox dot com>
Copyright (C) 2009 Digium, Inc
Switchvox::API::Request, Switchvox::API::Response, http://developers.digium.com/switchvox/
Returns a new Switchvox::API object.
The hostname or IP address of the Switchvox PBX.
The admin name or the extension used for authentication with the Switchvox. If you use an extension you can only call user methods via the Extend API.
The admin password or extension password used for authentication.
Returns an Switchvox::API::Response object.
Switchvox::API::Response
Name of the API method you want to call.
List of parameters to pass to the API.
To install Switchvox::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Switchvox::API
CPAN shell
perl -MCPAN -e shell install Switchvox::API
For more information on module installation, please visit the detailed CPAN module installation guide.