Author Topic: Control agent login to avoid emulated agents  (Read 5662 times)

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Control agent login to avoid emulated agents
« on: February 04, 2009, 06:32:41 AM »
Hi guys,
A question, how can I control using platform SDK the login of an agent who doesn't exists on the Framework? Because right now if I put as agent login anything it will allow me to login using emulated agents functionality, however if I disable this function from TServer will affect other areas of the customer and we don't want to lose it.
On ActiveX Desktop Toolkit I was able to use the DoLoginVB, however what is the similar function on this new SDK? I can't find nothing similar. What I expect is to build a similar login to what was used on GCN or any other Genesys  application.
Thanks

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Control agent login to avoid emulated agents
« Reply #1 on: February 04, 2009, 10:26:38 PM »
Hi guys,
On another thread i see a guy doing:

tServerProtocol = new ConfServerProtocol(
            new Endpoint(
            tServerName,
            tServerUri));

tServerProtocol.ClientType = ConfServerClientType.ThirdPartyApp;
tServerProtocol.ClientName = "MyService";
tServerProtocol.UserName = "default"; efault";
tServerProtocol.UserPassword = "password";

Will this help me control the login? As long as my application has my Tserver as a connection?
I'd appreciate some guidance.

Thanks

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: Control agent login to avoid emulated agents
« Reply #2 on: February 12, 2009, 01:14:16 PM »
Hi Cav,

Do you still need help with this?

If I understand you correctly you would like to write agent desktop application using Platform SDK. Am I right?

R.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Control agent login to avoid emulated agents
« Reply #3 on: February 12, 2009, 01:57:20 PM »
Yup René,
Genesys has told me to use Framework SDK but I'm still trying to sort this correctly. Do you have any similar implementation or any idea that I could use? Thanks a lot

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: Control agent login to avoid emulated agents
« Reply #4 on: February 12, 2009, 07:30:41 PM »
I've never heard about Framework SDK but assume this is just a garbled name of Platform SDK...

Below is sample code showing how to create connection to TServer, register DN and log in an agent. Please please take this code as dummy sample and not a production code. All requests are sent in synchronous mode and there is no event handler in the application at all. I would suggest you to look at application block "MessageBroker" released by Genesys that brings implementation of event handler.

[code]
            TServerProtocol tserver = new TServerProtocol(new Endpoint("", "...tserver host...", 3000));
            tserver.ClientName = "...tserver client name...";
            tserver.Open();

            RequestRegisterAddress req = RequestRegisterAddress.Create();
            req.AddressType = AddressType.DN;
            req.ControlMode = ControlMode.RegisterDefault;
            req.ThisDN = "999";

            IMessage evnt = tserver.Request(req);

            if (evnt.Id == EventRegistered.MessageId)
            {
                Console.WriteLine("DN has been registered");
            }
            else
            {
                Console.WriteLine("Unexpected result. Received message: " + evnt.Name);
            }

            RequestAgentLogin reqAgIn = RequestAgentLogin.Create();
            reqAgIn.AgentID = "111";
            reqAgIn.AgentWorkMode = AgentWorkMode.ManualIn;
            reqAgIn.ThisDN = "999";

            evnt = tserver.Request(reqAgIn);

            if (evnt.Id == EventAgentLogin.MessageId)
            {
                Console.WriteLine("Agent has been logged in");
            }
            else
            {
                Console.WriteLine("Unexpected result. Received message: " + evnt.Name);
            }
[/code]

Offline tpl

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Control agent login to avoid emulated agents
« Reply #5 on: March 27, 2009, 12:57:04 PM »
Late post, but I'm interested to know how you got this implemented.

Whenever I write code to connect to T-Server using the platform SDK, I mostly setup a connection to configration layer to check various info (logging, backup-modes, etc...).

So I would use my config layer connection to check if the agent actually exists.

But like I said, I would like to hear from you how you managed this...

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Control agent login to avoid emulated agents
« Reply #6 on: March 27, 2009, 03:27:56 PM »
Hehe, well I told them:

1. You code the validation (with Rene example) or do something (like your idea) and I will not help further (too much time lost) and you explain big heads the reason of delay
2. You live with that and we go on production as we are as all other productions are and we accomplish the dates approved

Guess which option he choose ;)

Offline rparmar

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: Control agent login to avoid emulated agents
« Reply #7 on: December 11, 2013, 12:46:13 AM »
I tried the code but i keep losing connection (state = Closed from open) when ever it does RequestRegisterAddress call; why?
Code:-
TServerProtocol tserver = new TServerProtocol(new Endpoint("TserverListener_PsdkClient", "10.10.10.10", 3000));
            tserver.ClientName = "TserverListener_PsdkClient";
            tserver.Open();

            while(tserver.State != ChannelState.Opened)
            {
                ;               
            }

            RequestRegisterAddress req = RequestRegisterAddress.Create();
            req.AddressType = AddressType.DN;
            req.ControlMode = ControlMode.RegisterDefault;
            req.ThisDN = "1234567890";

            IMessage evnt = tserver.Request(req);  //losing connection here - why?

            if (evnt.Id == EventRegistered.MessageId)
            {
                Console.WriteLine("DN has been registered");
            }
            else
            {
                Console.WriteLine("Unexpected result. Received message: " + evnt.Name);
            }