echi-converter 0.3.3 → 0.3.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.
- data/History.txt +22 -1
- data/Manifest.txt +5 -0
- data/config/application.yml +9 -4
- data/config/database.yml +3 -2
- data/config/extended_version12.yml +50 -2
- data/config/extended_version13.yml +50 -2
- data/config/install_files.yml +9 -0
- data/config/standard_version12.yml +50 -2
- data/config/standard_version13.yml +50 -2
- data/db/migrate/001_create_echi_records.rb +1 -1
- data/db/migrate/003_create_echi_agents.rb +15 -3
- data/db/migrate/006_create_echi_aux_reasons.rb +27 -0
- data/db/migrate/007_create_echi_cwcs.rb +27 -0
- data/db/migrate/008_create_echi_vdns.rb +27 -0
- data/examples/db_connect_test.rb +25 -0
- data/lib/database.rb +10 -1
- data/lib/echi-converter.rb +244 -233
- data/lib/echi-converter/version.rb +1 -1
- data/lib/ftp_fetcher.rb +82 -0
- data/lib/main.rb +7 -4
- data/lib/main_win32.rb +5 -4
- data/website/index.html +36 -6
- data/website/index.txt +23 -3
- metadata +7 -2
data/History.txt
CHANGED
@@ -133,4 +133,25 @@
|
|
133
133
|
* Added error traps for ECHI_LOGS
|
134
134
|
* Bug fix(es):
|
135
135
|
* Fixed a bug where the utility was not properly deleting the files from the ftp server
|
136
|
-
* Fixed a bug for the pco schema usage changing the echi_log column processed_at to processedat via the 005_change_log_processedat_name migration
|
136
|
+
* Fixed a bug for the pco schema usage changing the echi_log column processed_at to processedat via the 005_change_log_processedat_name migration
|
137
|
+
|
138
|
+
== 0.3.4 2007-11-TBD
|
139
|
+
|
140
|
+
* Major enhancement(s):
|
141
|
+
* Minor enhancement(s):
|
142
|
+
* Added a database test script to examples/db_connect_test.rb
|
143
|
+
* Set the default ftp port in application.yml to 21
|
144
|
+
* Properly report that the database has been initialized at the start of processing as opposed to a successful connection
|
145
|
+
* Encapsulate the ASCII/BINARY database transactions in Begin/Rescue clauses to report on additional database issues that might arise
|
146
|
+
* Changed the schema YML references to 'echi_records' from 'fields' in order to use that file to store additional database table definitions
|
147
|
+
* Changed the default databse name to 'echi' in database.yml
|
148
|
+
* Added 006_create_echi_aux_reasons.rb, 007_create_echi_cwcs.rb and 008_create_echi_vdns.rb migrations following the same format as 001_create_echi_records.rb
|
149
|
+
* Startup sequence now shows which settings were used
|
150
|
+
* Changed the application.yml setting of echi_update_agent_data to echi_process_dat_files
|
151
|
+
* Refactored logging mechanism
|
152
|
+
* Added support for additional '.dat' files including aux_rsn.dat, cwc.dat and vdn.dat
|
153
|
+
* Added utf8 encoding option to config/database.yml
|
154
|
+
* Refactored FTP management into a new class
|
155
|
+
* FTP now supports setting an alternative port by setting 'echi_port' in the application.yml file
|
156
|
+
* Added option in config/application.yml, 'max_ftp_sessions', to allow for multiple ftp sessions to be used to increase ftp interaction performance
|
157
|
+
* Bug fix(es):
|
data/Manifest.txt
CHANGED
@@ -10,6 +10,7 @@ lib/database_presence.rb
|
|
10
10
|
lib/main.rb
|
11
11
|
lib/main_win32.rb
|
12
12
|
lib/echi-converter.rb
|
13
|
+
lib/ftp_fetcher.rb
|
13
14
|
scripts/txt2html
|
14
15
|
setup.rb
|
15
16
|
test/test_echi-converter.rb
|
@@ -31,8 +32,12 @@ db/migrate/002_create_echi_logs.rb
|
|
31
32
|
db/migrate/003_create_echi_agents.rb
|
32
33
|
db/migrate/004_change_log_name_size.rb
|
33
34
|
db/migrate/005_change_log_processedat_name.rb
|
35
|
+
db/migrate/006_create_echi_aux_reasons.rb
|
36
|
+
db/migrate/007_create_echi_cwcs.rb
|
37
|
+
db/migrate/008_create_echi_vdns.rb
|
34
38
|
bin/echi-converter
|
35
39
|
examples/extended_version12/chr0003
|
36
40
|
examples/extended_version12/chr0003.txt
|
37
41
|
examples/schemas/oracle_echi.sql
|
38
42
|
examples/ascii_csv/chr5500.123
|
43
|
+
examples/db_connect_test.rb
|
data/config/application.yml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
#Connection details for the Avaya CMS/ECHI host
|
4
4
|
echi_host: localhost
|
5
|
-
echi_port:
|
5
|
+
echi_port: 21
|
6
6
|
echi_username: anonymous
|
7
7
|
echi_password:
|
8
8
|
echi_connect_type: ftp #only ftp supported now, possible for ssh in the future
|
@@ -12,14 +12,19 @@ echi_ftp_delete: Y #to not delete the files off of the FTP server set to N, Y t
|
|
12
12
|
echi_schema: extended_version13.yml
|
13
13
|
echi_format: BINARY #valid settings are ASCII or BINARY
|
14
14
|
echi_process_log: Y #valid is Y/N to turn it on or off
|
15
|
-
|
16
|
-
|
15
|
+
echi_process_dat_files: N #Insert additional tables with data from the '.dat' files, and update regularly (not available when 'pco_process' set to 'Y')
|
16
|
+
#Filenames of the dat files
|
17
|
+
echi_agent_dat: agname.dat
|
18
|
+
echi_aux_rsn_dat: aux_rsn.dat
|
19
|
+
echi_cwc_dat: cwc.dat
|
20
|
+
echi_vdn_dat: vdn.dat
|
17
21
|
|
18
22
|
#Currently only ftp supported, but may want to add SSH/SFTP later
|
19
23
|
echi_xfer_type: ftp
|
20
24
|
|
21
25
|
#How frequently to fetch records off of the Avaya CMS ftp server
|
22
26
|
fetch_interval: 60 #in seconds
|
27
|
+
max_ftp_sessions: 2 #Number of simultaneous ftp connections to use
|
23
28
|
|
24
29
|
#Whether or not to insert into a database, into a csv file or both
|
25
30
|
export_type: database
|
@@ -44,4 +49,4 @@ smtp_server: smtp.yourdomain.com
|
|
44
49
|
smtp_port: 25
|
45
50
|
|
46
51
|
#Special settings for a specific application database
|
47
|
-
pco_process: N #Set to
|
52
|
+
pco_process: N #Set to Y (yes) to enable using the PCO database or to no N (no) if not using the PCO database
|
data/config/database.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#ECH File construct, order is important, as the application sequentially reads the file
|
2
2
|
#Version 12 - Extended Schema
|
3
|
-
|
3
|
+
echi_records:
|
4
4
|
- name: callid
|
5
5
|
type: int
|
6
6
|
length: 4
|
@@ -231,4 +231,52 @@ fields:
|
|
231
231
|
length: 8
|
232
232
|
- name: asaiuui
|
233
233
|
type: str
|
234
|
-
length: 96
|
234
|
+
length: 96
|
235
|
+
|
236
|
+
#Agents table definition derived from agname.dat
|
237
|
+
echi_agents:
|
238
|
+
- name: group_id
|
239
|
+
type: str
|
240
|
+
length: 255
|
241
|
+
- name: login_id
|
242
|
+
type: str
|
243
|
+
length: 255
|
244
|
+
- name: name
|
245
|
+
type: str
|
246
|
+
length: 255
|
247
|
+
|
248
|
+
#Aux Reasons table definition derived from aux_rsn.dat
|
249
|
+
echi_aux_reasons:
|
250
|
+
- name: group_id
|
251
|
+
type: str
|
252
|
+
length: 255
|
253
|
+
- name: aux_reason
|
254
|
+
type: str
|
255
|
+
length: 255
|
256
|
+
- name: name
|
257
|
+
type: str
|
258
|
+
length: 255
|
259
|
+
|
260
|
+
#CWC definition derived from cwc.dat
|
261
|
+
echi_cwcs:
|
262
|
+
- name: group_id
|
263
|
+
type: str
|
264
|
+
length: 255
|
265
|
+
- name: cwc
|
266
|
+
type: str
|
267
|
+
length: 255
|
268
|
+
- name: name
|
269
|
+
type: str
|
270
|
+
length: 255
|
271
|
+
|
272
|
+
#VDN definition derived from vdn.dat
|
273
|
+
echi_vdns:
|
274
|
+
- name: group_id
|
275
|
+
type: str
|
276
|
+
length: 255
|
277
|
+
- name: vdn
|
278
|
+
type: str
|
279
|
+
length: 255
|
280
|
+
- name: name
|
281
|
+
type: str
|
282
|
+
length: 255
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#ECH File construct, order is important, as the application sequentially reads the file
|
2
2
|
#Version 13 - Extended Schema
|
3
|
-
|
3
|
+
echi_records:
|
4
4
|
- name: callid
|
5
5
|
type: int
|
6
6
|
length: 4
|
@@ -231,4 +231,52 @@ fields:
|
|
231
231
|
length: 8
|
232
232
|
- name: asaiuui
|
233
233
|
type: str
|
234
|
-
length: 96
|
234
|
+
length: 96
|
235
|
+
|
236
|
+
#Agents table definition derived from agname.dat
|
237
|
+
echi_agents:
|
238
|
+
- name: group_id
|
239
|
+
type: str
|
240
|
+
length: 255
|
241
|
+
- name: login_id
|
242
|
+
type: str
|
243
|
+
length: 255
|
244
|
+
- name: name
|
245
|
+
type: str
|
246
|
+
length: 255
|
247
|
+
|
248
|
+
#Aux Reasons table definition derived from aux_rsn.dat
|
249
|
+
echi_aux_reasons:
|
250
|
+
- name: group_id
|
251
|
+
type: str
|
252
|
+
length: 255
|
253
|
+
- name: aux_reason
|
254
|
+
type: str
|
255
|
+
length: 255
|
256
|
+
- name: name
|
257
|
+
type: str
|
258
|
+
length: 255
|
259
|
+
|
260
|
+
#CWC definition derived from cwc.dat
|
261
|
+
echi_cwcs:
|
262
|
+
- name: group_id
|
263
|
+
type: str
|
264
|
+
length: 255
|
265
|
+
- name: cwc
|
266
|
+
type: str
|
267
|
+
length: 255
|
268
|
+
- name: name
|
269
|
+
type: str
|
270
|
+
length: 255
|
271
|
+
|
272
|
+
#VDN definition derived from vdn.dat
|
273
|
+
echi_vdns:
|
274
|
+
- name: group_id
|
275
|
+
type: str
|
276
|
+
length: 255
|
277
|
+
- name: vdn
|
278
|
+
type: str
|
279
|
+
length: 255
|
280
|
+
- name: name
|
281
|
+
type: str
|
282
|
+
length: 255
|
data/config/install_files.yml
CHANGED
@@ -35,6 +35,9 @@ files_to_copy:
|
|
35
35
|
- name: db/migrate/003_create_echi_agents.rb
|
36
36
|
- name: db/migrate/004_change_log_name_size.rb
|
37
37
|
- name: db/migrate/005_change_log_processedat_name.rb
|
38
|
+
- name: db/migrate/006_create_echi_aux_reasons.rb
|
39
|
+
- name: db/migrate/007_create_echi_cwcs.rb
|
40
|
+
- name: db/migrate/008_create_echi_vdns.rb
|
38
41
|
- name: examples/extended_version12/chr0003
|
39
42
|
- name: examples/extended_version12/chr0003.txt
|
40
43
|
- name: examples/ascii_csv/chr5500.123
|
@@ -44,7 +47,9 @@ files_to_copy:
|
|
44
47
|
- name: lib/main.rb
|
45
48
|
- name: lib/main_win32.rb
|
46
49
|
- name: lib/echi-converter/version.rb
|
50
|
+
- name: lib/ftp_fetcher.rb
|
47
51
|
- name: examples/schemas/oracle_echi.sql
|
52
|
+
- name: examples/db_connect_test.rb
|
48
53
|
|
49
54
|
files_to_upgrade:
|
50
55
|
- name: lib/database.rb
|
@@ -53,6 +58,10 @@ files_to_upgrade:
|
|
53
58
|
- name: lib/main.rb
|
54
59
|
- name: lib/main_win32.rb
|
55
60
|
- name: lib/echi-converter/version.rb
|
61
|
+
- name: lib/ftp_fetcher.rb
|
56
62
|
- name: db/migrate/003_create_echi_agents.rb
|
57
63
|
- name: db/migrate/004_change_log_name_size.rb
|
58
64
|
- name: db/migrate/005_change_log_processedat_name.rb
|
65
|
+
- name: db/migrate/006_create_echi_aux_reasons.rb
|
66
|
+
- name: db/migrate/007_create_echi_cwcs.rb
|
67
|
+
- name: db/migrate/008_create_echi_vdns.rb
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#ECH File construct, order is important, as the application sequentially reads the file
|
2
2
|
#Version 12 - Standard Schema
|
3
|
-
|
3
|
+
echi_records:
|
4
4
|
- name: callid
|
5
5
|
type: int
|
6
6
|
length: 4
|
@@ -195,4 +195,52 @@ fields:
|
|
195
195
|
length: 17
|
196
196
|
- name: cwcs4
|
197
197
|
type: str
|
198
|
-
length: 17
|
198
|
+
length: 17
|
199
|
+
|
200
|
+
#Agents table definition derived from agname.dat
|
201
|
+
echi_agents:
|
202
|
+
- name: group_id
|
203
|
+
type: str
|
204
|
+
length: 255
|
205
|
+
- name: login_id
|
206
|
+
type: str
|
207
|
+
length: 255
|
208
|
+
- name: name
|
209
|
+
type: str
|
210
|
+
length: 255
|
211
|
+
|
212
|
+
#Aux Reasons table definition derived from aux_rsn.dat
|
213
|
+
echi_aux_reasons:
|
214
|
+
- name: group_id
|
215
|
+
type: str
|
216
|
+
length: 255
|
217
|
+
- name: aux_reason
|
218
|
+
type: str
|
219
|
+
length: 255
|
220
|
+
- name: name
|
221
|
+
type: str
|
222
|
+
length: 255
|
223
|
+
|
224
|
+
#CWC definition derived from cwc.dat
|
225
|
+
echi_cwcs:
|
226
|
+
- name: group_id
|
227
|
+
type: str
|
228
|
+
length: 255
|
229
|
+
- name: cwc
|
230
|
+
type: str
|
231
|
+
length: 255
|
232
|
+
- name: name
|
233
|
+
type: str
|
234
|
+
length: 255
|
235
|
+
|
236
|
+
#VDN definition derived from vdn.dat
|
237
|
+
echi_vdns:
|
238
|
+
- name: group_id
|
239
|
+
type: str
|
240
|
+
length: 255
|
241
|
+
- name: vdn
|
242
|
+
type: str
|
243
|
+
length: 255
|
244
|
+
- name: name
|
245
|
+
type: str
|
246
|
+
length: 255
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#ECH File construct, order is important, as the application sequentially reads the file
|
2
2
|
#Version 13 - Standard Schema
|
3
|
-
|
3
|
+
echi_records:
|
4
4
|
- name: callid
|
5
5
|
type: int
|
6
6
|
length: 4
|
@@ -195,4 +195,52 @@ fields:
|
|
195
195
|
length: 17
|
196
196
|
- name: cwcs4
|
197
197
|
type: str
|
198
|
-
length: 17
|
198
|
+
length: 17
|
199
|
+
|
200
|
+
#Agents table definition derived from agname.dat
|
201
|
+
echi_agents:
|
202
|
+
- name: group_id
|
203
|
+
type: str
|
204
|
+
length: 255
|
205
|
+
- name: login_id
|
206
|
+
type: str
|
207
|
+
length: 255
|
208
|
+
- name: name
|
209
|
+
type: str
|
210
|
+
length: 255
|
211
|
+
|
212
|
+
#Aux Reasons table definition derived from aux_rsn.dat
|
213
|
+
echi_aux_reasons:
|
214
|
+
- name: group_id
|
215
|
+
type: str
|
216
|
+
length: 255
|
217
|
+
- name: aux_reason
|
218
|
+
type: str
|
219
|
+
length: 255
|
220
|
+
- name: name
|
221
|
+
type: str
|
222
|
+
length: 255
|
223
|
+
|
224
|
+
#CWC definition derived from cwc.dat
|
225
|
+
echi_cwcs:
|
226
|
+
- name: group_id
|
227
|
+
type: str
|
228
|
+
length: 255
|
229
|
+
- name: cwc
|
230
|
+
type: str
|
231
|
+
length: 255
|
232
|
+
- name: name
|
233
|
+
type: str
|
234
|
+
length: 255
|
235
|
+
|
236
|
+
#VDN definition derived from vdn.dat
|
237
|
+
echi_vdns:
|
238
|
+
- name: group_id
|
239
|
+
type: str
|
240
|
+
length: 255
|
241
|
+
- name: vdn
|
242
|
+
type: str
|
243
|
+
length: 255
|
244
|
+
- name: name
|
245
|
+
type: str
|
246
|
+
length: 255
|
@@ -2,7 +2,7 @@ class CreateEchiRecords < ActiveRecord::Migration
|
|
2
2
|
def self.up
|
3
3
|
#We create the table from the one defined in the application.yml file
|
4
4
|
create_table "echi_records", :force => true do |t|
|
5
|
-
@@echi_schema["
|
5
|
+
@@echi_schema["echi_records"].each do | field |
|
6
6
|
case field["type"]
|
7
7
|
when 'int'
|
8
8
|
t.column field["name"], :integer, :limit => field["length"], :precision => field["length"], :scale => 0
|
@@ -1,9 +1,21 @@
|
|
1
1
|
class CreateEchiAgents < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
+
#We create the table from the one defined in the application.yml file
|
3
4
|
create_table "echi_agents", :force => true do |t|
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
@@echi_schema["echi_agents"].each do | field |
|
6
|
+
case field["type"]
|
7
|
+
when 'int'
|
8
|
+
t.column field["name"], :integer, :limit => field["length"], :precision => field["length"], :scale => 0
|
9
|
+
when 'str'
|
10
|
+
t.column field["name"], :string, :limit => field["length"]
|
11
|
+
when 'datetime'
|
12
|
+
t.column field["name"], :datetime
|
13
|
+
when 'bool'
|
14
|
+
t.column field["name"], :string, :limit => 1
|
15
|
+
when 'bool_int'
|
16
|
+
t.column field["name"], :string, :limit => 1
|
17
|
+
end
|
18
|
+
end
|
7
19
|
end
|
8
20
|
add_index "echi_agents", "login_id"
|
9
21
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class CreateEchiAuxReasons < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
#We create the table from the one defined in the application.yml file
|
4
|
+
create_table "echi_aux_reasons", :force => true do |t|
|
5
|
+
@@echi_schema["echi_aux_reasons"].each do | field |
|
6
|
+
case field["type"]
|
7
|
+
when 'int'
|
8
|
+
t.column field["name"], :integer, :limit => field["length"], :precision => field["length"], :scale => 0
|
9
|
+
when 'str'
|
10
|
+
t.column field["name"], :string, :limit => field["length"]
|
11
|
+
when 'datetime'
|
12
|
+
t.column field["name"], :datetime
|
13
|
+
when 'bool'
|
14
|
+
t.column field["name"], :string, :limit => 1
|
15
|
+
when 'bool_int'
|
16
|
+
t.column field["name"], :string, :limit => 1
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
add_index "echi_aux_reasons", "aux_reason"
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.down
|
24
|
+
remove_index "echi_aux_reasons", "aux_reason"
|
25
|
+
drop_table "echi_aux_reasons"
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class CreateEchiCwcs < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
#We create the table from the one defined in the application.yml file
|
4
|
+
create_table "echi_cwcs", :force => true do |t|
|
5
|
+
@@echi_schema["echi_cwcs"].each do | field |
|
6
|
+
case field["type"]
|
7
|
+
when 'int'
|
8
|
+
t.column field["name"], :integer, :limit => field["length"], :precision => field["length"], :scale => 0
|
9
|
+
when 'str'
|
10
|
+
t.column field["name"], :string, :limit => field["length"]
|
11
|
+
when 'datetime'
|
12
|
+
t.column field["name"], :datetime
|
13
|
+
when 'bool'
|
14
|
+
t.column field["name"], :string, :limit => 1
|
15
|
+
when 'bool_int'
|
16
|
+
t.column field["name"], :string, :limit => 1
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
add_index "echi_cwcs", "cwc"
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.down
|
24
|
+
remove_index "echi_cwcs", "cwc"
|
25
|
+
drop_table "echi_cwcs"
|
26
|
+
end
|
27
|
+
end
|