avaya 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b1cdddee5b7c3f35a5a9a8f57389d5d94b25baa
4
- data.tar.gz: 14a9fc26699de53c6e61a9e5fc2c135f8215776d
3
+ metadata.gz: 89dd622f3f777a6471b03bb18ec315e01a645814
4
+ data.tar.gz: 632b4719fe77e52d99e599305fcf23df4031eb0d
5
5
  SHA512:
6
- metadata.gz: cece55bf27eb70ac0db2ef7a02fe5b6d05ee94aa6f224097cae77dc2c7bd0c74aadc75f95d2ac544dc9d73b133e3af211b7c3e77c99a074fd6a63e13a4fd78e4
7
- data.tar.gz: ac7b62b30af488eb2e60999291dceb3fef70c354e748a2b43d9f5b93d82a42d9590659cde45b1ee1721d5c4cce69ce7c805cee3a41eb7634cd14ee7282636e48
6
+ metadata.gz: a81ef409cd60c01a8cea2a4ca21991a0ff702713748d5e7269ffd8e9dabaf81eba28da4fa441324cabf23b88ec93fbc51d8567b5bb1e8b211fbf0903b37873f3
7
+ data.tar.gz: 9c24025f1046626d511b95020ab463d142e746a385acc133335dbcd7898c2f7ff2c70b2c99931973ccf7baab94fb5caca14962d308e8a8687f15e783835fec96
@@ -20,4 +20,5 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.6"
22
22
  spec.add_development_dependency "rake", "~> 0"
23
+ spec.add_development_dependency "net-tftp", ">= 0.1.0"
23
24
  end
@@ -4,10 +4,10 @@ module Avaya
4
4
 
5
5
  def initialize
6
6
 
7
- @ras = []
8
- @pots = []
9
- @sip = []
10
- @q93 = []
7
+ @ras = []
8
+ @pots = []
9
+ @sip = []
10
+ @q93 = []
11
11
  @all_calls = Avaya::TFTP.read(:call_list)
12
12
 
13
13
  end
@@ -41,9 +41,9 @@ module Avaya
41
41
  end
42
42
 
43
43
  def ras_line(line)
44
- line = line.split(' ')
44
+ line = line.split(' ')
45
45
  ras_det = {
46
- id: line[0].gsub!(/NAME: /, ''),
46
+ id: line[0].gsub!(/NAME: /, ''),
47
47
  count: line[0].gsub!(/Chans=/, '')
48
48
  }
49
49
  @ras.merge! ras_det
@@ -51,29 +51,29 @@ module Avaya
51
51
  end
52
52
 
53
53
  def sip_line(line)
54
- line = line.split(' ')
54
+ line = line.split(' ')
55
55
  pots_det = {
56
- id: line[0].gsub!(/POTS: /, ''),
56
+ id: line[0].gsub!(/POTS: /, ''),
57
57
  count: line[1].gsub!(/Chans=/, ''),
58
- used: line[2].gsub!(/Used=/, ''),
58
+ used: line[2].gsub!(/Used=/, ''),
59
59
  }
60
60
  @pots.merge! pots_det
61
61
  end
62
62
 
63
63
  def q93_line(line)
64
64
 
65
- line = line.split.gsub(/Q931 PRI TE Version /, 'Q931_PRI_TE_Version_').split(' ')
65
+ line = line.split.gsub(/Q931 PRI TE Version /, 'Q931_PRI_TE_Version_').split(' ')
66
66
  q93_det = {
67
- id: line[0].gsub!(/NAME: /, ''),
68
- count: line[1].gsub!(/Chans=/, ''),
69
- used: line[2].gsub!(/Used=/, ''),
67
+ id: line[0].gsub!(/NAME: /, ''),
68
+ count: line[1].gsub!(/Chans=/, ''),
69
+ used: line[2].gsub!(/Used=/, ''),
70
70
  version: line[4].gsub!(/Version=/, '').gsub!('_', ' ')
71
71
  }
72
72
  @q93.merge! q93_det
73
73
  end
74
74
 
75
75
  def call_line(line)
76
- line = line.gsub(/Line /, 'Line_').split(' ')
76
+ line = line.gsub(/Line /, 'Line_').split(' ')
77
77
  call_det = {
78
78
 
79
79
 
@@ -17,7 +17,7 @@ module Avaya
17
17
  directory.each do |row|
18
18
  row = row.split(",")
19
19
  list << {
20
- name: row[0],
20
+ name: row[0],
21
21
  number: row[1]
22
22
  }
23
23
  end
@@ -1,21 +1,21 @@
1
1
  module Avaya
2
2
  def self.endpoint(end_point, var2 = nil)
3
3
  endpoints = {
4
- who_is: "nasystem/who_is",
4
+ who_is: "nasystem/who_is",
5
5
  licence_list: "nasystem/licence_list",
6
- user_list: "nasystem/user_list#{var2}",
7
- hunt_list: "nasystem/hunt_list",
8
- dir_list: "nasystem/dir_list",
9
- extn_list: "nasystem/extn_list",
10
- accountCode: "nasystem/AccountCode",
11
- user_info: "nasystem/user_info/#{var2}",
12
- user_info2: "nasystem/user_info2/#{var2}",
13
- user_info3: "nasystem/user_info3/#{var2}",
14
- member_of: "nasystem/MemberOf/#{var2}",
15
- call_list: "nasystem/call_list/1/1",
16
- call_info: "nasystem/call_info/#{var2}",
17
- call_info2: "nasystem/call_info2/#{var2}",
18
- hunt_info: "nasystem/hunt_info/#{var2}",
6
+ user_list: "nasystem/user_list#{var2}",
7
+ hunt_list: "nasystem/hunt_list",
8
+ dir_list: "nasystem/dir_list",
9
+ extn_list: "nasystem/extn_list",
10
+ accountCode: "nasystem/AccountCode",
11
+ user_info: "nasystem/user_info/#{var2}",
12
+ user_info2: "nasystem/user_info2/#{var2}",
13
+ user_info3: "nasystem/user_info3/#{var2}",
14
+ member_of: "nasystem/MemberOf/#{var2}",
15
+ call_list: "nasystem/call_list/1/1",
16
+ call_info: "nasystem/call_info/#{var2}",
17
+ call_info2: "nasystem/call_info2/#{var2}",
18
+ hunt_info: "nasystem/hunt_info/#{var2}",
19
19
 
20
20
  }
21
21
  endpoints[end_point]
@@ -16,8 +16,8 @@ module Avaya
16
16
  list= []
17
17
  members.each do |row|
18
18
  list << {
19
- ext: row.sub("*", ""),
20
- active: ((row.include? "*") == false )
19
+ ext: row.sub("*", ""),
20
+ active: ((row.include? "*") == false)
21
21
  }
22
22
  end
23
23
 
@@ -9,7 +9,6 @@ module Avaya
9
9
  def self.get
10
10
  hunt_list = self.new
11
11
  hunt_list.get
12
-
13
12
  end
14
13
 
15
14
  def get
@@ -17,18 +16,16 @@ module Avaya
17
16
  directory.each do |row|
18
17
  row = row.split(",")
19
18
  list << {
20
- name: row[0],
21
- ext: row[1],
22
- queue: row[2],
19
+ name: row[0],
20
+ ext: row[1],
21
+ queue: row[2],
23
22
  voice_mails: row[7],
24
- hunt_id: row[9]
23
+ hunt_id: row[9]
25
24
  }
26
25
  end
27
26
 
28
27
  list
29
- end
30
-
31
28
 
29
+ end
32
30
  end
33
-
34
31
  end
@@ -17,14 +17,12 @@ module Avaya
17
17
  groups.each do |group|
18
18
  group = group.split(",")
19
19
  list << {
20
- group: group[0],
21
- ext: group[1],
22
- queue: group[2] ,
20
+ group: group[0],
21
+ ext: group[1],
22
+ queue: group[2],
23
23
  group_id: group.last
24
-
25
24
  }
26
25
  end
27
-
28
26
  list
29
27
  end
30
28
 
@@ -5,7 +5,7 @@ module Avaya
5
5
 
6
6
  class TFTP
7
7
  def initialize (file)
8
- tftp = Net::TFTP.new(Avaya::Configuration.host)
8
+ tftp = Net::TFTP.new(Avaya::Configuration.host)
9
9
  temp_file = Tempfile.new(random_file)
10
10
  tftp.getbinaryfile(file, temp_file)
11
11
  @file_data = temp_file.read
@@ -1,38 +1,41 @@
1
1
  module Avaya
2
2
  class UserInfo
3
- attr_reader :user, :login_name, :full_name, :ext,
4
- :forward_unconditional, :forward_unconditional_number, :forward_unconditional_all_calls,
5
- :forward_me_to, :forward_busy, :dnd, :voicemail
6
-
7
- def initialize(user)
8
- @search = user
9
- get
10
-
3
+ attr_reader :raw,
4
+ :user,
5
+ :login_name,
6
+ :full_name,
7
+ :ext,
8
+ :forward_unconditional,
9
+ :forward_unconditional_number,
10
+ :forward_unconditional_all_calls,
11
+ :forward_busy,
12
+ :dnd
13
+
14
+ def initialize(ext)
15
+ @ext = ext
11
16
  end
12
17
 
13
- def self.get (user)
14
- user_info = self.new(user)
18
+ def self.get (ext)
19
+ user_info = self.new(ext)
20
+ user_info.get
15
21
  user_info
16
22
  end
17
23
 
18
24
  def get
19
- @user = Avaya::TFTP.read(:"user_info#{3}", @search)
20
- @user = @user[0].split(',')
21
-
22
- @login_name = @user[0]
23
- @full_name = @user[1]
24
- @ext = @user[2]
25
- @forward_busy = @user[3] == "1" ? true : false
26
- @forward_no_answer = @user[4] == "1" ? true : false
27
- @forward_unconditional = @user[5] == "1" ? true : false
28
- @forward_unconditional_number = @user[6]
29
- @dnd = @user[7] == "1" ? true : false
30
-
31
- @forward_unconditional_all_calls = @user[25] == "1" ? true : false
32
- @forward_me_to = @user[8] == "1" ? true : false
33
- @voicemail_to_email = @user[11] == "1" ? true : false
34
- @voicemail_count = @user[11]
35
- "updated"
25
+ @raw = Avaya::TFTP.read(:"user_info#{3}", @ext)
26
+ @user_info = @raw[0].split(',')
27
+
28
+ @login_name = @user_info[0]
29
+ @full_name = @user_info[1]
30
+ @ext = @user_info[2]
31
+ @forward_busy = @user_info[3] == "1" ? true : false
32
+ @forward_no_answer = @user_info[4] == "1" ? true : false
33
+ @forward_unconditional = @user_info[5] == "1" ? true : false
34
+ @forward_unconditional_number = @user_info[6]
35
+ @dnd = @user_info[8] == "1" ? true : false
36
+ @forward_unconditional_all_calls = @user_info[25] == "1" ? true : false
37
+ @voicemail_count = @user_info[11]
38
+ self
36
39
  end
37
40
 
38
41
 
@@ -15,15 +15,15 @@ module Avaya
15
15
  def get
16
16
  list= []
17
17
  user_list.each do |row|
18
- row = row.split(",")
18
+ row = row.split(",")
19
19
  new_row = {
20
- name: row[0],
21
- ext: row[1],
20
+ name: row[0],
21
+ ext: row[1],
22
22
  full_name: row[2],
23
- user_id: row.last
23
+ user_id: row.last
24
24
 
25
25
  }
26
- unless @list_id == "" or @list_id == "2"
26
+ unless @list_id == "" or @list_id == "2"
27
27
  new_row.merge! ex_directory: (row[3] =="1")
28
28
  new_row.merge! active: (row[4] == "1")
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module Avaya
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avaya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Freibuis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-18 00:00:00.000000000 Z
11
+ date: 2014-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: net-tftp
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 0.1.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.1.0
41
55
  description: If you are looking to talk to you Avaya Ip Office then this is the gem
42
56
  for you!
43
57
  email:
@@ -87,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
101
  version: '0'
88
102
  requirements: []
89
103
  rubyforge_project:
90
- rubygems_version: 2.2.2
104
+ rubygems_version: 2.3.0
91
105
  signing_key:
92
106
  specification_version: 4
93
107
  summary: A gem to talk to Avaya Ip Office Platform.