重要的!这不是正确的做法!这只是我需要实施的快速破解。直接连接到 Avaya DB 会好很多。Windows 任务计划程序很慢。这只会在本地网络上运行。
我对这个快速破解的计划是:
- 登录 Avaya CMS Supervisor 19.0 版
- 运行“.acsauto”
- 将数据提取到 .txt
看起来像这样:
Some Nice Service Desk
2,Martin Scorsese,8869711,5543711,,AVAIL,0,47,
5,Alfred Hitchcock,8869712,5543732,Default,AUX,0,785,
5,Stanley Kubrick,8869714,5543722,Default,AUXOUT,173,85,
2,Francis Ford Coppola,8869715,5543733,,AVAIL,0,1252,
5,John Huston,8869713,5543743,Default,AUXOUT,173,186,
- 最后将其加载到 MySQL 8.0.19 表中:
CREATE TABLE `avaya_live_report` (
`icon_number` TINYINT unsigned NOT NULL,
`agent_name` TINYTEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`agent_number` INT unsigned NOT NULL,
`extension` INT unsigned NOT NULL,
`state_type` TINYTEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`state` TINYTEXT NOT NULL,
`zero` TINYINT unsigned NOT NULL,
`time` SMALLINT unsigned NOT NULL,
`empty` TINYTEXT NOT NULL);
由于不可能在 MySQL 上将Load Data安排为计划的重新获取事件:
LOAD DATA INFILE 'C:\\ProgramData\\MySQL\\MySQL Server 8.0\\Uploads\\live_report.txt'
INTO TABLE avaya_live_report
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
IGNORE 1 LINES;
我需要直接从 .acsauto 脚本连接到 MySQL:
'LANGUAGE=ENU
'SERVERNAME=SOME_NICE_IP_ADDRESS
Public Sub Main()
'## begin
'## ID = 1000
'## Description = "Report: Real-Time: Agent: Agent Group Report: Export Data"
'## Parameters.Add "Report: Real-Time: Agent: Agent Group Report: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Real-Time\Agent\Agent Group Report","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "1335","_Top"
'## Parameters.Add "2580","_Left"
'## Parameters.Add "6930","_Width"
'## Parameters.Add "4575","_Height"
'## Parameters.Add "default","_TimeZone"
'## Parameters.Add "The report Real-Time\Agent\Agent Group Report was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "Nice Service Desk","Agent Group"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "C:\Scripts\live.txt","_Output"
'## Parameters.Add "9","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "False","_NullToZero"
'## Parameters.Add "False","_Labels"
'## Parameters.Add "True","_DurSecs"
On Error Resume Next
cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Real-Time\Agent\Agent Group Report")
If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Real-Time\Agent\Agent Group Report was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Real-Time\Agent\Agent Group Report was not found on ACD 1."
Set Log = Nothing
End If
Else
b = cvsSrv.Reports.CreateReport(Info,Rep)
If b Then
Rep.Window.Top = 1335
Rep.Window.Left = 2580
Rep.Window.Width = 6930
Rep.Window.Height = 4575
Rep.TimeZone = "default"
Rep.SetProperty "Agent Group","Nice Service Desk"
' StackOverflow PLEASE START READING HERE
' This loop lets me action something and then wait for 30 seconds in a loop
For i=1 To 10
' This line creates this nice comma separated txt file (Using TXT file is a lot faster then CSV)
b = Rep.ExportData("C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\live_report.txt", 44, 0, True, False, True)
Dim dteWait
'30 sek
dteWait = DateAdd("s", 30, Now())
Do Until (Now() > dteWait)
Loop
Next
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
End If
Set Info = Nothing
'## cvs_cmd_end
End Sub
我需要将此与 MySQL 的连接集成到上面的脚本中。显然,下面的脚本只是 VBA Excel 脚本,所以它非常棘手。
连接
conMySQL.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};" & "SERVER=" & server & ";" & " DATABASE=" & database & ";" & "UID=" & login_user & ";PWD=" & password & "; OPTION=3; PORT=" & port & ";Connect Timeout=20;"
conMySQL.Open
询问
strSQL = "SELECT x FROM some_table"
MySQL.Query (strSQL)
With rsTemporary
Do Until .EOF
recordCount = recordCount + 1
some_variable = ![supcode]
rsTemporary.MoveNext
Loop
End With
MySQL.closeCon
我已经安装了ODBC 驱动程序,但除此之外,我的开发环境中只有 Avaya CMS Supervisor 版本 19.0 + MySQL 8.0.19。
我的问题: 是否有人尝试将此 MySQL 连接集成到 .acsauto Avaya 脚本中?
先感谢您。KK