projects
/
Net-Vitelity.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add debug flag
[Net-Vitelity.git]
/
lib
/
Net
/
Vitelity.pm
diff --git
a/lib/Net/Vitelity.pm
b/lib/Net/Vitelity.pm
index
c2f3f13
..
0715b91
100644
(file)
--- a/
lib/Net/Vitelity.pm
+++ b/
lib/Net/Vitelity.pm
@@
-10,7
+10,7
@@
Net::Vitelity - Interface to Vitelity API
=cut
=cut
-our $VERSION = '0.0
3
';
+our $VERSION = '0.0
4
';
our $AUTOLOAD;
our $AUTOLOAD;
@@
-19,8
+19,10
@@
our $AUTOLOAD;
use Net::Vitelity;
my $vitelity = Net::Vitelity->new(
use Net::Vitelity;
my $vitelity = Net::Vitelity->new(
- 'login' => $your_login,
- 'pass' => $your_pass,
+ 'login' => $your_login,
+ 'pass' => $your_pass,
+ 'apitype' => 'api', #api, fax or lnp
+ 'debug' => 0,
);
=head1 METHODS
);
=head1 METHODS
@@
-38,6
+40,7
@@
sub new {
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';
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;
}
bless $self, $class;
return $self;
}
@@
-53,11
+56,19
@@
sub AUTOLOAD {
#XXX md5 encrypt pass
#XXX md5 encrypt pass
- my $URL_API = 'http://64.74.178.105/api.php';
- my $URL_FAX = 'http://64.74.178.105/fax.php';
+ my $URL_API = 'http://api.vitelity.net/api.php';
+ my $URL_FAX = 'http://api.vitelity.net/fax.php';
+ my $URL_LNP = 'http://api.vitelity.net/lnp.php';
my $url = $URL_API;
$url = $URL_FAX if $self->{apitype} eq 'fax';
my $url = $URL_API;
$url = $URL_FAX if $self->{apitype} eq 'fax';
+ $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},
my $response = $ua->post($url, {
login => $self->{login},
@@
-342,12
+353,9
@@
ticketing and customer signup and self-service web interfaces.
http://freeside.biz/
http://freeside.biz/
-Development sponsored by Voice Carrier LLC. If you need a hosted or on-site
-PBX, please visit http://www.voicecarrier.com/
-
=head1 COPYRIGHT & LICENSE
=head1 COPYRIGHT & LICENSE
-Copyright 2009-201
2
Freeside Internet Services, Inc.
+Copyright 2009-201
7
Freeside Internet Services, Inc.
All rights reserved.
This program is free software; you can redistribute it and/or modify it
All rights reserved.
This program is free software; you can redistribute it and/or modify it