Author Topic: How can I get configured status messages of an agent?  (Read 5635 times)

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
How can I get configured status messages of an agent?
« on: March 17, 2019, 03:33:23 AM »
How can I get configured status messages of an agent?

============================================================================
Genesyslab.Platform.Voice.Protocols.TServer.Requests.Userdata.RequestUpdateUserData requestUpdateUserData =
                Genesyslab.Platform.Voice.Protocols.TServer.Requests.Userdata.RequestUpdateUserData.Create();

requestUpdateUserData.UserData.GetAsKeyValueCollection("XXX");
============================================================================

1. What should be the search string for KeyValueCollection?
2. Is there any specific function for retrieve current agent configured status message?

Thank you.
เด็กเอ๋ยเด็กดีนั้นมีหน้าที่สิบอย่างด้วยกัน

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7622
  • Karma: 56330
Re: How can I get configured status messages of an agent?
« Reply #1 on: March 18, 2019, 12:08:45 AM »
What do you exactly mean? Status of what?
What messages?

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #2 on: March 18, 2019, 12:44:22 AM »
I revise to this:

private void temp2()
{
    var pmService = new Genesyslab.Platform.ApplicationBlocks.Commons.Protocols.ProtocolManagementService();
    var config = new Genesyslab.Platform.ApplicationBlocks.Commons.Protocols.ConfServerConfiguration(
        Genesyslab.Platform.Configuration.Protocols.Types.CfgAppType.CFGConfigServer.ToString())
    {
        Uri = new Uri("tcp://192.168.10.98:2020/"),  //- Target server hostport
        UseAddp = true, // - ConnectionConfiguration typified options like UseAddp, AddpClientTimeout, etc
        AddpServerTimeout = 10,
        AddpClientTimeout = 10,
        FaultTolerance = Genesyslab.Platform.ApplicationBlocks.Commons.Protocols.FaultToleranceMode.WarmStandby,
        WarmStandbyUri = new Uri("tcp://192.168.10.98:2020/"),  //- Backup server hostport
        WarmStandbyAttempts = 3,  //- WarmStandby typified options like WarmStandbyAttempts, etc
        WarmStandbyTimeout = 2000,
        ClientName = "ClientName", //  - Protocol handshake typified options like ClientName, etc
        UserName = "demo",
        UserPassword = "",
        Encoding = "utf-8"
    };
        Genesyslab.Platform.Commons.Protocols.IProtocol protocol = pmService.Register(config);
        pmService.BeginOpen();
   
        Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.IConfService IConfService =
            Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfServiceFactory.CreateConfService(
            protocol);

    Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgActionCodeQuery CfgActionCodeQuery =
        new Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgActionCodeQuery(IConfService);
    CfgActionCodeQuery.Filter.OfType<Genesyslab.Platform.Configuration.Protocols.Types.CfgCallActionCode>();
    CfgActionCodeQuery.Name = "KSippola";
    ICollection<Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgActionCode> CfgActionCode =
        CfgActionCodeQuery.Execute();
}

return ...

Genesyslab.Platform.Configuration.Protocols.Exceptions.ConfRegistrationException was unhandled
  Message="Error registering. Code: 8 Description: Client is not authorized"
  Source="Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel"
  ErrorDescription="Client is not authorized"
  StackTrace:
    [Rethrow at]
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.EndRetrieveMultipleObjects[T](IAsyncResult asyncResult)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.RetrieveMultipleObjects[T](ICfgQuery query, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.RetrieveMultipleObjects[T](ICfgQuery query)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgQuery.Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.ICfgQuery.Execute[T]()
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgActionCodeQuery.Execute()
       at COMAPI.Form1.temp2() in C:\Users\Administrator\Documents\Visual Studio 2008\Projects\COMAPI1\COMAPI1\Form1.cs:line 308
       at COMAPI.Form1..ctor() in C:\Users\Administrator\Documents\Visual Studio 2008\Projects\COMAPI1\COMAPI1\Form1.cs:line 24
       at COMAPI.Program.Main() in C:\Users\Administrator\Documents\Visual Studio 2008\Projects\COMAPI1\COMAPI1\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
    Environment: Win32NT [64-bit] 6.1.7601 Service Pack 1 | CLR: 2.0.50727.8784 | iso-8859-1 (1252) | CPU: [x1]
    DEMOSRV [DEMOSRV\Administrator]: "C:\Users\Administrator\Documents\Visual Studio 2008\Projects\COMAPI1\COMAPI1\bin\Debug\COMAPI1.vshost.exe"
  InnerException:
เด็กเอ๋ยเด็กดีนั้นมีหน้าที่สิบอย่างด้วยกัน

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7622
  • Karma: 56330
Re: How can I get configured status messages of an agent?
« Reply #3 on: March 18, 2019, 01:39:29 AM »

What does this has to do with the first post?
There is an authentication error:


  Message="Error registering. Code: 8 Description: Client is not authorized"


Created by:
        ClientName = "ClientName", //  - Protocol handshake typified options like ClientName, etc


Does that app exists in your CME??

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7622
  • Karma: 56330
Re: How can I get configured status messages of an agent?
« Reply #4 on: March 18, 2019, 01:40:57 AM »
Post an ordered question and steps of what you are trying to do.
You start by a generic question and end up with a piece of code that nothing has to do.
Don't post trash please

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #5 on: March 18, 2019, 05:12:08 PM »
After changed the 'clientname', it returns another error like in below:

at line :
ICollection<Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgActionCode> CfgActionCode =
        CfgActionCodeQuery.Execute();


Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfigException was unhandled
  Message="Exception on sending request"
  Source="Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel"
  StackTrace:
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.GlobalConfService.BeginLoadObject(IProtocol protocol, ICfgQuery query, ConfService confService, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout, Object state, Boolean isBriefInfo)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjectFactory.BeginRetrieveMultipleObjects(ICfgQuery query, ConfService confService, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout, Object state, Boolean isBriefInfo)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.BeginRetrieveMultipleObjects(ICfgQuery query, AsyncCallback finishCallback, AsyncCallback dataCallback, Object state, Int64 timeout, Boolean isBriefInfo)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.RetrieveMultipleObjects[T](ICfgQuery query, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.RetrieveMultipleObjects[T](ICfgQuery query)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgQuery.Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.ICfgQuery.Execute[T]()
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgActionCodeQuery.Execute()
       at COMAPI_1.Form1.test2() in C:\Users\Administrator\Documents\Visual Studio 2008\Projects\COMAPI_1\COMAPI_1\Form1.cs:line 56
       at COMAPI_1.Form1..ctor() in C:\Users\Administrator\Documents\Visual Studio 2008\Projects\COMAPI_1\COMAPI_1\Form1.cs:line 17
       at COMAPI_1.Program.Main() in C:\Users\Administrator\Documents\Visual Studio 2008\Projects\COMAPI_1\COMAPI_1\Program.cs:line 18
  InnerException: Genesyslab.Platform.Commons.Protocols.ChannelClosedOnSendException
       Message="Connection is not opened"
       Source="Genesyslab.Platform.Commons.Protocols"
       StackTrace:
            at Genesyslab.Platform.Commons.Protocols.AbstractChannel.ThrowNotOpenedOnSend()
            at Genesyslab.Platform.Commons.Protocols.DuplexChannel.Send(IMessage message)
            at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.GlobalConfService.BeginLoadObject(IProtocol protocol, ICfgQuery query, ConfService confService, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout, Object state, Boolean isBriefInfo)
         Environment: Win32NT [64-bit] 6.1.7601 Service Pack 1 | CLR: 2.0.50727.8784 | iso-8859-1 (1252) | CPU: [x2]
         DEMOSRV [DEMOSRV\Administrator]: "C:\Users\Administrator\Documents\Visual Studio 2008\Projects\COMAPI_1\COMAPI_1\bin\Debug\COMAPI_1.exe"
       InnerException:

Any one have example of query data from the configuration manager?
Thank you
เด็กเอ๋ยเด็กดีนั้นมีหน้าที่สิบอย่างด้วยกัน

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2737
  • Karma: 44
Re: How can I get configured status messages of an agent?
« Reply #6 on: March 18, 2019, 06:16:14 PM »
Connection to the Confserv is not opened as you can see in provided fargment of log. Check your WS (WarmStandby) block whether its implementation is right and you opened conenction before execute queries. Examples describing how to use WS block you can find on official site with PSDK documentation.
Genesys certified professional consultant (GVP, SIP, GIR and Troubleshooting)

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #7 on: March 19, 2019, 05:09:06 PM »
Hi, I also look at the recommended document but both my script and what is provided in the document have the same result. Which is as below error:

Genesyslab.Platform.Configuration.Protocols.Exceptions.ConfRegistrationException was caught
  Message="Error registering. Code: 2230535 Description: Application name is prohibited to login"
  Source="Genesyslab.Platform.Commons.Protocols"
  ErrorDescription="Application name is prohibited to login"
  StackTrace:
    [Rethrow at]
       at Genesyslab.Platform.Commons.Protocols.DuplexChannel.DoOpenImpl(TimeSpan timeOut, Boolean async, Boolean checkExternalControl)
       at Genesyslab.Platform.Commons.Protocols.DuplexChannel.Open(TimeSpan timeOut)
       at Genesyslab.Platform.Commons.Protocols.DuplexChannel.Open()
       at COMAPI_2.Form1.test() in C:\Users\Administrator\AppData\Local\Temporary Projects\COMAPI-2\Form1.cs:line 41
    Environment: Win32NT [64-bit] 6.1.7601 Service Pack 1 | CLR: 2.0.50727.8784 | iso-8859-1 (1252) | CPU: [x2]
    DEMOSRV [DEMOSRV\Administrator]: "C:\Users\Administrator\AppData\Local\Temporary Projects\COMAPI-2\bin\Debug\COMAPI-2.vshost.exe"
  InnerException:
เด็กเอ๋ยเด็กดีนั้นมีหน้าที่สิบอย่างด้วยกัน

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2737
  • Karma: 44
Re: How can I get configured status messages of an agent?
« Reply #8 on: March 19, 2019, 06:31:43 PM »
What is the application type you are using for?
Genesys certified professional consultant (GVP, SIP, GIR and Troubleshooting)

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #9 on: March 20, 2019, 01:02:43 PM »
Genesyslab.Platform.Configuration.Protocols.Types.CfgAppType.CFGConfigServer.ToString())
เด็กเอ๋ยเด็กดีนั้นมีหน้าที่สิบอย่างด้วยกัน

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2737
  • Karma: 44
Re: How can I get configured status messages of an agent?
« Reply #10 on: March 20, 2019, 06:50:20 PM »
You cannot use Configuration Server as the type of the client app, it does not make sense. Use Third Party or Generic Server
Genesys certified professional consultant (GVP, SIP, GIR and Troubleshooting)

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #11 on: March 20, 2019, 08:06:58 PM »
After change to thrid party app (Genesyslab.Platform.Configuration.Protocols.Types.CfgAppType.CFGThirdPartyApp.ToString()): Client UnAuthorized

"\n[Rethrow at]\n   at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.EndRetrieveMultipleObjects[T](IAsyncResult asyncResult)\r\n   at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.RetrieveMultipleObjects[T](ICfgQuery query, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout)\r\n   at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.RetrieveMultipleObjects[T](ICfgQuery query)\r\n   at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgQuery.Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.ICfgQuery.Execute[T]()\r\n   at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgActionCodeQuery.Execute()\r\n   at COMAPI_1.Form1.test2() in C:\\Users\\Administrator\\Documents\\Visual Studio 2008\\Projects\\COMAPI_1\\COMAPI_1\\Form1.cs:line 62\nEnvironment: Win32NT [64-bit] 6.1.7601 Service Pack 1 | CLR: 2.0.50727.8784 | iso-8859-1 (1252) | CPU: [x2] \nDEMOSRV [DEMOSRV\\Administrator]: \"C:\\Users\\Administrator\\Documents\\Visual Studio 2008\\Projects\\COMAPI_1\\COMAPI_1\\bin\\Debug\\COMAPI_1.vshost.exe\" "
เด็กเอ๋ยเด็กดีนั้นมีหน้าที่สิบอย่างด้วยกัน

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2737
  • Karma: 44
Re: How can I get configured status messages of an agent?
« Reply #12 on: March 20, 2019, 08:34:40 PM »
I strongly recommend to learn about PSDK and Genesys as first as you are concerned and doing this without doubt. I personally use Genesys Generic Server or This Party Application where the object must exists in Configuration before first start/usage
Genesys certified professional consultant (GVP, SIP, GIR and Troubleshooting)

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #13 on: March 21, 2019, 10:04:50 PM »
I follow the instruction of Platform connect but the connection never open (I debug the opened event).

private void test()
        {
            Genesyslab.Platform.Commons.Connection.Configuration.PropertyConfiguration tserverConfig = new Genesyslab.Platform.Commons.Connection.Configuration.PropertyConfiguration();

            tserverConfig.UseAddp = true;
            tserverConfig.AddpClientTimeout = 10;
            tserverConfig.AddpServerTimeout = 10;
            tserverConfig.AddpTraceMode = Genesyslab.Platform.Commons.Connection.Configuration.AddpTraceMode.Both;
            tserverConfig.LocalBindingPort = 2020;
            tserverConfig.LocalBindingHost = "192.168.56.101";


            //tserverConfig.SetOption(Genesyslab.Platform.Commons.Connection.AddpInterceptor.ActiveKey, Genesyslab.Platform.Commons.Connection.AddpInterceptor.Name);
            tserverConfig.SetOption(Genesyslab.Platform.Commons.Connection.AddpInterceptor.TimeoutKey, "10");
            tserverConfig.SetOption(Genesyslab.Platform.Commons.Connection.AddpInterceptor.RemoteTimeoutKey, "11.5");
            tserverConfig.SetOption(Genesyslab.Platform.Commons.Connection.AddpInterceptor.TraceKey, "full");

            Genesyslab.Platform.Commons.Protocols.Endpoint tserverEndpoint = new Genesyslab.Platform.Commons.Protocols.Endpoint("T-Server", "192.168.56.101", 2020, tserverConfig);
            Genesyslab.Platform.Voice.Protocols.TServerProtocol tserverProtocol = new Genesyslab.Platform.Voice.Protocols.TServerProtocol(tserverEndpoint);
            tserverProtocol.ClientName = "admin";
            tserverProtocol.ClientPassword = "1234";
            tserverProtocol.Opened += new EventHandler(tserverProtocol_Opened);
            tserverProtocol.BeginOpen();

            Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.IConfService IConfService =
                    Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfServiceFactory.CreateConfService(
                    tserverProtocol);
            Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgActionCodeQuery CfgActionCodeQuery =
                new Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgActionCodeQuery(IConfService);
            //CfgActionCodeQuery.
            CfgActionCodeQuery.Filter.OfType<Genesyslab.Platform.Configuration.Protocols.Types.CfgCallActionCode>();
            CfgActionCodeQuery.Name = "KSippola";
            ICollection<Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgActionCode> CfgActionCode =
                CfgActionCodeQuery.Execute();

            tserverProtocol.Close();

        }

        void tserverProtocol_Opened(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
        }

...
Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfigException was unhandled
  Message="Exception on sending request"
  Source="Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel"
  StackTrace:
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.GlobalConfService.BeginLoadObject(IProtocol protocol, ICfgQuery query, ConfService confService, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout, Object state, Boolean isBriefInfo)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjectFactory.BeginRetrieveMultipleObjects(ICfgQuery query, ConfService confService, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout, Object state, Boolean isBriefInfo)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.BeginRetrieveMultipleObjects(ICfgQuery query, AsyncCallback finishCallback, AsyncCallback dataCallback, Object state, Int64 timeout, Boolean isBriefInfo)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.RetrieveMultipleObjects[T](ICfgQuery query, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfService.RetrieveMultipleObjects[T](ICfgQuery query)
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgQuery.Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.ICfgQuery.Execute[T]()
       at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.Queries.CfgActionCodeQuery.Execute()
       at COMAPI3.Form1.test() in C:\Users\Administrator\AppData\Local\Temporary Projects\COMAPI3\Form1.cs:line 51
       at COMAPI3.Form1..ctor() in C:\Users\Administrator\AppData\Local\Temporary Projects\COMAPI3\Form1.cs:line 17
       at COMAPI3.Program.Main() in C:\Users\Administrator\AppData\Local\Temporary Projects\COMAPI3\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: Genesyslab.Platform.Commons.Protocols.ChannelClosedOnSendException
       Message="Connection is not opened"
       Source="Genesyslab.Platform.Commons.Protocols"
       StackTrace:
            at Genesyslab.Platform.Commons.Protocols.AbstractChannel.ThrowNotOpenedOnSend()
            at Genesyslab.Platform.Commons.Protocols.DuplexChannel.Send(IMessage message)
            at Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.GlobalConfService.BeginLoadObject(IProtocol protocol, ICfgQuery query, ConfService confService, AsyncCallback finishCallback, AsyncCallback dataCallback, Int64 timeout, Object state, Boolean isBriefInfo)
         Environment: Win32NT [64-bit] 6.1.7601 Service Pack 1 | CLR: 2.0.50727.8800 | iso-8859-1 (1252) | CPU: [x1]
         DEMOSRV [DEMOSRV\Administrator]: "C:\Users\Administrator\AppData\Local\Temporary Projects\COMAPI3\bin\Debug\COMAPI3.vshost.exe"
       InnerException:
เด็กเอ๋ยเด็กดีนั้นมีหน้าที่สิบอย่างด้วยกัน

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #14 on: March 21, 2019, 10:26:19 PM »


Sorry, but I think it must be something wrong with my demo image. Do you have any link to download the new one?
เด็กเอ๋ยเด็กดีนั้นมีหน้าที่สิบอย่างด้วยกัน