9 Net::Vitelity - Interface to Vitelity API
17 our $VERSION = '0.02';
19 our $URL = 'http://64.74.178.105/api.php';
27 my $vitelity = Net::Vitelity->new(
28 'login' => $your_login,
37 my ($class,%data) = @_;
38 die "missing user and/or password" unless defined $data{'login'} && defined $data{'pass'};
39 my $self = { 'login' => $data{'login'}, 'pass' => $data{'pass'} };
47 $AUTOLOAD =~ /(^|::)(\w+)$/ or die "unparsable AUTOLOAD: $AUTOLOAD";
49 return if $cmd eq 'DESTROY';
51 my $ua = LWP::UserAgent->new;
55 my $response = $ua->post($URL, {
56 login => $self->{login},
57 pass => $self->{pass},
63 die $response->status_line unless $response->is_success;
65 my $content = $response->decoded_content;
67 $content =~ /x\[\[(.*)\[\[x/s;
70 wantarray ? split("\n", $content) : $content;
76 List ALL available toll free numbers
78 Possible Results: none OR [list of tf numbers]
82 Sends someone a phone call that then connects them to customer service/another number.
84 Options: number=number AND servicenumber=number
86 Possible Results:OK or INVALID
90 Lists ALL available local numbers in a specific state and ratecenter
94 Options: type=unlimited OR type=pri OR withrates=yes
97 Possible Results: unavailable or missing or [list of dids]
101 Orders a specific toll free number in our available list (SLOW)
102 Requires: did=TOLL-FREE-NUMBER
103 Options: routesip=route_to_this_subaccount
104 Possible Results: success or unavailable or missingdid
108 Orders a specific local number from our available list
110 Requires: did=AVAILABLE-LOCAL-NUMBER
112 Options: type=perminute OR type=unlimited OR type=your-pri OR
113 routesip=route_to_this_subaccount
115 Possible Results: invalid or success or missingdid
119 Remove Local or Toll Free DID from account
121 Requires: did=AVAILABLE-LOCAL-NUMBER
123 Possible Results: success OR unavailable OR missingdid
125 =head2 listratecenters
127 Lists all of the available rate centers for a specific state line by line
129 Requires: state=STATE (ie, state=CO)
131 Options: type=perminute OR type=unlimited OR type=pri
133 Possible Results: unavailable OR missingdata OR [list of ratecenters]
135 =head2 listavailratecenters
137 Lists all available rate centers DIDs are currently in stock for a specific state line by line
139 Requires: state=STATE (ie, state=CO)
141 Options: type=unlimited OR type=pri
143 Possible Results: missingdata OR unavailable or [list of ratecenters]
147 Orders a specific available toll free number from the SMS database.
149 Requires: did=8009879891 (number can be any available number)
151 Possible Results: missingdata OR exists OR success
155 Searches the SMS/800 database for an available number matching the specific data you provide
157 Requires: did=8**333****
159 Possible Results: none OR missingdata OR [list of avail numbers]
161 =head2 listavailstates
163 Lists all states that have DIDs which are currently in stock
165 Options: type=perminute OR type=unlimited OR type=pri
167 Possible Results: unavailable OR [list of states]
171 Lists all available DID states line by line
173 Options: type=perminute OR type=unlimited OR type=pri
175 Possible Results: unavailable OR [list of states]
179 Lookup a specific caller id number for the name
181 Requires: did=3037855015 (number)
183 Possible Results: missingdata OR [cnam value]
187 Searches the SMS/800 database for an available number matching the specific data you provide
189 Requires: did=8**333****
191 Possible Results: none OR missingdata OR [list of avail numbers]
193 =head2 localbackorder
195 Orders a specific local number from our available list
197 Requires: ratecenter=RATECENTER and state=STATE
199 Options: type=perminute OR type=unlimited
201 Possible Results: invalid OR ok OR missing
205 Changes the sub account a DID rings to.
207 Requires: did=DID_NUMBER & routesip=SIP_SUB_ACCOUNT
209 Possible Results: missingdata OR ok OR invalid
213 Reports back your current account balance
217 Lists all current Local and Toll free DIDs
221 Results: number,ratecenter,price_per_minute,subaccount
223 extra=yes adds STATE,MONTHLY_DID_RATE
227 Changes the routing on all dids to a specific sip account
229 Requires: routesip=sub_account OR routesip=login (routes to main)
231 Possible Results: ok OR invalid
235 Gets a rate on a specific domestic or International call
237 Requires: number=[countrycode_thenumber] ex: 01144.. or 1303..
239 Results: invalid OR the_rate_per_minute
247 Possible Results: subaccount list separated by return OR invalid
249 =head1 All Possible Result Return Codes
255 The request you made was successful
259 You are missing login= or pass= or cmd= or other in your URL string
263 You have submitted an invalid login or password
267 You are missing the ratecenter or state for a specific local did order
271 The number you requested is not available
275 There are no numbers available
279 you are missing &did=number
283 If you asked for a list of numbers and we had some available, they will be listed.
285 In a list contect, all entries will be returned in a list. In a scalar
286 scalar context, entries will be separated by newlines.
290 Ivan Kohler, C<< <ivan-vitelity at freeside.biz> >>
294 Please report any bugs or feature requests to C<bug-net-vitelity at rt.cpan.org>, or through
295 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Vitelity>. I will be notified, and then you'll
296 automatically be notified of progress on your bug as I make changes.
300 You can find documentation for this module with the perldoc command.
302 perldoc Net::Vitelity
304 You can also look for information at:
308 =item * RT: CPAN's request tracker
310 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Vitelity>
312 =item * AnnoCPAN: Annotated CPAN documentation
314 L<http://annocpan.org/dist/Net-Vitelity>
318 L<http://cpanratings.perl.org/d/Net-Vitelity>
322 L<http://search.cpan.org/dist/Net-Vitelity>
326 =head1 ACKNOWLEDGEMENTS
328 This module was developed by Freeside Internet Services, Inc.
329 If you need a complete, open-source web-based application to manage your
330 customers, billing and trouble ticketing, please visit http://freeside.biz/
332 Development sponsored by Ring Carrier LLC. If you need a hosted or on-site
333 PBX, please visit http://www.ringcarrier.com/
335 =head1 COPYRIGHT & LICENSE
337 Copyright 2009 Freeside Internet Services, Inc.
340 This program is free software; you can redistribute it and/or modify it
341 under the same terms as Perl itself.