8 Net::Vitelity - Interface to Vitelity API
16 our $VERSION = '0.01';
18 our $URL = 'http://70.84.157.157/api.php';
24 my $vitelity = Net::Vitelity->new(
25 'login' => $your_login,
34 #XXX need a generic new
40 $AUTOLOAD =~ /(^|::)(\w+)$/ or die "unparsable AUTOLOAD: $AUTOLOAD";
42 return if $cmd eq 'DESTROY';
44 my $ua = LWP::UserAgent->new;
49 login => $self->{login},
56 die $response->status_line unless $response->is_success;
59 #my $content = $response->content;
60 my $content = $response->decoded_content;
62 #dear vitelity api: why does this make it easier to parse?
63 $content =~ s/^x\[\[/;
64 $content =~ s/\[\[x$/;
66 wantarray ? split("\n", $content) : $content;
72 List ALL available toll free numbers
74 Possible Results: none OR [list of tf numbers]
78 Sends someone a phone call that then connects them to customer service/another number.
80 Options: number=number AND servicenumber=number
82 Possible Results:OK or INVALID
86 Lists ALL available local numbers in a specific state and ratecenter
90 Options: type=unlimited OR type=pri OR withrates=yes
93 Possible Results: unavailable or missing or [list of dids]
97 Orders a specific toll free number in our available list (SLOW)
98 Requires: did=TOLL-FREE-NUMBER
99 Options: routesip=route_to_this_subaccount
100 Possible Results: success or unavailable or missingdid
104 Orders a specific local number from our available list
106 Requires: did=AVAILABLE-LOCAL-NUMBER
108 Options: type=perminute OR type=unlimited OR type=your-pri OR
109 routesip=route_to_this_subaccount
111 Possible Results: invalid or success or missingdid
115 Remove Local or Toll Free DID from account
117 Requires: did=AVAILABLE-LOCAL-NUMBER
119 Possible Results: success OR unavailable OR missingdid
121 =head2 listratecenters
123 Lists all of the available rate centers for a specific state line by line
125 Requires: state=STATE (ie, state=CO)
127 Options: type=perminute OR type=unlimited OR type=pri
129 Possible Results: unavailable OR missingdata OR [list of ratecenters]
131 =head2 listavailratecenters
133 Lists all available rate centers DIDs are currently in stock for a specific state line by line
135 Requires: state=STATE (ie, state=CO)
137 Options: type=unlimited OR type=pri
139 Possible Results: missingdata OR unavailable or [list of ratecenters]
143 Orders a specific available toll free number from the SMS database.
145 Requires: did=8009879891 (number can be any available number)
147 Possible Results: missingdata OR exists OR success
151 Searches the SMS/800 database for an available number matching the specific data you provide
153 Requires: did=8**333****
155 Possible Results: none OR missingdata OR [list of avail numbers]
157 =head2 listavailstates
159 Lists all states that have DIDs which are currently in stock
161 Options: type=perminute OR type=unlimited OR type=pri
163 Possible Results: unavailable OR [list of states]
167 Lists all available DID states line by line
169 Options: type=perminute OR type=unlimited OR type=pri
171 Possible Results: unavailable OR [list of states]
175 Lookup a specific caller id number for the name
177 Requires: did=3037855015 (number)
179 Possible Results: missingdata OR [cnam value]
183 Searches the SMS/800 database for an available number matching the specific data you provide
185 Requires: did=8**333****
187 Possible Results: none OR missingdata OR [list of avail numbers]
189 =head2 localbackorder
191 Orders a specific local number from our available list
193 Requires: ratecenter=RATECENTER and state=STATE
195 Options: type=perminute OR type=unlimited
197 Possible Results: invalid OR ok OR missing
201 Changes the sub account a DID rings to.
203 Requires: did=DID_NUMBER & routesip=SIP_SUB_ACCOUNT
205 Possible Results: missingdata OR ok OR invalid
209 Reports back your current account balance
213 Lists all current Local and Toll free DIDs
217 Results: number,ratecenter,price_per_minute,subaccount
219 extra=yes adds STATE,MONTHLY_DID_RATE
223 Changes the routing on all dids to a specific sip account
225 Requires: routesip=sub_account OR routesip=login (routes to main)
227 Possible Results: ok OR invalid
231 Gets a rate on a specific domestic or International call
233 Requires: number=[countrycode_thenumber] ex: 01144.. or 1303..
235 Results: invalid OR the_rate_per_minute
243 Possible Results: subaccount list separated by return OR invalid
245 =head1 All Possible Result Return Codes
251 The request you made was successful
255 You are missing login= or pass= or cmd= or other in your URL string
259 You have submitted an invalid login or password
263 You are missing the ratecenter or state for a specific local did order
267 The number you requested is not available
271 There are no numbers available
275 you are missing &did=number
279 If you asked for a list of numbers and we had some available, they will be listed.
281 In a list contect, all entries will be returned in a list. In a scalar
282 scalar context, entries will be separated by newlines.
286 Ivan Kohler, C<< <ivan-vitelity at freeside.biz> >>
290 Please report any bugs or feature requests to C<bug-net-vitelity at rt.cpan.org>, or through
291 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Vitelity>. I will be notified, and then you'll
292 automatically be notified of progress on your bug as I make changes.
296 You can find documentation for this module with the perldoc command.
298 perldoc Net::Vitelity
300 You can also look for information at:
304 =item * RT: CPAN's request tracker
306 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Vitelity>
308 =item * AnnoCPAN: Annotated CPAN documentation
310 L<http://annocpan.org/dist/Net-Vitelity>
314 L<http://cpanratings.perl.org/d/Net-Vitelity>
318 L<http://search.cpan.org/dist/Net-Vitelity>
322 =head1 ACKNOWLEDGEMENTS
324 This module was developed by Freeside Internet Services, Inc.
325 If you need a complete, open-source web-based application to manage your
326 customers, billing and trouble ticketing, please visit http://freeside.biz/
328 Development sponsored by Ring Carrier LLC. If you need a hosted or on-site
329 PBX, please visit http://www.ringcarrier.com/
331 =head1 COPYRIGHT & LICENSE
333 Copyright 2009 Freeside Internet Services, Inc.
336 This program is free software; you can redistribute it and/or modify it
337 under the same terms as Perl itself.