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

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 3
  • 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: 6836
  • Karma: 56331
Re: How can I get configured status messages of an agent?
« Reply #1 on: Yesterday at 12:08:45 AM »
What do you exactly mean? Status of what?
What messages?

Offline jkaewprateep

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #2 on: Yesterday at 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: 6836
  • Karma: 56331
Re: How can I get configured status messages of an agent?
« Reply #3 on: Yesterday at 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: 6836
  • Karma: 56331
Re: How can I get configured status messages of an agent?
« Reply #4 on: Yesterday at 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: 3
  • Karma: 0
Re: How can I get configured status messages of an agent?
« Reply #5 on: Yesterday at 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: 2530
  • Karma: 41
Re: How can I get configured status messages of an agent?
« Reply #6 on: Yesterday at 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)