AXL-Client-Simple

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    This document refers to version 0.01 of AXL::Client::Simple

SYNOPSIS
    Set up your CUCM AXL client:

     use AXL::Client::Simple;
     
 my $cucm = AXL::Client::Simple->new({
         server      => 'call-manager-server.example.com',
         username    => 'oliver',
         password    => 's3krit', # or set in $ENV{AXL_PASS}
     });

    Then perform simple queries on the Unified Communications server:

     my $device = $cucm->get_phone('SEP001122334455');
     
 my $lines = $device->lines;
     printf "this device has %s lines.\n", $lines->count;
     
 while ($lines->has_next) {

README  view on Meta::CPAN

    "server =>" Fully Qualified Domain Name (required)
        The host name of the CUCM server to which the module should connect.
        Note that the port number 8443 and the path "/axl/" are
        automatically appended so you need only provide the FQDN or IP
        address.

    "username =>" String (required)
        The account username under which the module will connect to CUCM.
        This value will be URI encoded by the module.

    "password =>" String OR via $ENV{AXL_PASS} (required)
        The password of the account under which the module will connect to
        CUCM. This value will be URI encoded by the module. You can also
        provide the password via the "AXL_PASS" environment variable.

    "schema_path =>" String (optional)
        A folder on your file system which contains the WSDL and Schema file
        which describe the Administrative XML (AXL) interface. They are
        shipped with this module so your providing this is optional.

  "$cucm->get_phone( <device-name> )"
    Retrieves the AXL::Client::Simple::Phone object which reveals a limited
    number of phone properties and details on the active extensions on the
    handset. See that linked manual page for more details.

lib/AXL/Client/Simple.pm  view on Meta::CPAN


our $VERSION = '0.02';
$VERSION = eval $VERSION; # numify for warning-free dev releases

has username => (
    is => 'ro',
    isa => 'Str',
    required => 1,
);

has password => (
    is => 'ro',
    isa => 'Str',
    required => 1,
);

has server => (
    is => 'ro',
    isa => 'Str',
    required => 1,
);

lib/AXL/Client/Simple.pm  view on Meta::CPAN

    return AXL::Client::Simple::Phone->new({
        client => $self,
        stash  => $device->{'parameters'}->{'return'}->{'device'},
    });
}

sub BUILDARGS {
    my ($class, @rest) = @_;
    my $params = (scalar @rest == 1 ? $rest[0] : {@rest});

    # collect AXL password from environment as last resort
    $params->{password} ||= $ENV{AXL_PASS};

    # URI escape the username and password
    $params->{username} ||= '';
    $params->{username} = URI::Escape::uri_escape($params->{username});
    $params->{password} = URI::Escape::uri_escape($params->{password});

    return $params;
}

__PACKAGE__->meta->make_immutable;
no Moose;
1;

__END__

lib/AXL/Client/Simple.pm  view on Meta::CPAN


=head1 SYNOPSIS

Set up your CUCM AXL client:

 use AXL::Client::Simple;
 
 my $cucm = AXL::Client::Simple->new({
     server      => 'call-manager-server.example.com',
     username    => 'oliver',
     password    => 's3krit', # or set in $ENV{AXL_PASS}
 });

Then perform simple queries on the Unified Communications server:

 my $device = $cucm->get_phone('SEP001122334455');
 
 my $lines = $device->lines;
 printf "this device has %s lines.\n", $lines->count;
 
 while ($lines->has_next) {

lib/AXL/Client/Simple.pm  view on Meta::CPAN


The host name of the CUCM server to which the module should connect. Note that
the port number 8443 and the path C</axl/> are automatically appended so you
need only provide the FQDN or IP address.

=item C<< username => >> String (required)

The account username under which the module will connect to CUCM. This value
will be URI encoded by the module.

=item C<< password => >> String OR via C<$ENV{AXL_PASS}> (required)

The password of the account under which the module will connect to CUCM.  This
value will be URI encoded by the module. You can also provide the password via
the C<AXL_PASS> environment variable.

=item C<< schema_path => >> String (optional)

A folder on your file system which contains the WSDL and Schema file which
describe the Administrative XML (AXL) interface. They are shipped with this
module so your providing this is optional.

=back

lib/AXL/Client/Simple/Phone.pm  view on Meta::CPAN


=head1 SYNOPSIS

First set up your CUCM AXL client as per L<AXL::Client::Simple>:

 use AXL::Client::Simple;
 
 my $cucm = AXL::Client::Simple->new({
     server      => 'call-manager-server.example.com',
     username    => 'oliver',
     password    => 's3krit', # or set in $ENV{AXL_PASS}
 });

Then perform simple queries on the Unified Communications server:

 my $device = $cucm->get_phone('SEP001122334455');
 
 my $lines = $device->lines;
 printf "this device has %s lines.\n", $lines->count;
 
 while ($lines->has_next) {

lib/AXL/Client/Simple/Role/SOAP.pm  view on Meta::CPAN

has transporter => (
    is => 'ro',
    isa => 'XML::Compile::Transport::SOAPHTTP',
    lazy_build => 1,
);

sub _build_transporter {
    my $self = shift;
    return XML::Compile::Transport::SOAPHTTP->new(
        address => (sprintf 'https://%s:%s@%s:8443/axl/',
            $self->username, $self->password, $self->server),
        keep_alive => 0,
    );
}

has wsdl => (
    is => 'ro',
    isa => 'XML::Compile::WSDL11',
    lazy_build => 1,
);

share/AXLSoap.xsd  view on Meta::CPAN

				<xsd:element name="AARGroup_To" type="axlapi:XAARGroup"/>
				<xsd:element name="GroupNameTo" type="axlapi:String100"/>
			</xsd:choice>
			<xsd:element name="prefixDigit" type="axlapi:String32"/>
		</xsd:sequence>
		<xsd:attribute name="uuid" type="axlapi:XUUID" use="optional"/>
	</xsd:complexType>
	<xsd:complexType name="XApplicationUser">
		<xsd:sequence>
			<xsd:element name="userid" type="xsd:string"/>
			<xsd:element name="password" type="xsd:string" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Valid range is 1-127 characters.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="passwordCredentials" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Read Only.Credential configuration for password.</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:choice minOccurs="0">
							<xsd:element name="pwdCredPolicy">
								<xsd:annotation>
									<xsd:documentation>Only the uuid attribute is read by the AXL API.</xsd:documentation>
								</xsd:annotation>
								<xsd:complexType>
									<xsd:complexContent>

share/AXLSoap.xsd  view on Meta::CPAN

							<xsd:element name="pilotUserId"/>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="XPilotUser">
		<xsd:sequence minOccurs="0">
			<xsd:element name="userId" type="axlapi:String255" nillable="false"/>
			<xsd:element name="password" type="xsd:string" nillable="true" minOccurs="0"/>
		</xsd:sequence>
		<xsd:attribute name="uuid" type="axlapi:XUUID"/>
	</xsd:complexType>
	<xsd:complexType name="XGateway">
		<xsd:annotation>
			<xsd:documentation>This is an abstract base type for all Gateways to extend.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="axlapi:XDevice">
				<xsd:sequence>

share/AXLSoap.xsd  view on Meta::CPAN

			</xsd:element>
		</xsd:sequence>
		<xsd:attribute name="uuid" type="axlapi:XUUID"/>
	</xsd:complexType>
	<xsd:complexType name="XUser">
		<xsd:sequence>
			<xsd:element name="firstname" type="xsd:string" minOccurs="0"/>
			<xsd:element name="middlename" type="xsd:string" minOccurs="0"/>
			<xsd:element name="lastname" type="xsd:string"/>
			<xsd:element name="userid" type="xsd:string"/>
			<xsd:element name="password" type="xsd:string" minOccurs="0"/>
			<xsd:element name="pin" minOccurs="0">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:minLength value="0"/>
						<xsd:maxLength value="127"/>
						<xsd:pattern value="(\d{5,127})*"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="telephoneNumber" type="axlapi:XDirectoryNumber" minOccurs="0"/>

share/AXLSoap.xsd  view on Meta::CPAN

					<xsd:sequence minOccurs="0">
						<xsd:element name="accessList" minOccurs="0" maxOccurs="unbounded">
							<xsd:annotation>
								<xsd:documentation>Name of the accessList</xsd:documentation>
							</xsd:annotation>
							<xsd:complexType/>
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="passwordCredentials" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Read-only. These groups get automatically added once an user is added.</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:choice minOccurs="0">
							<xsd:element name="pwdCredPolicy" type="axlapi:XUUID">
								<xsd:annotation>
									<xsd:documentation>Only uuid can be accepted.</xsd:documentation>
								</xsd:annotation>

share/AXLSoap.xsd  view on Meta::CPAN

         <xsd:enumeration value="A Cisco CallManager Group may not contain more than 3 Cisco CallManagers"/>
         <xsd:enumeration value="Slot value is not supported for this gateway"/>
         <xsd:enumeration value="This Slot Module is not allowed at the current slot position for this gateway"/>
         <xsd:enumeration value="This VIC card is not allowed for this gateway, under specified slot position and SlotModule"/>
         <xsd:enumeration value="The specified slot and subunit are already defined for this MGCP gateway."/>
         <xsd:enumeration value="AppUser Name already exists as an EndUser Userid. AppUser Name cannot be the same as an EndUser's userid"/>
         <xsd:enumeration value="EndUser userid already exists as an AppUser Name. EndUser userid cannot be the same as an AppUsers name."/>
         <xsd:enumeration value="EndUser cannot be inserted because Corporate LDAP directory is the sync master. Add users in the corporate directory."/>
         <xsd:enumeration value="EndUser cannot be deleted because Corporate LDAP directory is the sync master. Remove users from the corporate directory."/>
         <xsd:enumeration value="Cannot reduce Remote Destination Limit below the number of currently configured Remote Destinations for the EndUser."/>
         <xsd:enumeration value="The encrypted form of the password is too large to be stored. Use a shorter or less complex password."/>
         <xsd:enumeration value="Only one application server per type can be configured with the localdomain definition."/>
         <xsd:enumeration value="The .localdomain suffix is required and cannot be removed from Cisco Unity Connection AppServer name."/>
         <xsd:enumeration value="Another Application Server with this name already exists. Please check the Application Server Find/List page to verify your entry does not exist or use a different name."/>
         <xsd:enumeration value="A Server with this name already exists as Cisco UCM Server. Please check the Server Find/List page to verify your entry does not exist or use a different name."/>
         <xsd:enumeration value="Cannot have more than 100 IP Phone Service subscriptions on a device"/>
         <xsd:enumeration value="Cannot subscribe to IP Phone Service that is an Enterprise Subscription service"/>
         <xsd:enumeration value="Duplicate Number Plan entries for this Pilot record"/>
         <xsd:enumeration value="If NumPlan is null, then PilotUser and DeviceLine must contain values"/>
         <xsd:enumeration value="If NumPlan is not null, then PilotUser and DeviceLine must not contain entries"/>
         <xsd:enumeration value="PilotUser, device line index, and pilot must be unique"/>

share/AXLSoap.xsd  view on Meta::CPAN

					<xsd:documentation>If defined and asynchronous is true, then return the response to this port (otherwise, use the system default).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="securityInfo" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Carries the security information of the envelope.</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="userid" type="xsd:string"/>
						<xsd:element name="password" type="xsd:string"/>
						<xsd:element name="publicKey" type="xsd:string" minOccurs="0"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:all>
		<xsd:attribute name="sequence" type="xsd:unsignedLong" use="optional"/>
	</xsd:complexType>
	<xsd:complexType name="Response" abstract="false">
		<xsd:complexContent>
			<xsd:extension base="axlapi:Envelope">

share/AXLSoap.xsd  view on Meta::CPAN

							<xsd:annotation>
								<xsd:documentation>The pkid of the pilot user to modify.</xsd:documentation>
							</xsd:annotation>
						</xsd:element>
					</xsd:choice>
					<xsd:element name="newUserId" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>The new UserId of the pilotUser.Cannot be null.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="password" type="xsd:string" nillable="true" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Nullable.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:element name="updateAttendantConsoleUser" type="axlapi:UpdateAttendantConsoleUserReq"/>
	<xsd:element name="updateAttendantConsoleUserResponse" type="axlapi:StandardResponse"/>

share/AXLSoap.xsd  view on Meta::CPAN

		<xsd:annotation>
			<xsd:documentation>Returns "true" if the reset was performed successfully.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="axlapi:StandardResponse"/>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:element name="doDeviceResetResponse" type="axlapi:DeviceResetRes"/>
	<xsd:complexType name="AuthenticateUserReq" abstract="false">
		<xsd:annotation>
			<xsd:documentation>Authenticates the user on the basis of pin or password.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="axlapi:APIRequest">
				<xsd:sequence>
					<xsd:element name="userid" type="xsd:string"/>
					<xsd:choice>
						<xsd:element name="password" type="xsd:string"/>
						<xsd:element name="pin">
							<xsd:annotation>
								<xsd:documentation>Applicable for end users only.</xsd:documentation>
							</xsd:annotation>
							<xsd:simpleType>
								<xsd:restriction base="xsd:string">
									<xsd:pattern value="\d\d\d\d+"/>
								</xsd:restriction>
							</xsd:simpleType>
						</xsd:element>

share/AXLSoap.xsd  view on Meta::CPAN

						<xsd:annotation>
							<xsd:documentation>The new first name (given name) of the user.  Nullable.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="middlename" type="xsd:string" minOccurs="0"/>
					<xsd:element name="lastname" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>The new last name (surname) of the user.  Nullable.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="password" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>The new password for the user.  Not nullable.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="pin" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>The new PIN (personal identification number) for the user.  Not nullable.</xsd:documentation>
						</xsd:annotation>
						<xsd:simpleType>
							<xsd:restriction base="xsd:string">
								<xsd:pattern value="^\d+$"/>
							</xsd:restriction>

share/AXLSoap.xsd  view on Meta::CPAN

					<xsd:element name="maxDeskPickupWaitTime" type="xsd:unsignedLong" nillable="false" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Maximum wait time for Desk Pickup must be a number in the range 0 to 30000. Not Nullable.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="remoteDestinationLimit" type="xsd:unsignedShort" nillable="false" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Remote Destination Limit must be a number in the range 1 to 10. Not Nullable.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="passwordCredentials" minOccurs="0">
						<xsd:complexType>
							<xsd:sequence minOccurs="0">
								<xsd:choice minOccurs="0">
									<xsd:element name="pwdCredPolicy" type="axlapi:XUUID">
										<xsd:annotation>
											<xsd:documentation>Only uuid can be accepted.</xsd:documentation>
										</xsd:annotation>
									</xsd:element>
									<xsd:element name="pwdCredPolicyName" type="axlapi:String50"/>
								</xsd:choice>

share/AXLSoap.xsd  view on Meta::CPAN

			<xsd:documentation>Updates an existing application user in the directory.  Specify the user to be modified with their LDAP RN.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="axlapi:APIRequest">
				<xsd:sequence>
					<xsd:element name="userid" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>The userid of the user to be modified.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="password" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>The new password for the user. Valid range is 1-127 characters. Not nullable.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="passwordCredentials" minOccurs="0">
						<xsd:complexType>
							<xsd:sequence minOccurs="0">
								<xsd:choice minOccurs="0">
									<xsd:element name="pwdCredPolicy">
										<xsd:annotation>
											<xsd:documentation>Only the uuid attribute is read by the AXL API.</xsd:documentation>
										</xsd:annotation>
										<xsd:complexType>
											<xsd:complexContent>
												<xsd:extension base="axlapi:XCredentialPolicy">

share/AXLSoap.xsd  view on Meta::CPAN

			<xsd:documentation>Updates an existing application user. Specify the user to be modified with their user id.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="axlapi:APIRequest">
				<xsd:sequence>
					<xsd:element name="userid" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>The userid of the user to be modified.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="password" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>The new password for the user.  Not nullable.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="digestCredentials" type="xsd:string" nillable="true" minOccurs="0"/>
					<xsd:element name="passwordCredentials" minOccurs="0">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:choice minOccurs="0">
									<xsd:element name="pwdCredPolicy" type="axlapi:XUUID">
										<xsd:annotation>
											<xsd:documentation>Only uuid can be accepted.</xsd:documentation>
										</xsd:annotation>
									</xsd:element>
									<xsd:element name="pwdCredPolicyName" type="axlapi:String50"/>
								</xsd:choice>



( run in 1.010 second using v1.01-cache-2.11-cpan-49f99fa48dc )