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

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
How can I get configured status messages of an agent?
« on: March 16, 2019, 06:33:23 PM »
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("[color=red][b]XXX[/b][/color]");
============================================================================

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: 7639
  • Karma: 56330
Re: How can I get configured status messages of an agent?
« Reply #1 on: March 17, 2019, 03:08:45 PM »
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 17, 2019, 03:44:22 PM »
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: 7639
  • Karma: 56330
Re: How can I get configured status messages of an agent?
« Reply #3 on: March 17, 2019, 04:39:29 PM »

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: 7639
  • Karma: 56330
Re: How can I get configured status messages of an agent?
« Reply #4 on: March 17, 2019, 04:40:57 PM »
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, 08:12:08 AM »
After changed the 'clientname', it returns another error like in below:

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

Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.ConfigException was unhandled
  Message=[b]"Exception on sending request"[/b]
  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: 2752
  • Karma: 44
Re: How can I get configured status messages of an agent?
« Reply #6 on: March 18, 2019, 09:16:14 AM »
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.

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #7 on: March 19, 2019, 08:09:06 AM »
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: [b]Application name is prohibited to login[/b]"
  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: 2752
  • Karma: 44
Re: How can I get configured status messages of an agent?
« Reply #8 on: March 19, 2019, 09:31:43 AM »
What is the application type you are using for?

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #9 on: March 20, 2019, 04:02:43 AM »
Genesyslab.Platform.Configuration.Protocols.Types.CfgAppType.[b]CFGConfigServer[/b].ToString())

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: How can I get configured status messages of an agent?
« Reply #10 on: March 20, 2019, 09:50:20 AM »
You cannot use Configuration Server as the type of the client app, it does not make sense. Use Third Party or Generic Server

Offline jkaewprateep

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

"\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: 2752
  • Karma: 44
Re: How can I get configured status messages of an agent?
« Reply #12 on: March 20, 2019, 11:34:40 AM »
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

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #13 on: March 21, 2019, 01: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, 01:26:19 PM »
[img width=326 height=480]https://www.img.in.th/images/0fa198ec67ffa0f8f5c8e5a763f7d805.png[/img]

Sorry, but I think it must be something wrong with my demo image. Do you have any link to download the new one?