Contact Centers, CRM Customer Engagement

 View Only
Expand all | Collapse all

CMS Script to open CMS integrated report without a login?

  • 1.  CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 07:57 AM

    Windows 10 has this kiosk feature that we're trying to implement for our callcenter as a wallboard, we're wanting this to be a no-touch for the call center, we've setup a kiosk pc in our own department for network monitoring, and it's been succesful.

    The problem I'm running into is creating a script to open and sign into CMS automatically. I've looked through the threads for automatic scripts but they don't quite accomplish what I'm looking for.

    Here's what would happen:

    When the kiosk pc is started it's in a particular shell that only opens a script or program, in this case CMS, but I need the script to be a combination of automatic and interactive. Automatic in the sense that it logs in automatically but interactive in that it runs the report in the foreground and keeps it open. Has anyone done this? Here's the sample of the script I have so far:

     

    'LANGUAGE=ENU

    'SERVERNAME=sv-av-cms

    Public Sub Main()

     '## cvs_cmd_begin

    '## ID = 2001

    '## Description = "Report: Integrated: Designer: CSC Wallboard: Display"

    '## Parameters.Add "Report: Integrated: Designer: CSC Wallboard: Display","_Desc"

    '## Parameters.Add "Reports","_Catalog"

    '## Parameters.Add "4","_Action"

    '## Parameters.Add "0","_Quit"

    '## Parameters.Add "Integrated\Designer\CSC Wallboard","_Report"

    '## Parameters.Add "1","_ACD"

    '## Parameters.Add "-120","_Top"

    '## Parameters.Add "-120","_Left"

    '## Parameters.Add "29040","_Width"

    '## Parameters.Add "15840","_Height"

    '## Parameters.Add "default","_TimeZone"

    '## Parameters.Add "5","_RefreshInterval"

    '## Parameters.Add "The report Integrated\Designer\CSC Wallboard was not found on ACD 1.","_ReportNotFound"

    '## Parameters.Add "*","_BeginProperties"

    '## Parameters.Add "111-121;210-214","Splits/Skills"

    '## Parameters.Add "*","_EndProperties"

    '## Parameters.Add "*","_BeginViews"

    '## Parameters.Add "*","_EndViews"

     

       On Error Resume Next

     

    Dim cmsApplication As ACSUP.cvsApplication 'acsApp.exe

    Dim cmsServer As ACSUPSRV.cvsServer 'acsSRV.exe

    Dim cmsConnection As ACSCN.cvsConnection 'cvsconn.dll

    Dim cmsCatalog As ACSCTLG.cvsCatalog 'cvsctlg.dll

    Dim cmsReport As ACSREP.cvsReport 'acsRep.exe

    Dim myLog As String, myPass As String

     

    set myLog = "(usernamehere)"

    set myPass = "(passwordhere)"

    set objApp = CreateObject("ACSUP.cvsApplication")

    set objConn = CreateObject("ACSCN.cvsConnection")

    set objSrv = CreateObject("ACSUPSRV.cvsServer")

    set cvsApp = new objapp

    set cvsConn = new objconn

    set cvsSrv = new objsrv

    If cvsApp.CreateServer(myLog, myPass, "", "sv-av-cms", False, "ENU", cvsSvr, cvsConn) Then

    If cvsConn.Login(myLog, myPass, "", "sv-av-cms", "ENU") Then

    End IF

    END IF

        cvsSrv.Reports.ACD = 1

       Set Info = cvsSrv.Reports.Reports("Integrated\Designer\CSC Wallboard")

     

       If Info Is Nothing Then

                      If cvsSrv.Interactive Then

                                      MsgBox "The report Integrated\Designer\CSC Wallboard was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"

                      Else

                                      Set Log = CreateObject("ACSERR.cvsLog")

                                      Log.AutoLogWrite "The report Integrated\Designer\CSC Wallboard was not found on ACD 1."

                                      Set Log = Nothing

                      End If

       Else

                        b = cvsSrv.Reports.CreateReport(Info,Rep)

                       If b Then

                           Rep.Window.Top = -120

                          Rep.Window.Left = -120

                          Rep.Window.Width = 29040

                          Rep.Window.Height = 15840       

                          Rep.TimeZone = "default"

                          Rep.SetProperty "Splits/Skills","111-121;210-214"

                          Rep.RefreshInterval = 5

                          b = Rep.Run

                  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

     

    I'm not familiar with VBA at all, have some experience in powershell and bash but it's been a while. I feel like I need to call the actually controller or something so that the program is launched rather than the utilities that run in the background?

     

    Any help is appreciated.



  • 2.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 09:26 AM
      |   view attached

    Matt,

    Below is what we run on a 2012 Server. It creates a web page that you can bookmark

    See the attached for the TOOLS/OPTION/SCRIPTING setup for the auto logon and password.

    _____________________________________

    SCRIPTING FILES CMS REPORTS

    ________________________________________
    Title = reports.bat



    @ECHO OFF

     

    REM ## reports.bat

    REM ## September 24, 2015

     

    REM ## Terminate running reports (order of processes is significant!)

    TASKKILL /F /FI "USERNAME eq service.cms" /IM ACScript.exe

    TASKKILL /F /FI "USERNAME eq service.cms" /IM acsRep.exe

    TASKKILL /F /FI "USERNAME eq service.cms" /IM ACSTrans.exe

    TASKKILL /F /FI "USERNAME eq service.cms" /IM acsApp.exe

    TASKKILL /F /FI "USERNAME eq service.cms" /IM acsSRV.exe

     

    REM ## Wait...

    PING 127.0.0.1 -n 12

     

    REM ## Restart reports script

    %SystemRoot%\SysWOW64\cmd.exe /C "C:\Avaya CMS Supervisor Scripting\reports.acsauto"
     
    _________________________________________


    Title = reports.acsauto








    ' reports.acsauto

    ' September 24, 2015

     

    'LANGUAGE=ENU

    'SERVERNAME=1XX.16.XX.49   (The IP of the CMS)

     

    Public Sub Main()

      Dim ReportPaths(9)

      Dim OutputPaths(9)

      Dim PropertyNames(9)

      Dim PropertyValues(9)

      Dim Reports(9)

     

      ' HTML export template

      Const Template = "C:\Avaya CMS Supervisor Scripting\Reports\template.html"

      

      '   1 - CAAA

      '   2 - HH

      '   3 - NS

      '   4 - NSSS

      '   5 - BCC

      '   6 - OPX

      '   7 - OP_YYC    (Skill sets_names)

      '   8 - OP_XXX

      '   9 - WAS

      '  10 - WA_FFF

      ' 100 - RECEPTION

      

      ' 0 - Skill Comparison Report: Call Centre  1

      ReportPaths(0) = "Integrated\Designer\Skill Comparison Report"

      OutputPaths(0) = "C:\Avaya CMS Supervisor Scripting\Reports\skill_comparison_report_gcc.html"

      PropertyNames(0) = "Splits/Skills"

      PropertyValues(0) = "1;2;3;5;6;7;8;12;14;15;21;22;23;24;30;51;52"   (Put the Skills here)

      

      ' 1 - Skill Comparison Report: Call Center 2

      ReportPaths(1) = "Integrated\Designer\Skill Comparison Report"

      OutputPaths(1) = "C:\Avaya CMS Supervisor Scripting\Reports\skill_comparison_report_aacc.html"

      PropertyNames(1) = "Splits/Skills"

      PropertyValues(1) = "9;18;53"

      

      ' 2 - Skill Comparison Report: Help Desk

      ReportPaths(2) = "Integrated\Designer\Skill Comparison Report"

      OutputPaths(2) = "C:\Avaya CMS Supervisor Scripting\Reports\skill_comparison_report_hd.html"

      PropertyNames(2) = "Splits/Skills"

      PropertyValues(2) = "47;48;49;50;55;68;69"

      

      ' 3 - Agent Group Report: Call Centre 3

      ReportPaths(3) = "Real-Time\Agent\Agent Group Report"

      OutputPaths(3) = "C:\Avaya CMS Supervisor Scripting\Reports\agent_group_report_gcc.html"

      PropertyNames(3) = "Agent Group"

      PropertyValues(3) = "Guelph Call Centre"

      

      ' 4 - Agent Group Report: Group 1

      ReportPaths(4) = "Real-Time\Agent\Agent Group Report"

      OutputPaths(4) = "C:\Avaya CMS Supervisor Scripting\Reports\agent_group_report_g1.html"

      PropertyNames(4) = "Agent Group"

      PropertyValues(4) = "Group 1 Team"

      

      ' 5 - Agent Group Report: Group 2

      ReportPaths(5) = "Real-Time\Agent\Agent Group Report"

      OutputPaths(5) = "C:\Avaya CMS Supervisor Scripting\Reports\agent_group_report_g2.html"

      PropertyNames(5) = "Agent Group"

      PropertyValues(5) = "Group 2 Team"

      

      ' 6 - Agent Group Report: Group 3

      ReportPaths(6) = "Real-Time\Agent\Agent Group Report"

      OutputPaths(6) = "C:\Avaya CMS Supervisor Scripting\Reports\agent_group_report_g3.html"

      PropertyNames(6) = "Agent Group"

      PropertyValues(6) = "Group 3 Team"

      

      ' 7 - Agent Group Report: French

      ReportPaths(7) = "Real-Time\Agent\Agent Group Report"

      OutputPaths(7) = "C:\Avaya CMS Supervisor Scripting\Reports\agent_group_report_fr.html"

      PropertyNames(7) = "Agent Group"

      PropertyValues(7) = "French Team"

      

      ' 8 - Agent Group Report: Team Leads

      ReportPaths(8) = "Real-Time\Agent\Agent Group Report"

      OutputPaths(8) = "C:\Avaya CMS Supervisor Scripting\Reports\agent_group_report_tl.html"

      PropertyNames(8) = "Agent Group"

      PropertyValues(8) = "Team Leads"

      

      ' 9 - Agent Group Report: Help Desk

      ReportPaths(9) = "Real-Time\Agent\Agent Group Report"

      OutputPaths(9) = "C:\Avaya CMS Supervisor Scripting\Reports\agent_group_report_hd.html"

      PropertyNames(9) = "Agent Group"

      PropertyValues(9) = "Help Desk Team"

     

      On Error Resume Next

     

      ' Create Shell object used to run external sleep script

      Set WshShell = CreateObject("WScript.Shell")

     

      cvsSrv.Reports.ACD = 1

     

      For i = 0 To UBound(ReportPaths)

        ' Create Report object

        Set Info = cvsSrv.Reports.Reports(ReportPaths(i))

        result = cvsSrv.Reports.CreateReport(Info, Report)

     

        ' Configure Report object

        Report.SetProperty PropertyNames(i), PropertyValues(i)

        Report.RefreshInterval = 5 ' Refresh interval in seconds; minimum value is 3

     

        Set Reports(i) = Report

      Next

     

      Do While 1 ' Infinite loop

        For i = 0 To UBound(Reports)

          Set Report = Reports(i)

     

          ' Export each report using the specified template

          Report.SaveHTML OutputPaths(i), False, Template

        Next

     

        ' Sleep to curb excessive resource consumption (infinite loop)

        WshShell.Run "WScript.exe sleep.vbs", , True

      Loop

     

      ' Exit code; unreachable!

      For i = 0 To UBound(Reports)

        Set Report = Reports(i)

     

        Report.Quit

        If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Report.TaskID

        Set Report = Nothing

      Next

     

      Set Info = Nothing

    End Sub
     
    ____________________________________________________

    NAM= reports.acsauto


    WScript.Sleep 5000
     
    ____________________________________________________

    template.js








    var thresholds = {

        'CAAA': 80,

        'HH': 95,

        'NS': 95,

        'NSSS': 95,

        'OPX': 80,

        'OP_YYC': 80,

        'OP_XXX': 80,

        'WAS': 95,

        'WA_FFF': 95,

        'RECEPTION': 80,

       
    };

     

    function stylize_agent_group_report() {

        $('tr').each(function(index) {

            if (index != 0) { // skip table header

                // state

                var state_td = $('td', this).eq(5);

                var state = state_td.text();

     

                if ((state == 'AVAIL') || (state == 'ACDIN')) {

                    state_td.css('color', 'darkgreen');

                    state_td.css('font-weight', 'bolder');

                    $(this).css('background-color', 'lightgreen');

                } else {

                    state_td.css('color', 'red');

                    state_td.css('font-weight', 'bolder');

                    $(this).css('background-color', 'yellow');

                }

            }

        });

     

        // remove icon column (broken)

        $('tr th:nth-child(1), tr td:nth-child(1)').remove();

     

        // remove Login ID column (DS2260)

        $('tr th:nth-child(2), tr td:nth-child(2)').remove();

    }

     

    function stylize_skill_comparison_report() {

        $('tr').each(function(index) {

            if (index != 0) { // skip table header

                // skill

                var skill_td = $('td', this).eq(0);

                var skill = skill_td.text();

                

                // calls waiting

                var waiting_td = $('td', this).eq(2);

                var raw_waiting = waiting_td.text();

                var waiting = parseInt(raw_waiting);

                

                // oldest call waiting

                var oldest_td = $('td', this).eq(3);

                var raw_oldest = oldest_td.text();

                var split_oldest = raw_oldest.split(':');

                var oldest = 60 * parseInt(split_oldest[0]) + parseInt(split_oldest[1]);

                

                // TSF

                var tsf_td = $('td', this).eq(9);

                var raw_tsf = tsf_td.text();

                var tsf = parseFloat(raw_tsf);

     

                if (tsf == 100) {

                    tsf_td.css('color', 'darkgreen');

                    tsf_td.css('font-weight', 'bolder');

                    $(this).css('background-color', 'lightgreen');

                }

                

                if (waiting > 3) {

                    waiting_td.css('color', 'red');

                    waiting_td.css('font-weight', 'bolder');

                    $(this).css('background-color', 'yellow');

                }

                

                if (oldest > 300) {

                    oldest_td.css('color', 'red');

                    oldest_td.css('font-weight', 'bolder');

                    $(this).css('background-color', 'yellow');

                }

                

                if (tsf < thresholds[skill]) {

                    tsf_td.css('color', 'red');

                    tsf_td.css('font-weight', 'bolder');

                    $(this).css('background-color', 'yellow');

                }

            }

        });

    }

            

    $(document).ready(function() {

        $('#mod').text(document.lastModified);

        

        if (document.title.indexOf('Agent Group Report') >= 0) {

            stylize_agent_group_report();

        } else if (document.title.indexOf('Skill Comparison Report') >= 0) {

            stylize_skill_comparison_report();

        }

    });
     
    ________________________________________________

    style.css








    body {

        font-family: sans-serif;

    }
     
    ______________________________________________

    Bill Perkins

    23years Bell Support 6 years Lucent Team Lead



  • 3.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 09:46 AM

    The attachment is the Scripting setup on CMS Supervisor that needs to be install on the local PC-Server.

    Bill Perkins

    23years Bell Support 6 years Lucent Team Lead



  • 4.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 10:55 AM

    Hi Bill,

    Great scripting! I'm sort of half way through building an HTML wallboard app using a plugin for Chrome that will auto cycle through tabs refreshing as it goes. This will help immensely!

    Could you just explain the Javascript you have at the end and how I use that to influence the web templates. Java has never been my strong point!

    Many thanks in advance

    Paul



  • 5.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 11:04 AM

    It is Not my strong suit either, had help from the team here. The .js creates the sections on the wallboard and inserts colors based on the result.
    Best bet is to get it working and tweak it slightly to watch what changes.

    This is based on some built in scripting within the cms itself that displays the reports within CMS Supervisor.

    Bill Perkins

    23years Bell Support 6 years Lucent Team Lead



  • 6.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 01:53 PM

    So are all the lines individual scripts then?

    This looks like it could work, only problem being with the win 10 kiosk it creates it's own shell around an .exe which has to stay running, if it's closed then you can choose to relaunch or reboot. I guess what I'm really looking at is a way to start CMS with an interactive script but have it somehow send the login info or use the credentials assigned for the auto user.



  • 7.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 02:32 PM

    Matt, this example will create constantly refreshed HTML-based CMS reports. All you need to do is run a web browser inside your kiosk (the .exe) that is browsing to the reports that are generated and it will display the results.

    The example script is generating 10 HTML views but obviously you can cut this down to whatever you need and further manipulate the skills and/or indeed the reports being called. The HTML output folder would then need to be the subject of a virtual directory in IIS or similar so that the kiosk browser can 'see' it

    It's a shame I have so many meetings tomorrow otherwise I'd load this up, debug and get a working model together.

    Paul


    In Reply to Matt Ables:

    So are all the lines individual scripts then?

    This looks like it could work, only problem being with the win 10 kiosk it creates it's own shell around an .exe which has to stay running, if it's closed then you can choose to relaunch or reboot. I guess what I'm really looking at is a way to start CMS with an interactive script but have it somehow send the login info or use the credentials assigned for the auto user.



  • 8.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 02:34 PM

    This is the Chrome plugin that I'm using to force the tabs to rotate and refresh automatically so I can have multiple views displayed on the wallboard screens. It's called Revolver -> https://chrome.google.com/webstore/detail/revolver-tabs/dlknooajieciikpedpldejhhijacnbda?hl=en



  • 9.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 02:52 PM

    What does the WScript.Sleep 50000 accmoplish?

     

    Also I'm looking at refreshing these around every 5 seconds, do you just accomplish the refresh rate by scheduling it in windows to run every so often?



  • 10.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-08-2017 12:44 AM

    Matt, that section was a victim of cut and paste I think. It should read;

    ____________________________________________________
    NAME=sleep.vbs

    WScript.Sleep 5000

     ____________________________________________________

    It relates to this part of the .acsauto script and is called to limit resource hogging;

        ' Sleep to curb excessive resource consumption (infinite loop)
        WshShell.Run "WScript.exe sleep.vbs", , True

    5000 is the time in milliseconds so you'll be seeing a pause of 5 seconds before the scripts re-run. The actual refresh rate at your kiosk will depend on the browser refresh pulling fresh HTML data.

    Trust this helps. 


    In Reply to Matt Ables:

    What does the WScript.Sleep 50000 accmoplish?

     

    Also I'm looking at refreshing these around every 5 seconds, do you just accomplish the refresh rate by scheduling it in windows to run every so often?



  • 11.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-08-2017 07:55 AM

    Yeah I was working on this last night and meant to respond, after a bit of googling I found what the sleep.vbs was for and created that file.

    Is there a template.html file you use as well or should that point to the template.js? I noticed it was defined as a const but didn't see it included, sorry if that's a newb question I've done the least in html.

    So far I have reports.acsauto, reports.bat, sleep.vbs, style.css, and template.js.

    I'm also running into an issue with running the auto script, for whatever reason it's not using the user I have assigned in CMS for the automatic scripts. Error 2147614977 occured within the Script Host Engine. Other automatic scripts work fine on the pc, just that one. The only thing I've found on Avaya's support site for that error was to change the script user from cms to another user, which it already is. I'm going to try re-installing the cms client, we're on 17.0.LA.31



  • 12.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-08-2017 08:16 AM

    Re-installation didn't fix it, I read somewhere that one of the 17.0.x versions had issues with scripting. I installed the 18 version and got the same issue. It's still trying to use the wrong username to login. Other automatic scripts still work with the new client too.



  • 13.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-09-2017 01:14 AM

    Hi Matt

    Sorry had a busy one yesterday.

    I'm in the same query boat as you when it comes to using templates and I'm researching how to use them effectively at the moment.

    I concur with the files - same here, all present and correct just not tested in anger yet.

    In conjunction with your other post, I would load up CMS Supervisor version 18 revision MA41 which is the latest and it's got a few fixes included that mainly help with SSH logins but the scripting engine is good in that version. The error you're getting with the auto scripting is usually because of the user with shell access issue that you've found but I would also delete the CMS cache from users\roaming\avaya\cms too as that tends to hang on to old logins.

    Back on this Monday, I really want to get a V2 of my wallboards out there before Christmas!

    Paul.

    In Reply to Matt Ables:

    Yeah I was working on this last night and meant to respond, after a bit of googling I found what the sleep.vbs was for and created that file.

    Is there a template.html file you use as well or should that point to the template.js? I noticed it was defined as a const but didn't see it included, sorry if that's a newb question I've done the least in html.

    So far I have reports.acsauto, reports.bat, sleep.vbs, style.css, and template.js.

    I'm also running into an issue with running the auto script, for whatever reason it's not using the user I have assigned in CMS for the automatic scripts. Error 2147614977 occured within the Script Host Engine. Other automatic scripts work fine on the pc, just that one. The only thing I've found on Avaya's support site for that error was to change the script user from cms to another user, which it already is. I'm going to try re-installing the cms client, we're on 17.0.LA.31



  • 14.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-13-2017 01:42 PM

    Do you know what template file is being used? I've seen some CMS documents referring to built in template files but I can't seem to locate them anywhere.

     

    Still having the issue of the auto script not launching but I think I can copy some registry keys to fix that we'll see how that goes.



  • 15.  RE: CMS Script to open CMS integrated report without a login?

    Posted 12-07-2017 02:26 PM

    Gotcha.

    I'm quite slick with the CMS scripting and can see how it creates the various HTML views on a loop to keep the view updated. This I can can host on my Iptel server quite easily. Just a little curious to how the template that's used to embed the reports into is influenced by the Java. I might need to go and hassle one of our code boys, feed them soem snacks to see what they can tell me :)

    Thanks again

    Paul.



    In Reply to Bill Perkins, Telecom Analyst:

    It is Not my strong suit either, had help from the team here. The .js creates the sections on the wallboard and inserts colors based on the result.
    Best bet is to get it working and tweak it slightly to watch what changes.

    This is based on some built in scripting within the cms itself that displays the reports within CMS Supervisor.

    Bill Perkins

    23years Bell Support 6 years Lucent Team Lead