'login' => $your_login,
'pass' => $your_pass,
'apitype' => 'api', #api, fax or lnp
+ 'debug' => 0,
);
=head1 METHODS
die "missing user and/or password" unless defined $data{'login'} && defined $data{'pass'};
my $self = { 'login' => $data{'login'}, 'pass' => $data{'pass'} };
$self->{apitype} = $data{'apitype'} ? $data{'apitype'} : 'api';
+ $self->{debug} = $data{'debug'} ? 1 : 0;
bless $self, $class;
return $self;
}
my $url = $URL_API;
$url = $URL_FAX if $self->{apitype} eq 'fax';
- $url = $URL_FAX if $self->{apitype} eq 'lnp';
+ $url = $URL_LNP if $self->{apitype} eq 'lnp';
+
+ if ( $self->{debug} ) {
+ warn "Vitelity $cmd ($url)\n";
+ my %hash = @_;
+ warn " $_: $hash{$_}\n" foreach keys %hash;
+ }
my $response = $ua->post($url, {
login => $self->{login},