avaya 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/avaya.gemspec +1 -1
- data/lib/avaya/call_list.rb +53 -41
- data/lib/avaya/user_info.rb +26 -8
- data/lib/avaya/version.rb +1 -1
- data/lib/avaya.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 082bb6b5a31180c9f3e830d88c030345128d6b7d
|
4
|
+
data.tar.gz: 4f3eec6f3fc9dbf8b70fee594c6b1abd4b8bc798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2d7386171698b8034e85562a9df3ab2e6be0d850b483d3a1dd028565b80da6c81ef70f3a63a2baa255adb96c2daaab2bafa7db55ba1b91cfc19dc07ec7513b0
|
7
|
+
data.tar.gz: a9623e7c9b17631df471dd628ee5e5a111f449de8fc1a9246a50db62fc5875fa6f1f7266fcc8ef79c3943e5c77d8f0ec32b0bd652c552ff2c01e72858bc86b11
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Avaya Ip Office integration
|
2
|
+
[](http://badge.fury.io/rb/avaya)
|
2
3
|
|
3
4
|
This gem gives limted read only integration from your IPOFFICE (only tested on ip office 500v2)
|
4
5
|
|
@@ -6,6 +7,10 @@ This gem gives limted read only integration from your IPOFFICE (only tested on i
|
|
6
7
|
|
7
8
|
Add this line to your application's Gemfile:
|
8
9
|
|
10
|
+
gem 'avaya'
|
11
|
+
|
12
|
+
or bleeding edge
|
13
|
+
|
9
14
|
gem 'avaya' , :git => 'git://github.com/freibuis/Avaya-IP-Office.git' ,branch: master
|
10
15
|
|
11
16
|
And then execute:
|
@@ -23,7 +28,7 @@ For rails support just run the following command. This will create the initializ
|
|
23
28
|
## Usage
|
24
29
|
|
25
30
|
1st create the connection
|
26
|
-
$ Avaya::Configuration.
|
31
|
+
$ Avaya::Configuration.host = "ip_office_server_ipaddress"
|
27
32
|
|
28
33
|
Once you have set up the connection. you can use the helpers to get data out
|
29
34
|
|
@@ -53,7 +58,7 @@ an array of :name,:ext,:queue,:voice_mails,:hunt_id is returned
|
|
53
58
|
|
54
59
|
## Todo:
|
55
60
|
|
56
|
-
Currently
|
61
|
+
Currently user_info not working as I need to reverse engineer the values from the phone platform
|
57
62
|
|
58
63
|
|
59
64
|
## Contributing
|
data/avaya.gemspec
CHANGED
data/lib/avaya/call_list.rb
CHANGED
@@ -1,39 +1,45 @@
|
|
1
1
|
module Avaya
|
2
2
|
class CallList
|
3
|
-
attr_reader :
|
3
|
+
attr_reader :raw,
|
4
|
+
:name,
|
5
|
+
:ras,
|
6
|
+
:pots,
|
7
|
+
:sip,
|
8
|
+
:q93,
|
9
|
+
:calls
|
4
10
|
|
5
11
|
def initialize
|
6
12
|
|
7
|
-
@ras
|
8
|
-
@pots
|
9
|
-
@sip
|
10
|
-
@q93
|
11
|
-
@
|
13
|
+
@ras = []
|
14
|
+
@pots = []
|
15
|
+
@sip = []
|
16
|
+
@q93 = []
|
17
|
+
@calls = []
|
18
|
+
@raw = Avaya::TFTP.read(:call_list)
|
12
19
|
|
13
20
|
end
|
14
21
|
|
15
22
|
def self.get
|
16
23
|
call_list = self.new
|
17
24
|
call_list.get
|
18
|
-
|
25
|
+
call_list
|
19
26
|
end
|
20
27
|
|
21
28
|
def get
|
22
29
|
|
23
30
|
#items = @all_calls.collect { |row| row.gsub(/Line /, 'Line_').split(' ') }
|
24
|
-
@
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
call_line(call)
|
31
|
+
@raw.each do |call|
|
32
|
+
if call.start_with?("NAME: ")
|
33
|
+
@name = call.gsub!('NAME: ', '').gsub!('"', '')
|
34
|
+
elsif call.start_with? "RAS:"
|
35
|
+
ras_line(call)
|
36
|
+
elsif call.start_with? "SIPLine:"
|
37
|
+
sip_line(call)
|
38
|
+
elsif call.start_with? "Q931Line:"
|
39
|
+
q93_line(call)
|
40
|
+
|
41
|
+
elsif call.start_with? "CALL:"
|
42
|
+
call_line(call)
|
37
43
|
end
|
38
44
|
|
39
45
|
end
|
@@ -41,46 +47,52 @@ module Avaya
|
|
41
47
|
end
|
42
48
|
|
43
49
|
def ras_line(line)
|
44
|
-
line = line.split(' ')
|
45
50
|
ras_det = {
|
46
|
-
id: line[0].gsub!(/
|
47
|
-
count: line[0].gsub!(/Chans=/, '')
|
51
|
+
id: line.match(/^RAS: [0-9]*/).to_s.gsub!(/RAS: /, ''),
|
52
|
+
count: line.match(/Chans=[0-9]*/).to_s.gsub!(/Chans=/, '')
|
48
53
|
}
|
49
|
-
@ras
|
54
|
+
@ras << ras_det
|
50
55
|
|
51
56
|
end
|
52
57
|
|
53
58
|
def sip_line(line)
|
54
|
-
line = line.split(' ')
|
55
59
|
pots_det = {
|
56
|
-
id: line[0].gsub!(/
|
57
|
-
count: line[
|
58
|
-
used: line[
|
60
|
+
id: line.match(/^SIPLine: [0-9]*/).to_s.gsub!(/SIPLine: /, ''),
|
61
|
+
count: line.match(/Chans=[0-9]*/).to_s.gsub!(/Chans=/, ''),
|
62
|
+
used: line.match(/Used=[0-9]*/).to_s.gsub!(/Used=/, ''),
|
59
63
|
}
|
60
|
-
@pots
|
64
|
+
@pots << pots_det
|
61
65
|
end
|
62
66
|
|
63
67
|
def q93_line(line)
|
64
68
|
|
65
|
-
line = line.split.gsub(/Q931 PRI TE Version /, 'Q931_PRI_TE_Version_').split(' ')
|
66
69
|
q93_det = {
|
67
|
-
id: line[0].gsub!(/
|
68
|
-
count: line[
|
69
|
-
used: line[
|
70
|
-
version: line
|
70
|
+
id: line.match(/^Q931Line: [0-9]*/).to_s.gsub!(/Q931Line: /, ''),
|
71
|
+
count: line.match(/Chans=[0-9]*/).to_s.gsub!(/Chans=/, ''),
|
72
|
+
used: line.match(/Used=[0-9]*/).to_s.gsub!(/Used=/, ''),
|
73
|
+
version: line.match(/Version=.*/).to_s.gsub!(/Version=/, '')
|
71
74
|
}
|
72
|
-
@q93
|
75
|
+
@q93 << q93_det
|
73
76
|
end
|
74
77
|
|
75
78
|
def call_line(line)
|
76
|
-
|
77
|
-
call_det
|
78
|
-
|
79
|
-
|
79
|
+
puts line
|
80
|
+
call_det= {
|
81
|
+
call_id: line.match(/^CALL: [0-9.]*/).to_s.gsub!(/CALL: /, ''),
|
82
|
+
state: line.match(/ State=[0-9]*/).to_s.gsub!(/ State=/, ''),
|
83
|
+
cut: line.match(/Cut=[0-9]*/).to_s.gsub!(/Cut=/, ''),
|
84
|
+
music: line.match(/Music=[0-9.]*/).to_s.gsub!(/Music=/, ''),
|
85
|
+
a_end: line.match(/Aend=[a-zA-Z0-9"()]*\s[()0-9.]*/).to_s.gsub!(/Aend=/, ''),
|
86
|
+
b_end: line.match(/Bend=[a-zA-Z0-9"()]*\s[\[\]a-zA-Z0-9()]*\s[0-9().]*/).to_s.gsub!(/Bend=/, ''),
|
87
|
+
called_num: line.match(/CalledNum=[0-9]*\s[()a-zA-Z0-9]*/).to_s.gsub!(/CalledNum=/, ''),
|
88
|
+
calling_num: line.match(/CallingNum=[0-9]*\s[()a-zA-Z0-9]*/).to_s.gsub!(/CallingNum=/, ''),
|
89
|
+
internal: line.match(/Internal=[0-9]*/).to_s.gsub!(/Internal=/, '').to_i,
|
90
|
+
time: line.match(/Time=[0-9]*/).to_s.gsub!(/Time=/, '').to_i,
|
91
|
+
astate: line.match(/AState=[0-9]*/).to_s.gsub!(/AState=/, '').to_i
|
80
92
|
}
|
81
|
-
end
|
82
93
|
|
94
|
+
@calls << call_det
|
83
95
|
|
96
|
+
end
|
84
97
|
end
|
85
|
-
|
86
98
|
end
|
data/lib/avaya/user_info.rb
CHANGED
@@ -9,7 +9,16 @@ module Avaya
|
|
9
9
|
:forward_unconditional_number,
|
10
10
|
:forward_unconditional_all_calls,
|
11
11
|
:forward_busy,
|
12
|
-
:dnd
|
12
|
+
:dnd,
|
13
|
+
:logged_in,
|
14
|
+
:connected_party,
|
15
|
+
:phone_state,
|
16
|
+
:absent_option,
|
17
|
+
:absent_extra_info,
|
18
|
+
:absent_enabled,
|
19
|
+
:ext_template,
|
20
|
+
:twinning_number,
|
21
|
+
:twinning_enabled
|
13
22
|
|
14
23
|
def initialize(ext)
|
15
24
|
@ext = ext
|
@@ -27,14 +36,23 @@ module Avaya
|
|
27
36
|
|
28
37
|
@login_name = @user_info[0]
|
29
38
|
@full_name = @user_info[1]
|
30
|
-
@ext = @user_info[2]
|
31
|
-
@forward_busy = @user_info[3] == "1"
|
32
|
-
@forward_no_answer = @user_info[4] == "1"
|
33
|
-
@forward_unconditional = @user_info[5] == "1"
|
39
|
+
@ext = Integer(@user_info[2])
|
40
|
+
@forward_busy = @user_info[3] == "1"
|
41
|
+
@forward_no_answer = @user_info[4] == "1"
|
42
|
+
@forward_unconditional = @user_info[5] == "1"
|
34
43
|
@forward_unconditional_number = @user_info[6]
|
35
|
-
@dnd = @user_info[8] == "1"
|
36
|
-
|
37
|
-
@
|
44
|
+
@dnd = @user_info[8] == "1"
|
45
|
+
#Phone State "no" onhook ,"og" Out Going,"in" Incoming
|
46
|
+
@phone_state = @user_info[19]
|
47
|
+
@connected_party = @user_info[20]
|
48
|
+
@forward_unconditional_all_calls = @user_info[25] == "1"
|
49
|
+
@logged_in = @user_info[44] == "1"
|
50
|
+
@absent_option = Integer(@user_info[37])
|
51
|
+
@absent_extra_info = @user_info[38]
|
52
|
+
@absent_enabled = @user_info[39] == "1"
|
53
|
+
@ext_template = @user_info[53]
|
54
|
+
@twinning_number = @user_info[67]
|
55
|
+
@twinning_enabled = @user_info[68]== "1"
|
38
56
|
self
|
39
57
|
end
|
40
58
|
|
data/lib/avaya/version.rb
CHANGED
data/lib/avaya.rb
CHANGED
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.
|
4
|
+
version: 0.0.4
|
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-
|
11
|
+
date: 2014-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,14 +42,14 @@ dependencies:
|
|
42
42
|
name: net-tftp
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 0.1.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.1.0
|
55
55
|
description: If you are looking to talk to you Avaya Ip Office then this is the gem
|