echi-converter 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -180,4 +180,24 @@
180
180
  * Changed the default logging in application.yml to 'NONE' from 'DEBUG'
181
181
  * Added standard_version14.yml and extended_version14.yml
182
182
  * Bug fix(es):
183
- * Will now archive 0 length files and not stop the Windows Service - Bug#18888
183
+ * Will now archive 0 length files and not stop the Windows Service - Bug#18888
184
+
185
+ == 0.3.8 2008-07-18
186
+
187
+ * Major enhancement(s):
188
+ * Minor enhancement(s):
189
+ * Bug fix(es):
190
+ * #18888 with zero byte files
191
+ * #19437 Oracle table names too long in v0.3.7
192
+ * Removed indexes from echi_reasons, echi_acds, echi_splits, echi_trunks and echi_vectors
193
+ * Changed the following fields due to Oracle constraints in using 'number' as a field name:
194
+ - echi_acds
195
+ - number -> acd_number
196
+ - echi_splits
197
+ - number -> split_number
198
+ - echi_vectors
199
+ - number -> vector_number
200
+ * #19490 with inverted fileversion and filenumber
201
+ * #19493 issue with the extra byte read on binary files
202
+ * Known issue(s):
203
+ * #21295 - Migrations for Oracle and automated table generation not working
@@ -34,12 +34,12 @@ db/migrate/002_create_echi_logs.rb
34
34
  db/migrate/003_create_echi_agents.rb
35
35
  db/migrate/004_change_log_name_size.rb
36
36
  db/migrate/005_change_log_processedat_name.rb
37
- db/migrate/006_create_echi_aux_reasons.rb
37
+ db/migrate/006_create_echi_reasons.rb
38
38
  db/migrate/007_create_echi_cwcs.rb
39
39
  db/migrate/008_create_echi_vdns.rb
40
40
  db/migrate/009_create_echi_acds.rb
41
41
  db/migrate/010_create_echi_splits.rb
42
- db/migrate/011_create_echi_trunk_groups.rb
42
+ db/migrate/011_create_echi_trunks.rb
43
43
  db/migrate/012_create_echi_vectors.rb
44
44
  bin/echi-converter
45
45
  examples/extended_version12/chr0003
@@ -205,7 +205,15 @@ elsif RUBY_PLATFORM["-mswin32"]
205
205
  puts usage
206
206
  end
207
207
  elsif ARGV[0] == 'run' || ARGV[0] == 'start' || ARGV[0] == 'stop' || ARGV[0] == 'zap' || ARGV[0] == 'restart'
208
- launch_project ARGV[0], ARGV[1]
208
+ if ARGV[1] == nil
209
+ puts "ECHI-converter - You must enter a project name when starting or managing a project"
210
+ else
211
+ begin
212
+ launch_project ARGV[0], ARGV[1]
213
+ rescue => err
214
+ puts 'Failed to launch project: ' + err
215
+ end
216
+ end
209
217
  else
210
218
  puts usage
211
219
  end
@@ -12,6 +12,7 @@ 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
+ echi_read_extra_byte: Y #May toggle this to Y, 'yes', or N, 'no', as to whether to read an extra byte for binary files at the end of each record
15
16
  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
17
  #Filenames of the dat files
17
18
  echi_acd_dat: acd.dat
@@ -238,7 +238,7 @@ echi_acds:
238
238
  - name: acd_id
239
239
  type: str
240
240
  length: 255
241
- - name: number
241
+ - name: acd_number
242
242
  type: str
243
243
  length: 255
244
244
  - name: name
@@ -258,7 +258,7 @@ echi_agents:
258
258
  length: 255
259
259
 
260
260
  #Aux Reasons table definition derived from aux_rsn.dat
261
- echi_aux_reasons:
261
+ echi_reasons:
262
262
  - name: group_id
263
263
  type: str
264
264
  length: 255
@@ -286,7 +286,7 @@ echi_splits:
286
286
  - name: acd_number
287
287
  type: str
288
288
  length: 255
289
- - name: number
289
+ - name: split_number
290
290
  type: str
291
291
  length: 255
292
292
  - name: name
@@ -294,7 +294,7 @@ echi_splits:
294
294
  length: 255
295
295
 
296
296
  #Trunk Group table definition derived from tkgrp.dat
297
- echi_trunk_groups:
297
+ echi_trunks:
298
298
  - name: acd_number
299
299
  type: str
300
300
  length: 255
@@ -322,7 +322,7 @@ echi_vectors:
322
322
  - name: acd_number
323
323
  type: str
324
324
  length: 255
325
- - name: number
325
+ - name: vector_number
326
326
  type: str
327
327
  length: 255
328
328
  - name: name
@@ -238,7 +238,7 @@ echi_acds:
238
238
  - name: acd_id
239
239
  type: str
240
240
  length: 255
241
- - name: number
241
+ - name: acd_number
242
242
  type: str
243
243
  length: 255
244
244
  - name: name
@@ -258,7 +258,7 @@ echi_agents:
258
258
  length: 255
259
259
 
260
260
  #Aux Reasons table definition derived from aux_rsn.dat
261
- echi_aux_reasons:
261
+ echi_reasons:
262
262
  - name: group_id
263
263
  type: str
264
264
  length: 255
@@ -286,7 +286,7 @@ echi_splits:
286
286
  - name: acd_number
287
287
  type: str
288
288
  length: 255
289
- - name: number
289
+ - name: split_number
290
290
  type: str
291
291
  length: 255
292
292
  - name: name
@@ -294,7 +294,7 @@ echi_splits:
294
294
  length: 255
295
295
 
296
296
  #Trunk Group table definition derived from tkgrp.dat
297
- echi_trunk_groups:
297
+ echi_trunks:
298
298
  - name: acd_number
299
299
  type: str
300
300
  length: 255
@@ -322,7 +322,7 @@ echi_vectors:
322
322
  - name: acd_number
323
323
  type: str
324
324
  length: 255
325
- - name: number
325
+ - name: vector_number
326
326
  type: str
327
327
  length: 255
328
328
  - name: name
@@ -238,7 +238,7 @@ echi_acds:
238
238
  - name: acd_id
239
239
  type: str
240
240
  length: 255
241
- - name: number
241
+ - name: acd_number
242
242
  type: str
243
243
  length: 255
244
244
  - name: name
@@ -258,7 +258,7 @@ echi_agents:
258
258
  length: 255
259
259
 
260
260
  #Aux Reasons table definition derived from aux_rsn.dat
261
- echi_aux_reasons:
261
+ echi_reasons:
262
262
  - name: group_id
263
263
  type: str
264
264
  length: 255
@@ -286,7 +286,7 @@ echi_splits:
286
286
  - name: acd_number
287
287
  type: str
288
288
  length: 255
289
- - name: number
289
+ - name: split_number
290
290
  type: str
291
291
  length: 255
292
292
  - name: name
@@ -294,7 +294,7 @@ echi_splits:
294
294
  length: 255
295
295
 
296
296
  #Trunk Group table definition derived from tkgrp.dat
297
- echi_trunk_groups:
297
+ echi_trunks:
298
298
  - name: acd_number
299
299
  type: str
300
300
  length: 255
@@ -322,7 +322,7 @@ echi_vectors:
322
322
  - name: acd_number
323
323
  type: str
324
324
  length: 255
325
- - name: number
325
+ - name: vector_number
326
326
  type: str
327
327
  length: 255
328
328
  - name: name
@@ -37,12 +37,12 @@ files_to_copy:
37
37
  - name: db/migrate/003_create_echi_agents.rb
38
38
  - name: db/migrate/004_change_log_name_size.rb
39
39
  - name: db/migrate/005_change_log_processedat_name.rb
40
- - name: db/migrate/006_create_echi_aux_reasons.rb
40
+ - name: db/migrate/006_create_echi_reasons.rb
41
41
  - name: db/migrate/007_create_echi_cwcs.rb
42
42
  - name: db/migrate/008_create_echi_vdns.rb
43
43
  - name: db/migrate/009_create_echi_acds.rb
44
44
  - name: db/migrate/010_create_echi_splits.rb
45
- - name: db/migrate/011_create_echi_trunk_groups.rb
45
+ - name: db/migrate/011_create_echi_trunks.rb
46
46
  - name: db/migrate/012_create_echi_vectors.rb
47
47
  - name: examples/extended_version12/chr0003
48
48
  - name: examples/extended_version12/chr0003.txt
@@ -202,7 +202,7 @@ echi_acds:
202
202
  - name: acd_id
203
203
  type: str
204
204
  length: 255
205
- - name: number
205
+ - name: acd_number
206
206
  type: str
207
207
  length: 255
208
208
  - name: name
@@ -222,7 +222,7 @@ echi_agents:
222
222
  length: 255
223
223
 
224
224
  #Aux Reasons table definition derived from aux_rsn.dat
225
- echi_aux_reasons:
225
+ echi_reasons:
226
226
  - name: group_id
227
227
  type: str
228
228
  length: 255
@@ -250,7 +250,7 @@ echi_splits:
250
250
  - name: acd_number
251
251
  type: str
252
252
  length: 255
253
- - name: number
253
+ - name: split_number
254
254
  type: str
255
255
  length: 255
256
256
  - name: name
@@ -258,7 +258,7 @@ echi_splits:
258
258
  length: 255
259
259
 
260
260
  #Trunk Group table definition derived from tkgrp.dat
261
- echi_trunk_groups:
261
+ echi_trunks:
262
262
  - name: acd_number
263
263
  type: str
264
264
  length: 255
@@ -286,7 +286,7 @@ echi_vectors:
286
286
  - name: acd_number
287
287
  type: str
288
288
  length: 255
289
- - name: number
289
+ - name: vector_number
290
290
  type: str
291
291
  length: 255
292
292
  - name: name
@@ -202,7 +202,7 @@ echi_acds:
202
202
  - name: acd_id
203
203
  type: str
204
204
  length: 255
205
- - name: number
205
+ - name: acd_number
206
206
  type: str
207
207
  length: 255
208
208
  - name: name
@@ -222,7 +222,7 @@ echi_agents:
222
222
  length: 255
223
223
 
224
224
  #Aux Reasons table definition derived from aux_rsn.dat
225
- echi_aux_reasons:
225
+ echi_reasons:
226
226
  - name: group_id
227
227
  type: str
228
228
  length: 255
@@ -250,7 +250,7 @@ echi_splits:
250
250
  - name: acd_number
251
251
  type: str
252
252
  length: 255
253
- - name: number
253
+ - name: split_number
254
254
  type: str
255
255
  length: 255
256
256
  - name: name
@@ -258,7 +258,7 @@ echi_splits:
258
258
  length: 255
259
259
 
260
260
  #Trunk Group table definition derived from tkgrp.dat
261
- echi_trunk_groups:
261
+ echi_trunks:
262
262
  - name: acd_number
263
263
  type: str
264
264
  length: 255
@@ -286,7 +286,7 @@ echi_vectors:
286
286
  - name: acd_number
287
287
  type: str
288
288
  length: 255
289
- - name: number
289
+ - name: vector_number
290
290
  type: str
291
291
  length: 255
292
292
  - name: name
@@ -202,7 +202,7 @@ echi_acds:
202
202
  - name: acd_id
203
203
  type: str
204
204
  length: 255
205
- - name: number
205
+ - name: acd_number
206
206
  type: str
207
207
  length: 255
208
208
  - name: name
@@ -222,7 +222,7 @@ echi_agents:
222
222
  length: 255
223
223
 
224
224
  #Aux Reasons table definition derived from aux_rsn.dat
225
- echi_aux_reasons:
225
+ echi_reasons:
226
226
  - name: group_id
227
227
  type: str
228
228
  length: 255
@@ -250,7 +250,7 @@ echi_splits:
250
250
  - name: acd_number
251
251
  type: str
252
252
  length: 255
253
- - name: number
253
+ - name: split_number
254
254
  type: str
255
255
  length: 255
256
256
  - name: name
@@ -258,7 +258,7 @@ echi_splits:
258
258
  length: 255
259
259
 
260
260
  #Trunk Group table definition derived from tkgrp.dat
261
- echi_trunk_groups:
261
+ echi_trunks:
262
262
  - name: acd_number
263
263
  type: str
264
264
  length: 255
@@ -286,7 +286,7 @@ echi_vectors:
286
286
  - name: acd_number
287
287
  type: str
288
288
  length: 255
289
- - name: number
289
+ - name: vector_number
290
290
  type: str
291
291
  length: 255
292
292
  - name: name
@@ -1,8 +1,8 @@
1
- class CreateEchiAuxReasons < ActiveRecord::Migration
1
+ class CreateEchiReasons < ActiveRecord::Migration
2
2
  def self.up
3
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 |
4
+ create_table "echi_reasons", :force => true do |t|
5
+ @@echi_schema["echi_reasons"].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
@@ -17,11 +17,9 @@ class CreateEchiAuxReasons < ActiveRecord::Migration
17
17
  end
18
18
  end
19
19
  end
20
- add_index "echi_aux_reasons", "aux_reason"
21
20
  end
22
21
 
23
22
  def self.down
24
- remove_index "echi_aux_reasons", "aux_reason"
25
- drop_table "echi_aux_reasons"
23
+ drop_table "echi_reasons"
26
24
  end
27
25
  end
@@ -17,11 +17,9 @@ class CreateEchiSplits < ActiveRecord::Migration
17
17
  end
18
18
  end
19
19
  end
20
- add_index "echi_splits", "acd_number"
21
20
  end
22
21
 
23
22
  def self.down
24
- remove_index "echi_splits", "acd_number"
25
23
  drop_table "echi_splits"
26
24
  end
27
25
  end
@@ -1,8 +1,8 @@
1
- class CreateEchiTrunkGroups < ActiveRecord::Migration
1
+ class CreateEchiTrunks < ActiveRecord::Migration
2
2
  def self.up
3
3
  #We create the table from the one defined in the application.yml file
4
- create_table "echi_trunk_groups", :force => true do |t|
5
- @@echi_schema["echi_trunk_groups"].each do | field |
4
+ create_table "echi_trunks", :force => true do |t|
5
+ @@echi_schema["echi_trunks"].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
@@ -17,11 +17,9 @@ class CreateEchiTrunkGroups < ActiveRecord::Migration
17
17
  end
18
18
  end
19
19
  end
20
- add_index "echi_trunk_groups", "acd_number"
21
20
  end
22
21
 
23
22
  def self.down
24
- remove_index "echi_trunk_groups", "acd_number"
25
- drop_table "echi_trunk_groups"
23
+ drop_table "echi_trunks"
26
24
  end
27
25
  end
@@ -17,11 +17,9 @@ class CreateEchiVectors < ActiveRecord::Migration
17
17
  end
18
18
  end
19
19
  end
20
- add_index "echi_vectors", "acd_number"
21
20
  end
22
21
 
23
22
  def self.down
24
- remove_index "echi_vectors", "acd_number"
25
23
  drop_table "echi_vectors"
26
24
  end
27
25
  end
@@ -11,7 +11,7 @@ end
11
11
  class EchiAgent < ActiveRecord::Base
12
12
  end
13
13
 
14
- class EchiAuxReason < ActiveRecord::Base
14
+ class EchiReason < ActiveRecord::Base
15
15
  end
16
16
 
17
17
  class EchiCwc < ActiveRecord::Base
@@ -20,7 +20,7 @@ end
20
20
  class EchiSplit < ActiveRecord::Base
21
21
  end
22
22
 
23
- class EchiTrunkGroup < ActiveRecord::Base
23
+ class EchiTrunk < ActiveRecord::Base
24
24
  end
25
25
 
26
26
  class EchiVdn < ActiveRecord::Base
File without changes
@@ -221,10 +221,10 @@ module EchiConverter
221
221
  @log.debug "File size: " + @binary_file.stat.size.to_s
222
222
 
223
223
  #Read header information first
224
- filenumber = dump_binary 'int', 4
225
- @log.debug "File_number " + filenumber.to_s
226
224
  fileversion = dump_binary 'int', 4
227
225
  @log.debug "Version " + fileversion.to_s
226
+ filenumber = dump_binary 'int', 4
227
+ @log.debug "File_number " + filenumber.to_s
228
228
 
229
229
  begin
230
230
  #Perform a transaction for each file, including the log table
@@ -268,8 +268,10 @@ module EchiConverter
268
268
  end
269
269
  echi_record.save
270
270
 
271
- #Scan past the end of line record
272
- @binary_file.read(1)
271
+ #Scan past the end of line record if enabled in the configuration file
272
+ if $config["echi_read_extra_byte"] == "Y"
273
+ @binary_file.read(1)
274
+ end
273
275
  @log.debug '<====================STOP RECORD ' + @record_cnt.to_s + ' ====================>'
274
276
  @record_cnt += 1
275
277
  end
@@ -352,14 +354,14 @@ module EchiConverter
352
354
  echi_dat_record = EchiAcd.new
353
355
  when "echi_agents"
354
356
  echi_dat_record = EchiAgent.new
355
- when "echi_aux_reasons"
356
- echi_dat_record = EchiAuxReason.new
357
+ when "echi_reasons"
358
+ echi_dat_record = EchiReason.new
357
359
  when "echi_cwcs"
358
360
  echi_dat_record = EchiCwc.new
359
361
  when "echi_splits"
360
362
  echi_dat_record = EchiSplit.new
361
- when "echi_trunk_groups"
362
- echi_dat_record = EchiTrunkGroup.new
363
+ when "echi_trunks"
364
+ echi_dat_record = EchiTrunk.new
363
365
  when "echi_vdns"
364
366
  echi_dat_record = EchiVdn.new
365
367
  when "echi_vectors"
@@ -385,7 +387,7 @@ module EchiConverter
385
387
  filename_elements = $config["echi_acd_dat"].split(".")
386
388
  when "echi_agents"
387
389
  filename_elements = $config["echi_agent_dat"].split(".")
388
- when "echi_aux_reasons"
390
+ when "echi_reasons"
389
391
  filename_elements = $config["echi_aux_rsn_dat"].split(".")
390
392
  when "echi_cwcs"
391
393
  filename_elements = $config["echi_cwc_dat"].split(".")
@@ -393,7 +395,7 @@ module EchiConverter
393
395
  filename_elements = $config["echi_split_dat"].split(".")
394
396
  when "echi_vdns"
395
397
  filename_elements = $config["echi_vdn_dat"].split(".")
396
- when "echi_trunk_groups"
398
+ when "echi_trunks"
397
399
  filename_elements = $config["echi_trunk_group_dat"].split(".")
398
400
  when "echi_vectors"
399
401
  filename_elements = $config["echi_vector_dat"].split(".")
@@ -420,44 +422,47 @@ module EchiConverter
420
422
  if row != nil
421
423
  begin
422
424
  field = row.rstrip.split('|')
423
- @log.debug '<====================START ' + file["name"] + ' RECORD ' + @record_cnt.to_s + ' ====================>'
424
- case file["name"]
425
- when "echi_acds"
426
- record = EchiAcd.find(:first, :conditions => [ "number = ? AND acd_id = ?", field[1], field[0]])
427
- when "echi_agents"
428
- record = EchiAgent.find(:first, :conditions => [ "login_id = ? AND group_id = ?", field[1], field[0]])
429
- when "echi_aux_reasons"
430
- record = EchiAuxReason.find(:first, :conditions => [ "aux_reason = ? AND group_id = ?", field[1], field[0]])
431
- when "echi_cwcs"
432
- record = EchiCwc.find(:first, :conditions => [ "cwc = ? AND group_id = ?", field[1], field[0]])
433
- when "echi_splits"
434
- record = EchiSplit.find(:first, :conditions => [ "number = ? AND acd_number = ?", field[1], field[0]])
435
- when "echi_trunk_groups"
436
- record = EchiTrunkGroup.find(:first, :conditions => [ "trunk_group = ? AND acd_number = ?", field[1], field[0]])
437
- when "echi_vdns"
438
- record = EchiVdn.find(:first, :conditions => [ "vdn = ? AND group_id = ?", field[1], field[0]])
439
- when "echi_vectors"
440
- record = EchiVector.find(:first, :conditions => [ "number = ? AND acd_number = ?", field[1], field[0]])
441
- end
442
- if record != nil
443
- if record.name != field[2]
444
- record.name = field[2]
445
- record.update
446
- @record_cnt += 1
447
- @log.debug "Updated record - " + field.inspect
425
+ #Make sure we do not process the extra rows that Avaya nicely throws in the dat files for no good reason that serve as keys
426
+ if field.length > 1
427
+ @log.debug '<====================START ' + file["name"] + ' RECORD ' + @record_cnt.to_s + ' ====================>'
428
+ case file["name"]
429
+ when "echi_acds"
430
+ record = EchiAcd.find(:first, :conditions => [ "acd_number = ? AND acd_id = ?", field[1], field[0]])
431
+ when "echi_agents"
432
+ record = EchiAgent.find(:first, :conditions => [ "login_id = ? AND group_id = ?", field[1], field[0]])
433
+ when "echi_reasons"
434
+ record = EchiReason.find(:first, :conditions => [ "aux_reason = ? AND group_id = ?", field[1], field[0]])
435
+ when "echi_cwcs"
436
+ record = EchiCwc.find(:first, :conditions => [ "cwc = ? AND group_id = ?", field[1], field[0]])
437
+ when "echi_splits"
438
+ record = EchiSplit.find(:first, :conditions => [ "split_number = ? AND acd_number = ?", field[1], field[0]])
439
+ when "echi_trunks"
440
+ record = EchiTrunk.find(:first, :conditions => [ "trunk_group = ? AND acd_number = ?", field[1], field[0]])
441
+ when "echi_vdns"
442
+ record = EchiVdn.find(:first, :conditions => [ "vdn = ? AND group_id = ?", field[1], field[0]])
443
+ when "echi_vectors"
444
+ record = EchiVector.find(:first, :conditions => [ "vector_number = ? AND acd_number = ?", field[1], field[0]])
445
+ end
446
+ if record != nil
447
+ if record.name != field[2]
448
+ record.name = field[2]
449
+ record.update
450
+ @record_cnt += 1
451
+ @log.debug "Updated record - " + field.inspect
452
+ else
453
+ @log.debug "No update required for - " + field.inspect
454
+ end
448
455
  else
449
- @log.debug "No update required for - " + field.inspect
456
+ insert_dat_data file["name"], field
457
+ @record_cnt += 1
458
+ @log.debug "Inserted new record - " + field.inspect
450
459
  end
451
- else
452
- insert_dat_data file["name"], field
453
- @record_cnt += 1
454
- @log.debug "Inserted new record - " + field.inspect
460
+ @log.debug '<====================STOP ' + file["name"] + ' RECORD ' + @record_cnt.to_s + ' ====================>'
455
461
  end
456
462
  rescue => err
457
463
  @log.info "Error processing ECHI record in process_proper_table_method - " + err
458
464
  end
459
465
  end
460
- @log.debug '<====================STOP ' + file["name"] + ' RECORD ' + @record_cnt.to_s + ' ====================>'
461
466
  end
462
467
 
463
468
  process_file.close
@@ -471,15 +476,15 @@ module EchiConverter
471
476
  dat_files = Array.new
472
477
  dat_files[0] = { "name" => "echi_acds", "filename" => $workingdir + "/../files/to_process/" + $config["echi_acd_dat"] }
473
478
  dat_files[1] = { "name" => "echi_agents", "filename" => $workingdir + "/../files/to_process/" + $config["echi_agent_dat"] }
474
- dat_files[2] = { "name" => "echi_aux_reasons", "filename" => $workingdir + "/../files/to_process/" + $config["echi_aux_rsn_dat"] }
479
+ dat_files[2] = { "name" => "echi_reasons", "filename" => $workingdir + "/../files/to_process/" + $config["echi_aux_rsn_dat"] }
475
480
  dat_files[3] = { "name" => "echi_cwcs", "filename" => $workingdir + "/../files/to_process/" + $config["echi_cwc_dat"] }
476
481
  dat_files[4] = { "name" => "echi_splits", "filename" => $workingdir + "/../files/to_process/" + $config["echi_split_dat"] }
477
- dat_files[5] = { "name" => "echi_trunk_groups", "filename" => $workingdir + "/../files/to_process/" + $config["echi_trunk_group_dat"] }
482
+ dat_files[5] = { "name" => "echi_trunks", "filename" => $workingdir + "/../files/to_process/" + $config["echi_trunk_group_dat"] }
478
483
  dat_files[6] = { "name" => "echi_vdns", "filename" => $workingdir + "/../files/to_process/" + $config["echi_vdn_dat"] }
479
484
  dat_files[7] = { "name" => "echi_vectors", "filename" => $workingdir + "/../files/to_process/" + $config["echi_vector_dat"] }
480
485
 
481
486
  dat_files.each do |file|
482
- if File.exists?(file["filename"]) && File.size(file["filename"]) > 0
487
+ if File.exists?(file["filename"]) && File.stat(file["filename"]).size > 0
483
488
  case file["name"]
484
489
  when "echi_acds"
485
490
  EchiAcd.transaction do
@@ -489,8 +494,8 @@ module EchiConverter
489
494
  EchiAgent.transaction do
490
495
  process_proper_table file
491
496
  end
492
- when "echi_aux_reasons"
493
- EchiAuxReason.transaction do
497
+ when "echi_reasons"
498
+ EchiReason.transaction do
494
499
  process_proper_table file
495
500
  end
496
501
  when "echi_cwcs"
@@ -501,8 +506,8 @@ module EchiConverter
501
506
  EchiSplit.transaction do
502
507
  process_proper_table file
503
508
  end
504
- when "echi_trunk_groups"
505
- EchiTrunkGroup.transaction do
509
+ when "echi_trunks"
510
+ EchiTrunk.transaction do
506
511
  process_proper_table file
507
512
  end
508
513
  when "echi_vdns"
@@ -2,7 +2,7 @@ module EchiConverter #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- TINY = 7
5
+ TINY = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -48,13 +48,18 @@ loop do
48
48
  @processeddirectory = set_directory($workingdir)
49
49
 
50
50
  Dir.entries(to_process_dir).each do | file |
51
- if file.slice(0,3) == 'chr'
52
- if $config["echi_format"] == 'BINARY'
53
- record_cnt = convert_binary_file file
54
- elsif $config["echi_format"] == 'ASCII'
55
- record_cnt = process_ascii file
51
+ if file.slice(0,3) == 'chr' && File.stat("#{to_process_dir}/#{file}").size == 0
52
+ @log.info "Encountered a zero bye chr file: #{file}"
53
+ FileUtils.mv("#{to_process_dir}/#{file}", @processeddirectory)
54
+ else
55
+ if file.slice(0,3) == 'chr'
56
+ if $config["echi_format"] == 'BINARY'
57
+ record_cnt = convert_binary_file file
58
+ elsif $config["echi_format"] == 'ASCII'
59
+ record_cnt = process_ascii file
60
+ end
61
+ @log.info "Processed file #{file} with #{record_cnt.to_s} records"
56
62
  end
57
- @log.info "Processed file #{file} with #{record_cnt.to_s} records"
58
63
  end
59
64
  end
60
65
 
@@ -64,13 +64,18 @@ class EchiDaemon < Daemon
64
64
  @processeddirectory = set_directory($workingdir)
65
65
 
66
66
  Dir.entries(to_process_dir).each do | file |
67
- if file.slice(0,3) == 'chr'
68
- if $config["echi_format"] == 'BINARY'
69
- record_cnt = convert_binary_file file
70
- elsif $config["echi_format"] == 'ASCII'
71
- record_cnt = process_ascii file
67
+ if file.slice(0,3) == 'chr' && File.stat("#{to_process_dir}/#{file}").size == 0
68
+ @log.info "Encountered a zero bye chr file: #{file}"
69
+ FileUtils.mv("#{to_process_dir}/#{file}", @processeddirectory)
70
+ else
71
+ if file.slice(0,3) == 'chr'
72
+ if $config["echi_format"] == 'BINARY'
73
+ record_cnt = convert_binary_file file
74
+ elsif $config["echi_format"] == 'ASCII'
75
+ record_cnt = process_ascii file
76
+ end
77
+ @log.info "Processed file #{file} with #{record_cnt.to_s} records"
72
78
  end
73
- @log.info "Processed file #{file} with #{record_cnt.to_s} records"
74
79
  end
75
80
  end
76
81
 
@@ -33,7 +33,7 @@
33
33
  <h1>ECHI Converter</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/echi-converter"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/echi-converter" class="numbers">0.3.7</a>
36
+ <a href="http://rubyforge.org/projects/echi-converter" class="numbers">0.3.8</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;echi-converter&#8217;</h1>
39
39
 
@@ -41,15 +41,13 @@
41
41
  <h2>The <span class="caps">ECHI</span> (External Call History Interface) Converter</h2>
42
42
 
43
43
 
44
- <p>Provides a Ruby based utility for fetching Avaya <span class="caps">CMS</span> / <span class="caps">ECHI</span> files in binary/ASCII form from an <span class="caps">FTP</span> server, converting them, if necessary, to <span class="caps">ASCII</span> and then inserting them into a database via ActiveRecord. With this
45
- utility you only need the standard Avaya <span class="caps">CMS</span> Release 13 or better without any additional software or utilities
46
- from Avaya, as this utility will process either binary or <span class="caps">ASCII</span> output from the Avaya <span class="caps">CMS</span>.</p>
44
+ <p>Provides a Ruby based utility for fetching Avaya <span class="caps">CMS</span> / <span class="caps">ECHI</span> files in binary/ASCII form from an <span class="caps">FTP</span> server, converting them, if necessary, to <span class="caps">ASCII</span> and then inserting them into a database via ActiveRecord. With this utility you only need the standard Avaya <span class="caps">CMS</span> Release 13 or better without any additional software or utilities from Avaya, as this utility will process either binary or <span class="caps">ASCII</span> output from the Avaya <span class="caps">CMS</span>.</p>
47
45
 
48
46
 
49
47
  <h2>Status</h2>
50
48
 
51
49
 
52
- <p>This release is now in production use within Call Centers using the Avaya <span class="caps">CMS</span>. The utility successfully and reliably imports the data provided by the Avaya <span class="caps">CMS ECHI</span> into various databases, including Oracle and MySQL. This provides the repository of call segments that may then be used to provide detailed Cradle to Grave reporting for the call center.</p>
50
+ <p>This release is now in production use within Call Centers using the Avaya <span class="caps">CMS</span>. The utility successfully and reliably imports the data provided by the Avaya <span class="caps">CMS ECHI</span> into various databases, including Microsoft Sqlserver, Oracle and MySQL. This provides the repository of call segments that may then be used to provide detailed Cradle to Grave reporting for the call center.</p>
53
51
 
54
52
 
55
53
  <h2>Features</h2>
@@ -88,6 +86,15 @@ from Avaya, as this utility will process either binary or <span class="caps">ASC
88
86
  </ol>
89
87
 
90
88
 
89
+ <h2>What <span class="caps">ECHI</span>-Converter is not</h2>
90
+
91
+
92
+ <ol>
93
+ <li>A reporting engine</li>
94
+ <li>A set of database maintenance scripts</li>
95
+ </ol>
96
+
97
+
91
98
  <h2>Requirements</h2>
92
99
 
93
100
 
@@ -100,8 +107,13 @@ from Avaya, as this utility will process either binary or <span class="caps">ASC
100
107
  <li><a href="http://fastercsv.rubyforge.org/">FasterCSV v1.2.0+</a></li>
101
108
  <li><a href="http://rake.rubyforge.org/">Rake v0.7.3+</a></li>
102
109
  <li><a href="http://sporkmonger.com/projects/uuidtools/">UUIDTools v1.0.1+</a></li>
103
- <li><a href="http://win32utils.rubyforge.org/">Win32-service v.0.5.x &#8211; <strong><span class="caps">ONLY</span></strong> -</a> (Manual install for Windows only)</li>
110
+ <li><a href="http://win32utils.rubyforge.org/">Win32-service v.0.5.x &#8211; <strong><span class="caps">ONLY</span></strong> -</a> (Manual install for Windows only)
111
+ <ol>
112
+ <li>A release will come out to support v0.6.x in the future, as that version of Win32-service is not backward compatible</li>
113
+ </ol>
114
+ </li>
104
115
  <li><a href="http://rubyforge.org/projects/seattlerb/">Hoe v1.2.2+</a></li>
116
+ <li>Avaya <span class="caps">CMS ECHI</span> Release 12+ enabled and configured to send to an <span class="caps">FTP</span> server</li>
105
117
  </ol>
106
118
 
107
119
 
@@ -226,13 +238,47 @@ from Avaya, as this utility will process either binary or <span class="caps">ASC
226
238
  <h4>Operating Systems</h4>
227
239
 
228
240
 
229
- <p><span class="caps">POSIX</span>, Windows <span class="caps">XP SP2</span>, Windows 2000 and Windows 2003.</p>
241
+ <ol>
242
+ <li><span class="caps">POSIX</span></li>
243
+ <li>Windows <span class="caps">XP SP2</span></li>
244
+ <li>Windows 2000</li>
245
+ <li>Windows 2003.</li>
246
+ </ol>
247
+
248
+
249
+ <h4>Databases</h4>
250
+
251
+
252
+ <ol>
253
+ <li>MySQL</li>
254
+ <li>Microsoft Sqlserver</li>
255
+ <li><span class="caps">DB2</span></li>
256
+ <li>Sqlite3</li>
257
+ <li>Postgres</li>
258
+ </ol>
259
+
260
+
261
+ <ol>
262
+ <li>Oracle (Currently automated table generation with migrations not supported. One must create their own schema following the Avaya documentation, and then the <span class="caps">ECHI</span>-Converter will run thereafter. Future Oracle Migrations support is planned. A further description and work around example may be found <a href="http://rubyforge.org/tracker/index.php?func=detail&#38;aid=21295&#38;group_id=4110&#38;atid=15802">here</a>.)</li>
263
+ </ol>
230
264
 
231
265
 
232
266
  <h4><span class="caps">FTP</span> Servers</h4>
233
267
 
234
268
 
235
- <p><span class="caps">VSFTP</span> and Windows 2003/XP <span class="caps">FTP</span> Servers.</p>
269
+ <ol>
270
+ <li><span class="caps">VSFTP</span> </li>
271
+ <li>Windows 2003/XP <span class="caps">FTP</span> Servers (When using a Windows <span class="caps">FTP</span> server, you must configure the <span class="caps">FTP</span> server to provide a <span class="caps">UNIX</span> directory listing format.)</li>
272
+ </ol>
273
+
274
+
275
+ <h2>Related Avaya Documentation for <span class="caps">ECHI</span></h2>
276
+
277
+
278
+ <ol>
279
+ <li><a href="http://support.avaya.com/elmodocs2/cms/R14/ECHI.pdf">Avaya Call Management System Release 14 External Call History Interface</a></li>
280
+ <li><a href="http://support.avaya.com/elmodocs2/cms_r13_1/07-300737_ECHI.pdf">Avaya Call Management System Release 13 External Call History Interface</a></li>
281
+ </ol>
236
282
 
237
283
 
238
284
  <h2>Screencast</h2>
@@ -244,9 +290,18 @@ from Avaya, as this utility will process either binary or <span class="caps">ASC
244
290
  <h2>Forum</h2>
245
291
 
246
292
 
293
+ <p>Please report questions here:</p>
294
+
295
+
247
296
  <p><a href="http://groups.google.com/group/echi-converter">Google Groups &#8211; <span class="caps">ECHI</span> Converter</a></p>
248
297
 
249
298
 
299
+ <p>Please report bugs here:</p>
300
+
301
+
302
+ <p><a href="http://rubyforge.org/tracker/?atid=15802&#38;group_id=4110&#38;func=browse">Ruby Forge Bug Tracker &#8211; <span class="caps">ECHI</span> Converter</a></p>
303
+
304
+
250
305
  <h2>How to submit patches</h2>
251
306
 
252
307
 
@@ -273,10 +328,10 @@ from Avaya, as this utility will process either binary or <span class="caps">ASC
273
328
 
274
329
  <ol>
275
330
  <li>Asterisk &#8211; is the world&#8217;s leading open source PBXi, telephony engine, and telephony applications toolkit, link <a href="http://www.asterisk.org">here.</a></li>
276
- <li>Adhersion &#8211; is an open-source, unconventional voice framework that ties technologies together neatly, link <a href="http://www.adhearsion.com">here.</a></li>
331
+ <li>Adhearsion &#8211; is an open-source, unconventional voice framework that ties technologies together neatly, link <a href="http://www.adhearsion.com">here.</a></li>
277
332
  </ol>
278
333
  <p class="coda">
279
- <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 17th March 2008<br>
334
+ <a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 21st July 2008<br>
280
335
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
281
336
  </p>
282
337
  </div>
@@ -5,13 +5,11 @@ h1. &#x2192; 'echi-converter'
5
5
 
6
6
  h2. The ECHI (External Call History Interface) Converter
7
7
 
8
- Provides a Ruby based utility for fetching Avaya CMS / ECHI files in binary/ASCII form from an FTP server, converting them, if necessary, to ASCII and then inserting them into a database via ActiveRecord. With this
9
- utility you only need the standard Avaya CMS Release 13 or better without any additional software or utilities
10
- from Avaya, as this utility will process either binary or ASCII output from the Avaya CMS.
8
+ Provides a Ruby based utility for fetching Avaya CMS / ECHI files in binary/ASCII form from an FTP server, converting them, if necessary, to ASCII and then inserting them into a database via ActiveRecord. With this utility you only need the standard Avaya CMS Release 13 or better without any additional software or utilities from Avaya, as this utility will process either binary or ASCII output from the Avaya CMS.
11
9
 
12
10
  h2. Status
13
11
 
14
- This release is now in production use within Call Centers using the Avaya CMS. The utility successfully and reliably imports the data provided by the Avaya CMS ECHI into various databases, including Oracle and MySQL. This provides the repository of call segments that may then be used to provide detailed Cradle to Grave reporting for the call center.
12
+ This release is now in production use within Call Centers using the Avaya CMS. The utility successfully and reliably imports the data provided by the Avaya CMS ECHI into various databases, including Microsoft Sqlserver, Oracle and MySQL. This provides the repository of call segments that may then be used to provide detailed Cradle to Grave reporting for the call center.
15
13
 
16
14
 
17
15
  h2. Features
@@ -40,7 +38,11 @@ The utility provides the following capabilities:
40
38
  ## echi_vdns - stores data from the vdn.dat file
41
39
  ## echi_vectors - stores data from the vector.dat file
42
40
 
41
+ h2. What ECHI-Converter is not
43
42
 
43
+ # A reporting engine
44
+ # A set of database maintenance scripts
45
+
44
46
  h2. Requirements
45
47
 
46
48
  # "Ruby v1.8.6+":http://www.ruby-lang.org/
@@ -52,7 +54,9 @@ h2. Requirements
52
54
  # "Rake v0.7.3+":http://rake.rubyforge.org/
53
55
  # "UUIDTools v1.0.1+":http://sporkmonger.com/projects/uuidtools/
54
56
  # "Win32-service v.0.5.x - *ONLY* - ":http://win32utils.rubyforge.org/ (Manual install for Windows only)
57
+ ## A release will come out to support v0.6.x in the future, as that version of Win32-service is not backward compatible
55
58
  # "Hoe v1.2.2+":http://rubyforge.org/projects/seattlerb/
59
+ # Avaya CMS ECHI Release 12+ enabled and configured to send to an FTP server
56
60
 
57
61
 
58
62
  h2. Installing
@@ -131,11 +135,30 @@ While the use of Ruby allows for operation on a multitude of platforms, these ar
131
135
 
132
136
  h4. Operating Systems
133
137
 
134
- POSIX, Windows XP SP2, Windows 2000 and Windows 2003.
138
+ # POSIX
139
+ # Windows XP SP2
140
+ # Windows 2000
141
+ # Windows 2003.
142
+
143
+ h4. Databases
144
+
145
+ # MySQL
146
+ # Microsoft Sqlserver
147
+ # DB2
148
+ # Sqlite3
149
+ # Postgres
150
+
151
+ # Oracle (Currently automated table generation with migrations not supported. One must create their own schema following the Avaya documentation, and then the ECHI-Converter will run thereafter. Future Oracle Migrations support is planned. A further description and work around example may be found "here":http://rubyforge.org/tracker/index.php?func=detail&aid=21295&group_id=4110&atid=15802.)
135
152
 
136
153
  h4. FTP Servers
137
154
 
138
- VSFTP and Windows 2003/XP FTP Servers.
155
+ # VSFTP
156
+ # Windows 2003/XP FTP Servers (When using a Windows FTP server, you must configure the FTP server to provide a UNIX directory listing format.)
157
+
158
+ h2. Related Avaya Documentation for ECHI
159
+
160
+ # "Avaya Call Management System Release 14 External Call History Interface":http://support.avaya.com/elmodocs2/cms/R14/ECHI.pdf
161
+ # "Avaya Call Management System Release 13 External Call History Interface":http://support.avaya.com/elmodocs2/cms_r13_1/07-300737_ECHI.pdf
139
162
 
140
163
  h2. Screencast
141
164
 
@@ -143,8 +166,14 @@ You may view the screencast on howto install and use the ECHI-Converter "here":h
143
166
 
144
167
  h2. Forum
145
168
 
169
+ Please report questions here:
170
+
146
171
  "Google Groups - ECHI Converter":http://groups.google.com/group/echi-converter
147
172
 
173
+ Please report bugs here:
174
+
175
+ "Ruby Forge Bug Tracker - ECHI Converter":http://rubyforge.org/tracker/?atid=15802&group_id=4110&func=browse
176
+
148
177
  h2. How to submit patches
149
178
 
150
179
  Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
@@ -162,4 +191,4 @@ Comments are welcome. Send an email to "jason [at] goecke.net":mailto:jason@goec
162
191
  h2. Other Recommended Open Source Projects
163
192
 
164
193
  # Asterisk - is the world's leading open source PBXi, telephony engine, and telephony applications toolkit, link "here.":http://www.asterisk.org
165
- # Adhersion - is an open-source, unconventional voice framework that ties technologies together neatly, link "here.":http://www.adhearsion.com
194
+ # Adhearsion - is an open-source, unconventional voice framework that ties technologies together neatly, link "here.":http://www.adhearsion.com
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: echi-converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Goecke
@@ -9,11 +9,12 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-25 00:00:00 -07:00
12
+ date: 2008-07-21 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
@@ -23,6 +24,7 @@ dependencies:
23
24
  version:
24
25
  - !ruby/object:Gem::Dependency
25
26
  name: activesupport
27
+ type: :runtime
26
28
  version_requirement:
27
29
  version_requirements: !ruby/object:Gem::Requirement
28
30
  requirements:
@@ -32,6 +34,7 @@ dependencies:
32
34
  version:
33
35
  - !ruby/object:Gem::Dependency
34
36
  name: daemons
37
+ type: :runtime
35
38
  version_requirement:
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
@@ -41,6 +44,7 @@ dependencies:
41
44
  version:
42
45
  - !ruby/object:Gem::Dependency
43
46
  name: fastercsv
47
+ type: :runtime
44
48
  version_requirement:
45
49
  version_requirements: !ruby/object:Gem::Requirement
46
50
  requirements:
@@ -50,6 +54,7 @@ dependencies:
50
54
  version:
51
55
  - !ruby/object:Gem::Dependency
52
56
  name: rake
57
+ type: :runtime
53
58
  version_requirement:
54
59
  version_requirements: !ruby/object:Gem::Requirement
55
60
  requirements:
@@ -59,6 +64,7 @@ dependencies:
59
64
  version:
60
65
  - !ruby/object:Gem::Dependency
61
66
  name: uuidtools
67
+ type: :runtime
62
68
  version_requirement:
63
69
  version_requirements: !ruby/object:Gem::Requirement
64
70
  requirements:
@@ -66,6 +72,16 @@ dependencies:
66
72
  - !ruby/object:Gem::Version
67
73
  version: 1.0.1
68
74
  version:
75
+ - !ruby/object:Gem::Dependency
76
+ name: hoe
77
+ type: :development
78
+ version_requirement:
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: 1.7.0
84
+ version:
69
85
  description: ECHI Conversion Utility - Provides a utility to fetch Avaya CMS / ECHI binary files, convert them and insert into a database table via ActiveRecord
70
86
  email: jason [at] goecke.net
71
87
  executables:
@@ -115,12 +131,12 @@ files:
115
131
  - db/migrate/003_create_echi_agents.rb
116
132
  - db/migrate/004_change_log_name_size.rb
117
133
  - db/migrate/005_change_log_processedat_name.rb
118
- - db/migrate/006_create_echi_aux_reasons.rb
134
+ - db/migrate/006_create_echi_reasons.rb
119
135
  - db/migrate/007_create_echi_cwcs.rb
120
136
  - db/migrate/008_create_echi_vdns.rb
121
137
  - db/migrate/009_create_echi_acds.rb
122
138
  - db/migrate/010_create_echi_splits.rb
123
- - db/migrate/011_create_echi_trunk_groups.rb
139
+ - db/migrate/011_create_echi_trunks.rb
124
140
  - db/migrate/012_create_echi_vectors.rb
125
141
  - bin/echi-converter
126
142
  - examples/extended_version12/chr0003
@@ -151,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
167
  requirements: []
152
168
 
153
169
  rubyforge_project: echi-converter
154
- rubygems_version: 1.0.1
170
+ rubygems_version: 1.2.0
155
171
  signing_key:
156
172
  specification_version: 2
157
173
  summary: ECHI Conversion Utility - Provides a utility to fetch Avaya CMS / ECHI binary files, convert them and insert into a database table via ActiveRecord