vitelity 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/vitelity.rb +145 -0
  3. metadata +85 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3bdd8eaafe5d4e4bf4c438b0fe6cd9ae73c6a08d
4
+ data.tar.gz: 153ebe2ff329811f99d76d6a9398571cbe17a060
5
+ SHA512:
6
+ metadata.gz: a51ac1ffbe5f7b6ebca9155ed1e8bc72d4068ac32ce30e5cd11348134262ecda80dcbaa85f4f3a18b2b23fbe724831acc791d7b1b9a5df2b19e9d656cb6a76ed
7
+ data.tar.gz: 5bf05bfa28973e621d83f08350252cd6be63a0e5630bf998b78d7d5000a7d06ab342aa84e9a1747424523db74837c76afc79bae85d35731fe299b8a06eef0596
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ require 'rest_client'
5
+ require 'awesome_print'
6
+ require 'active_support/core_ext/hash/conversions'
7
+
8
+ class Vitelity
9
+
10
+ def commands
11
+ {
12
+ "balance"=>"reports back your current account balance",
13
+ "cdrlist"=> "Gives all NEW CDR records and keeps track of which ones you have VS. which ones you do not. Can only be ran in 5 minute intervals",
14
+ "resetcdrlist"=> "Reset CDR records for the cdrlist API command (you cannot undo this)",
15
+ "didcdrdetail"=> "Give the seconds of use and cost for a specific did for a timeframe",
16
+ "subaccountcdrdetail"=> "Pull details records for a specific sub account for a date range",
17
+ "listtollfree"=> "lists all Toll Free Numbers that are available for immediate order",
18
+ "listlocal"=>"lists all local DID numbers currently in stock",
19
+ "listnpanxx"=>"lists all available local numbers with a specific NPANXX",
20
+ "listratecenters"=> "lists all of the ratecenters available for a specific state",
21
+ "listavailratecenters"=> "lists all ratecenters that we currently have in stock",
22
+ "searchtoll"=> "searches the SMS/800 database for a specific vanity number or numbers",
23
+ "listavailstates"=> "lists all states that have DIDs which are currently in stock",
24
+ "liststates"=>"Lists all available DID states line by line",
25
+ "listdids"=>"lists all current Local and Toll free DIDs",
26
+ "didnote"=>"Add note to DID for future reference",
27
+ "listintlratecenters"=> "Lists all international ratecenters for a specific country",
28
+ "listintl"=>"Lists all countries supported for International DIDs",
29
+ "getdidnote"=>"Get the current DID note set for a specific DID",
30
+ "listspecificlocal"=> "Lists the rates assocated with a specific and Available DID number",
31
+ "listnpa"=> "lists all available local numbers with a specific NPA / Area code",
32
+ "lidb"=>"Set the CallerID Name for a specific number (LIDB / CNAM)",
33
+ "lidbavailall"=> "List all numbers where LIDB / CallerID / CNAM name change is available",
34
+ "getbackorder"=> "Get the status of a DID backorder to tell if it's been filled",
35
+ "gettollfree"=>"Orders a specific toll free number in our available list",
36
+ "getlocaldid"=>"orders a specific local number in our available list",
37
+ "removedid"=>"Remove a currently assigned DID number",
38
+ "requestvanity"=> "orders a specific toll free number from the SMS800 available pool",
39
+ "localbackorder"=> "back orders a specific ratecenter/state that is not in stock",
40
+ "getintldid"=> "Orders a specific international DID based on ratecenter/country",
41
+ "localbackorderrate"=>"Get rate for backordering a ratecenter",
42
+ "didforcebilling"=> "Force the billing for a specific DID to a certain sub account",
43
+ "e911send"=>"Input or update new 911 address for a specific DID number",
44
+ "e911delete"=>"Delete a registered 911 address from a specific DID",
45
+ "e911checkaddress"=>"Check eligibility of a specific address for 911 service",
46
+ "e911getinfo"=>"Get 911 information on a specific DID Number",
47
+ "listincomingfaxes"=>"Lists all incoming faxes",
48
+ "getfax"=>"Retrieve a specific fax from our system",
49
+ "sentfaxstatus"=>"Lists all or specific info on sent faxes",
50
+ "sendfax"=>"Allows you to send a fax over the API",
51
+ "faxlistdids"=>"List vfax DID numbers available for purchase",
52
+ "faxgetdid"=>"Order a specific vfax DID number to your account",
53
+ "faxlistratecenters"=> "Lists all of the available rate centers for a specific state line by line",
54
+ "faxliststates"=>"Lists all of the available states line by line",
55
+ "faxchangeemail"=> "Changes email addresses assigned to a vFax DID (new faxes are emailed here)",
56
+ "newfaxacc"=> "Creates new vFax account for use with viewmyfax.com/faxcentral.net",
57
+ "setfaxacc"=>"Set DIDs associated to vFax account",
58
+ "allowdidchangeemail"=> "This option allows end user to modify the email addresses faxes are sent to when they receive a fax",
59
+ "allowoutchangeemail"=> "Allows user to update the email addresses for sending out faxes to number@emailyourfax.com.",
60
+ "increasecredits"=> "Increases the number of DIDs a specific vFax account is allowed to order. ",
61
+ "setcredits"=> "Set the number of DIDs a vfax account can order through viewmyfax portal",
62
+ "getcredits"=>
63
+ "Return how many DID order credits a customer has remaining on a vfax account",
64
+ "setlimit"=>
65
+ "Set the number of daily outbound faxes a specific vFax account can send per day",
66
+ "faxlistmydids"=>"Return a full list of your vfax numbers",
67
+ "delfaxacc"=>"Remove existing vFax account",
68
+ "addport"=>"Add LNP order",
69
+ "uploadsignature"=>
70
+ "Upload Signature for LNP order if required. Must be 225 pixels by 50 pixels in size, in JPG, GIF, PNG or BMP format.",
71
+ "uploadbill"=>
72
+ "Upload Bill for LNP order if required. Bill copy must be in PDF or JPG formats. PDF Recommended.",
73
+ "checkavail"=>"Check LNP Availability for DID Number",
74
+ "checkmultiavail"=>
75
+ "Check LNP Availability for multiple DID Numbers at once. Will respond with number:support. (support may be voice, both or nosupport) Both means Voice & vFax.",
76
+ "callfromclick"=>
77
+ "Sends someone a phone call that then connects them to customer service/another number.",
78
+ "reroute"=>"changes the sub account or IP that the DID routes to",
79
+ "routeall"=>
80
+ "Changes routing for ALL of your DID numbers to a specific IP or sub account",
81
+ "getrate"=>
82
+ "Gets a rate on a specific domestic or International call (ex:011-number or 1-number)",
83
+ "subaccounts"=>"Lists all sub accounts",
84
+ "failover"=>"Set fail over for a specific DID number",
85
+ "callfw"=>"Set call forwarding for specific DID",
86
+ "newvoicemail"=>
87
+ "New voicemail account - Allows you to create a new voicemail account",
88
+ "resetvoicemail"=>"Reset voicemail password for specific account",
89
+ "listvoicemails"=>"List all voicemail accounts",
90
+ "addvoicemailtodid"=>"Link a voicemail account to a did number ",
91
+ "cnamenable"=>"Enable CNAM Services on a specific DID",
92
+ "cnamdisable"=>"Disable CNAM on a specific DID number",
93
+ "cnamstatus"=>
94
+ "Check whether CNAM is disabled or enabled on a specific DID Number",
95
+ "addsubacc"=>"Add a sub account or SIP peer to your account",
96
+ "delsubacc"=>
97
+ "Delete a SIP Peer or Sub Account from your account (irreversible)",
98
+ "lidbavail"=>
99
+ "Verify availability of CallerID name on a specific DID (only works on limited DID numbers)",
100
+ "lidbcheck"=>"Give status of a lidb request",
101
+ "remvoicemail"=>"Delete voicemail account",
102
+ "migratedids"=>"Migrate DID Numbers from one sub account to another",
103
+ "massreroute"=>"changes the sub account or IP that multiple DIDs routes to",
104
+ "checksms"=>"Check availability of SMS on a specific DID",
105
+ "removesms"=>"Remove SMS from a specific DID number",
106
+ "smsdids"=>"List all DIDs that you OWN and have SMS functionality available",
107
+ "smsenableurl"=>
108
+ "Set the URL for SMS messages to be delivered to for SMS+http enabled DIDs",
109
+ "sendsms"=>"Send an SMS message from an SMS enabled DID number",
110
+ "setsms"=>"Enable SMS functionality on a specific DID",
111
+ "smsenablehtt"=>
112
+ "Enable SMS functionality on a specific DID and sends via an HTTPD request. Will POST the variables: $msgid, $src, $dst and $msg to your URL.",
113
+ "sendshort"=>"Send Short Code SMS messages over API",
114
+ "cnam"=>"looks up the specific caller id name for a specific number",
115
+ "npanxxlookup"=>"Lookup Ratecenter & State name in LERG format"
116
+ }
117
+ end
118
+
119
+ def initialize(u,p)
120
+ @username = u
121
+ @password = p
122
+ end
123
+
124
+ def method_missing(*args)
125
+ options = {
126
+ :login => @username,
127
+ :pass => @password,
128
+ :cmd => args.shift,
129
+ :xml => :yes
130
+ }
131
+ unless self.commands[ options[:cmd].to_s ]
132
+ raise "Invalid API Command: #{options[:cmd]}"
133
+ end
134
+
135
+ if args[0].is_a? Hash
136
+ options.merge!(args[0])
137
+ end
138
+ res = RestClient.post("http://api.vitelity.net/api.php", options)
139
+ if res
140
+ return Hash.from_xml(res)
141
+ else
142
+ raise "No data!"
143
+ end
144
+ end
145
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vitelity
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - David Collazo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: awesome_print
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: A gem for utilizing the Vitelity API
56
+ email: davidcollazo@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - lib/vitelity.rb
62
+ homepage: https://github.com/dcollazo/vitelity_gem
63
+ licenses: []
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.0.3
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Vitelity API
85
+ test_files: []