vitelity 1.0.0 → 1.0.1

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 +4 -4
  2. data/lib/vitelity.rb +91 -108
  3. metadata +1 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3bdd8eaafe5d4e4bf4c438b0fe6cd9ae73c6a08d
4
- data.tar.gz: 153ebe2ff329811f99d76d6a9398571cbe17a060
3
+ metadata.gz: 1bb8982ece0d34fa816fcc6a7e834052d15ed1b9
4
+ data.tar.gz: 033852cb71cd065331edb7bf468b4c621b79dfbd
5
5
  SHA512:
6
- metadata.gz: a51ac1ffbe5f7b6ebca9155ed1e8bc72d4068ac32ce30e5cd11348134262ecda80dcbaa85f4f3a18b2b23fbe724831acc791d7b1b9a5df2b19e9d656cb6a76ed
7
- data.tar.gz: 5bf05bfa28973e621d83f08350252cd6be63a0e5630bf998b78d7d5000a7d06ab342aa84e9a1747424523db74837c76afc79bae85d35731fe299b8a06eef0596
6
+ metadata.gz: 1f04506e893a67d63c32009db3224a83024c678b33a4e44c74f448e1043c8efe0d3ba07f05f58317823150a169584b3e2bbed7765aa4a6419bec5c49a72efe31
7
+ data.tar.gz: 8243801d8ed686ee56e28b6e419659005afeca27113c5b06cc8f08763f6155da43dc28b9986670ddceb715575772b45b68c1f0807be45ea1ac8b6ef549d75978
@@ -2,118 +2,101 @@
2
2
  # encoding: utf-8
3
3
 
4
4
  require 'rest_client'
5
- require 'awesome_print'
6
5
  require 'active_support/core_ext/hash/conversions'
7
6
 
8
7
  class Vitelity
9
8
 
10
9
  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
- }
10
+ {"balance"=>"http://api.vitelity.net/api.php",
11
+ "cdrlist"=>"http://api.vitelity.net/api.php",
12
+ "resetcdrlist"=>"http://api.vitelity.net/api.php",
13
+ "didcdrdetail"=>"http://api.vitelity.net/api.php",
14
+ "subaccountcdrdetail"=>"http://api.vitelity.net/api.php",
15
+ "listtollfree"=>"http://api.vitelity.net/api.php",
16
+ "listlocal"=>"http://api.vitelity.net/api.php",
17
+ "listnpanxx"=>"http://api.vitelity.net/api.php",
18
+ "listratecenters"=>"http://api.vitelity.net/api.php",
19
+ "listavailratecenters"=>"http://api.vitelity.net/api.php",
20
+ "searchtoll"=>"http://api.vitelity.net/api.php",
21
+ "listavailstates"=>"http://api.vitelity.net/api.php",
22
+ "liststates"=>"http://api.vitelity.net/api.php",
23
+ "listdids"=>"http://api.vitelity.net/api.php",
24
+ "didnote"=>"http://api.vitelity.net/api.php",
25
+ "listintlratecenters"=>"http://api.vitelity.net/api.php",
26
+ "listintl"=>"http://api.vitelity.net/api.php",
27
+ "getdidnote"=>"http://api.vitelity.net/api.php",
28
+ "listspecificlocal"=>"http://api.vitelity.net/api.php",
29
+ "listnpa"=>"http://api.vitelity.net/api.php",
30
+ "lidb"=>"http://api.vitelity.net/api.php",
31
+ "lidbavailall"=>"http://api.vitelity.net/api.php",
32
+ "getbackorder"=>"http://api.vitelity.net/api.php",
33
+ "gettollfree"=>"http://api.vitelity.net/api.php",
34
+ "getlocaldid"=>"http://api.vitelity.net/api.php",
35
+ "removedid"=>"http://api.vitelity.net/api.php",
36
+ "requestvanity"=>"http://api.vitelity.net/api.php",
37
+ "localbackorder"=>"http://api.vitelity.net/api.php",
38
+ "getintldid"=>"http://api.vitelity.net/api.php",
39
+ "localbackorderrate"=>"http://api.vitelity.net/api.php",
40
+ "didforcebilling"=>"http://api.vitelity.net/api.php",
41
+ "e911send"=>"http://api.vitelity.net/api.php",
42
+ "e911delete"=>"http://api.vitelity.net/api.php",
43
+ "e911checkaddress"=>"http://api.vitelity.net/api.php",
44
+ "e911getinfo"=>"http://api.vitelity.net/api.php",
45
+ "listincomingfaxes"=>"http://api.vitelity.net/fax.php",
46
+ "getfax"=>"http://api.vitelity.net/fax.php",
47
+ "sentfaxstatus"=>"http://api.vitelity.net/fax.php",
48
+ "sendfax"=>"http://api.vitelity.net/fax.php",
49
+ "faxlistdids"=>"http://api.vitelity.net/fax.php",
50
+ "faxgetdid"=>"http://api.vitelity.net/fax.php",
51
+ "faxlistratecenters"=>"http://api.vitelity.net/fax.php",
52
+ "faxliststates"=>"http://api.vitelity.net/fax.php",
53
+ "faxchangeemail"=>"http://api.vitelity.net/fax.php",
54
+ "newfaxacc"=>"http://api.vitelity.net/fax.php",
55
+ "setfaxacc"=>"http://api.vitelity.net/fax.php",
56
+ "allowdidchangeemail"=>"http://api.vitelity.net/fax.php",
57
+ "allowoutchangeemail"=>"http://api.vitelity.net/fax.php",
58
+ "increasecredits"=>"http://api.vitelity.net/fax.php",
59
+ "setcredits"=>"http://api.vitelity.net/fax.php",
60
+ "getcredits"=>"http://api.vitelity.net/fax.php",
61
+ "setlimit"=>"http://api.vitelity.net/fax.php",
62
+ "faxlistmydids"=>"http://api.vitelity.net/fax.php",
63
+ "delfaxacc"=>"http://api.vitelity.net/api.php",
64
+ "addport"=>"http://api.vitelity.net/lnp.php",
65
+ "uploadsignature"=>"http://api.vitelity.net/lnp.php",
66
+ "uploadbill"=>"http://api.vitelity.net/lnp.php",
67
+ "checkavail"=>"http://api.vitelity.net/lnp.php",
68
+ "checkmultiavail"=>"http://api.vitelity.net/lnp.php",
69
+ "callfromclick"=>"http://api.vitelity.net/api.php",
70
+ "reroute"=>"http://api.vitelity.net/api.php",
71
+ "routeall"=>"http://api.vitelity.net/api.php",
72
+ "getrate"=>"http://api.vitelity.net/api.php",
73
+ "subaccounts"=>"http://api.vitelity.net/api.php",
74
+ "failover"=>"http://api.vitelity.net/api.php",
75
+ "callfw"=>"http://api.vitelity.net/api.php",
76
+ "newvoicemail"=>"http://api.vitelity.net/api.php",
77
+ "resetvoicemail"=>"http://api.vitelity.net/api.php",
78
+ "listvoicemails"=>"http://api.vitelity.net/api.php",
79
+ "addvoicemailtodid"=>"http://api.vitelity.net/api.php",
80
+ "cnamenable"=>"http://api.vitelity.net/api.php",
81
+ "cnamdisable"=>"http://api.vitelity.net/api.php",
82
+ "cnamstatus"=>"http://api.vitelity.net/api.php",
83
+ "addsubacc"=>"http://api.vitelity.net/api.php",
84
+ "delsubacc"=>"http://api.vitelity.net/api.php",
85
+ "lidbavail"=>"http://api.vitelity.net/api.php",
86
+ "lidbcheck"=>"http://api.vitelity.net/api.php",
87
+ "remvoicemail"=>"http://api.vitelity.net/api.php",
88
+ "migratedids"=>"http://api.vitelity.net/api.php",
89
+ "massreroute"=>"http://api.vitelity.net/api.php",
90
+ "checksms"=>"http://api.vitelity.net/api.php",
91
+ "removesms"=>"http://api.vitelity.net/api.php",
92
+ "smsdids"=>"http://api.vitelity.net/api.php",
93
+ "smsenableurl"=>"http://api.vitelity.net/api.php",
94
+ "sendsms"=>"http://smsout-api.vitelity.net/api.php",
95
+ "setsms"=>"http://api.vitelity.net/api.php",
96
+ "smsenablehtt"=>"http://api.vitelity.net/api.php",
97
+ "sendshort"=>"http://smsout-api.vitelity.net/api.php",
98
+ "cnam"=>"http://api.vitelity.net/api.php",
99
+ "npanxxlookup"=>"http://api.vitelity.net/api.php"}
117
100
  end
118
101
 
119
102
  def initialize(u,p)
@@ -135,7 +118,7 @@ class Vitelity
135
118
  if args[0].is_a? Hash
136
119
  options.merge!(args[0])
137
120
  end
138
- res = RestClient.post("http://api.vitelity.net/api.php", options)
121
+ res = RestClient.post(self.commands[ options[:cmd].to_s ], options)
139
122
  if res
140
123
  return Hash.from_xml(res)
141
124
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vitelity
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Collazo
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
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
27
  - !ruby/object:Gem::Dependency
42
28
  name: activesupport
43
29
  requirement: !ruby/object:Gem::Requirement