echi-converter 0.4.2 → 0.4.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.
@@ -1,5 +1,6 @@
1
1
  #ECH File construct, order is important, as the application sequentially reads the file
2
2
  #Version 14 - Extended Schema
3
+ # Documentation: http://support.avaya.com/elmodocs2/cms/R14/ECHI.pdf
3
4
  echi_records:
4
5
  - name: callid
5
6
  type: int
@@ -327,4 +328,4 @@ echi_vectors:
327
328
  length: 255
328
329
  - name: name
329
330
  type: str
330
- length: 255
331
+ length: 255
@@ -17,13 +17,7 @@ dirs_to_create:
17
17
  - name: lib/echi-converter
18
18
 
19
19
  files_to_copy:
20
- - name: History.txt
21
- - name: License.txt
22
- - name: Manifest.txt
23
- - name: README.txt
24
20
  - name: Rakefile
25
- - name: test/test_echi-converter.rb
26
- - name: test/test_helper.rb
27
21
  - name: config/application.yml
28
22
  - name: config/database.yml
29
23
  - name: config/extended_version12.yml
@@ -70,4 +64,4 @@ files_to_upgrade:
70
64
  - name: db/migrate/005_change_log_processedat_name.rb
71
65
  - name: db/migrate/006_create_echi_aux_reasons.rb
72
66
  - name: db/migrate/007_create_echi_cwcs.rb
73
- - name: db/migrate/008_create_echi_vdns.rb
67
+ - name: db/migrate/008_create_echi_vdns.rb
@@ -1,5 +1,6 @@
1
1
  #ECH File construct, order is important, as the application sequentially reads the file
2
2
  #Version 14 - Standard Schema
3
+ # Documentation: http://support.avaya.com/elmodocs2/cms/R14/ECHI.pdf
3
4
  echi_records:
4
5
  - name: callid
5
6
  type: int
@@ -291,4 +292,4 @@ echi_vectors:
291
292
  length: 255
292
293
  - name: name
293
294
  type: str
294
- length: 255
295
+ length: 255
@@ -0,0 +1,353 @@
1
+ # ECH File construct, order is important, as the application
2
+ # sequentially reads the file
3
+ # Source: http://support.avaya.com/css/P8/documents/100114943
4
+ # Version 16
5
+ echi_records:
6
+ - name: callid
7
+ type: int
8
+ length: 4
9
+ - name: acwtime
10
+ type: int
11
+ length: 4
12
+ - name: onholdtime
13
+ type: int
14
+ length: 4
15
+ - name: consulttime
16
+ type: int
17
+ length: 4
18
+ - name: disptime
19
+ type: int
20
+ length: 4
21
+ - name: duration
22
+ type: int
23
+ length: 4
24
+ - name: segstart
25
+ type: datetime
26
+ length: 4
27
+ - name: segstart_utc
28
+ type: datetime
29
+ length: 4
30
+ - name: segstop
31
+ type: datetime
32
+ length: 4
33
+ - name: segstop_utc
34
+ type: datetime
35
+ length: 4
36
+ - name: talktime
37
+ type: int
38
+ length: 4
39
+ - name: netintime
40
+ type: int
41
+ length: 4
42
+ - name: origholdtime
43
+ type: int
44
+ length: 4
45
+ - name: queuetime
46
+ type: int
47
+ length: 4
48
+ - name: ringtime
49
+ type: int
50
+ length: 4
51
+ - name: dispivector
52
+ type: int
53
+ length: 2
54
+ - name: dispsplit
55
+ type: int
56
+ length: 2
57
+ - name: firstivector
58
+ type: int
59
+ length: 2
60
+ - name: split1
61
+ type: int
62
+ length: 2
63
+ - name: split2
64
+ type: int
65
+ length: 2
66
+ - name: split3
67
+ type: int
68
+ length: 2
69
+ - name: trunkgroup
70
+ type: int
71
+ length: 2
72
+ - name: tklocid
73
+ type: int
74
+ length: 2
75
+ - name: origlocid
76
+ type: int
77
+ length: 2
78
+ - name: answerlocid
79
+ type: int
80
+ length: 2
81
+ - name: obslocid
82
+ type: int
83
+ length: 2
84
+ - name: uuilen
85
+ type: int
86
+ length: 2
87
+ - name: assist
88
+ type: bool
89
+ length: 1
90
+ - name: audiodifficulty
91
+ type: bool
92
+ length: 1
93
+ - name: conference
94
+ type: bool
95
+ length: 1
96
+ - name: daqueued
97
+ type: bool
98
+ length: 1
99
+ - name: holdabn
100
+ type: bool
101
+ length: 1
102
+ - name: malicious
103
+ type: bool
104
+ length: 1
105
+ - name: observingcall
106
+ type: bool
107
+ length: 1
108
+ - name: transferred
109
+ type: bool
110
+ length: 1
111
+ - name: agentreleased
112
+ type: boolint
113
+ length: 1
114
+ - name: acdnum
115
+ type: int
116
+ length: 1
117
+ - name: calldisp
118
+ type: int
119
+ length: 1
120
+ - name: disppriority
121
+ type: int
122
+ length: 1
123
+ - name: holds
124
+ type: int
125
+ length: 1
126
+ - name: segment
127
+ type: int
128
+ length: 1
129
+ - name: ansreason
130
+ type: int
131
+ length: 1
132
+ - name: origreason
133
+ type: int
134
+ length: 1
135
+ - name: dispsklevel
136
+ type: int
137
+ length: 1
138
+ - name: events0
139
+ type: int
140
+ length: 1
141
+ - name: events1
142
+ type: int
143
+ length: 1
144
+ - name: events2
145
+ type: int
146
+ length: 1
147
+ - name: events3
148
+ type: int
149
+ length: 1
150
+ - name: events4
151
+ type: int
152
+ length: 1
153
+ - name: events5
154
+ type: int
155
+ length: 1
156
+ - name: events6
157
+ type: int
158
+ length: 1
159
+ - name: events7
160
+ type: int
161
+ length: 1
162
+ - name: events8
163
+ type: int
164
+ length: 1
165
+ - name: ucid
166
+ type: str
167
+ length: 21
168
+ - name: dispvdn
169
+ type: str
170
+ length: 8
171
+ - name: eqloc
172
+ type: str
173
+ length: 10
174
+ - name: firstvdn
175
+ type: str
176
+ length: 8
177
+ - name: origlogid
178
+ type: str
179
+ length: 10
180
+ - name: anslogid
181
+ type: str
182
+ length: 10
183
+ - name: lastobserver
184
+ type: str
185
+ length: 10
186
+ - name: dialednumber
187
+ type: str
188
+ length: 25
189
+ - name: callingparty
190
+ type: str
191
+ length: 13
192
+ - name: collectdigits
193
+ type: str
194
+ length: 17
195
+ - name: cwcdigits
196
+ type: str
197
+ length: 17
198
+ - name: callingII
199
+ type: str
200
+ length: 3
201
+ - name: cwcs0
202
+ type: str
203
+ length: 17
204
+ - name: cwcs1
205
+ type: str
206
+ length: 17
207
+ - name: cwcs2
208
+ type: str
209
+ length: 17
210
+ - name: cwcs3
211
+ type: str
212
+ length: 17
213
+ - name: cwcs4
214
+ type: str
215
+ length: 17
216
+ - name: vdn2
217
+ type: str
218
+ length: 16
219
+ - name: vdn3
220
+ type: str
221
+ length: 16
222
+ - name: vdn4
223
+ type: str
224
+ length: 16
225
+ - name: vdn5
226
+ type: str
227
+ length: 16
228
+ - name: vdn6
229
+ type: str
230
+ length: 16
231
+ - name: vdn7
232
+ type: str
233
+ length: 16
234
+ - name: vdn8
235
+ type: str
236
+ length: 16
237
+ - name: vdn9
238
+ type: str
239
+ length: 16
240
+ - name: asaiuui
241
+ type: str
242
+ length: 97
243
+ - name: interruptdel
244
+ type: int
245
+ length: 1
246
+ - name: agentsurplus
247
+ type: int
248
+ length: 1
249
+ - name: agentskilllevel
250
+ type: int
251
+ length: 1
252
+ - name: prefskilllevel
253
+ type: int
254
+ length: 1
255
+ - name: padding
256
+ type: string
257
+ length: 45
258
+
259
+ #ACD table definition derived from acd.dat
260
+ echi_acds:
261
+ - name: acd_id
262
+ type: str
263
+ length: 255
264
+ - name: acd_number
265
+ type: str
266
+ length: 255
267
+ - name: name
268
+ type: str
269
+ length: 255
270
+
271
+ #Agents table definition derived from agname.dat
272
+ echi_agents:
273
+ - name: group_id
274
+ type: str
275
+ length: 255
276
+ - name: login_id
277
+ type: str
278
+ length: 255
279
+ - name: name
280
+ type: str
281
+ length: 255
282
+
283
+ #Aux Reasons table definition derived from aux_rsn.dat
284
+ echi_reasons:
285
+ - name: group_id
286
+ type: str
287
+ length: 255
288
+ - name: aux_reason
289
+ type: str
290
+ length: 255
291
+ - name: name
292
+ type: str
293
+ length: 255
294
+
295
+ #CWC definition derived from cwc.dat
296
+ echi_cwcs:
297
+ - name: group_id
298
+ type: str
299
+ length: 255
300
+ - name: cwc
301
+ type: str
302
+ length: 255
303
+ - name: name
304
+ type: str
305
+ length: 255
306
+
307
+ #Split table definition derived from split.dat
308
+ echi_splits:
309
+ - name: acd_number
310
+ type: str
311
+ length: 255
312
+ - name: split_number
313
+ type: str
314
+ length: 255
315
+ - name: name
316
+ type: str
317
+ length: 255
318
+
319
+ #Trunk Group table definition derived from tkgrp.dat
320
+ echi_trunks:
321
+ - name: acd_number
322
+ type: str
323
+ length: 255
324
+ - name: trunk_group
325
+ type: str
326
+ length: 255
327
+ - name: name
328
+ type: str
329
+ length: 255
330
+
331
+ #VDN definition derived from vdn.dat
332
+ echi_vdns:
333
+ - name: group_id
334
+ type: str
335
+ length: 255
336
+ - name: vdn
337
+ type: str
338
+ length: 255
339
+ - name: name
340
+ type: str
341
+ length: 255
342
+
343
+ #Vector definition derived from vector.dat
344
+ echi_vectors:
345
+ - name: acd_number
346
+ type: str
347
+ length: 255
348
+ - name: vector_number
349
+ type: str
350
+ length: 255
351
+ - name: name
352
+ type: str
353
+ length: 255
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "echi-converter/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'echi-converter'
7
+ s.version = EchiConverter::VERSION::STRING
8
+ s.authors = ['Jason Goecke', 'Ben Klang']
9
+ s.email = ['echi@mojolingo.com']
10
+ s.homepage = "https://github.com/mojolingo/echi-converter"
11
+ s.summary = %q{ECHI Conversion Utility}
12
+ s.description = %q{Provides a utility to fetch Avaya CMS / ECHI binary files, convert them and insert into a database table via ActiveRecord}
13
+
14
+ s.rubyforge_project = "ruby_speech"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_runtime_dependency %q<activerecord>, ['>=1.15.3']
22
+ s.add_runtime_dependency %q<activesupport>, ['>=1.4.2']
23
+ s.add_runtime_dependency %q<daemons>, ['>=1.0.7']
24
+ s.add_runtime_dependency %q<fastercsv>, ['>=1.2.0']
25
+ s.add_runtime_dependency %q<rake>, ['>=0.7.3']
26
+ s.add_runtime_dependency %q<uuidtools>, ['>=1.0.1']
27
+
28
+ s.add_development_dependency 'yard'
29
+ end
Binary file
Binary file
@@ -6,6 +6,7 @@ require 'net/smtp'
6
6
  require 'fileutils'
7
7
  require 'uuidtools'
8
8
  require 'thread'
9
+ require 'logger'
9
10
  require $workingdir + '/ftp_fetcher.rb'
10
11
 
11
12
  class Logger
@@ -88,7 +89,7 @@ module EchiConverter
88
89
  #Method to strip special characters from a string
89
90
  def strip_specials(data)
90
91
  if $config["strip_characters"] == true
91
- $config["characters_to_strip"].to_a.each do |char|
92
+ [*$config["characters_to_strip"]].compact.each do |char|
92
93
  data.gsub!(char.chr,"")
93
94
  end
94
95
  end
@@ -317,7 +318,7 @@ module EchiConverter
317
318
  #in order to commit as one atomic action upon success
318
319
  EchiRecord.transaction do
319
320
  @record_cnt = 0
320
- FasterCSV.foreach(echi_file) do |row|
321
+ CSV.foreach(echi_file) do |row|
321
322
  if row != nil
322
323
  @log.debug '<====================START RECORD ' + @record_cnt.to_s + ' ====================>'
323
324
  echi_record = EchiRecord.new
@@ -544,4 +545,4 @@ module EchiConverter
544
545
  end
545
546
 
546
547
  require $workingdir + '/echi-converter/version.rb'
547
- end
548
+ end