" /> how to use existing protocol created in iWS - Genesys CTI User Forum

Author Topic: how to use existing protocol created in iWS  (Read 3352 times)

Offline Ram

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
how to use existing protocol created in iWS
« on: April 19, 2012, 06:57:50 PM »
Advertisement
Hi,

I would like to know how to use existing protocol created in iWS to send request.  For ex.  i want to get OpenMedia protocol and using that i need to make agent ready/Not REady.  I tried the below code snippet but its not working.


IAgent myAgent = container.Resolve<IAgent>();
               
                Genesyslab.Desktop.Modules.Core.SDK.Protocol.IChannelManager channelManager = container.Resolve<
                    Genesyslab.Desktop.Modules.Core.SDK.Protocol.IChannelManager>();

                interactionChannel = channelManager.Register("Interaction_Server", myAgent.UserName);

                if (interactionChannel != null)
                {
                    interactionMedia = interactionChannel.EnterpriseProtocols["openmedia"];

                    interactionMedia.GetProtocolRequest("Ready").With(new object[]
                    { Convert.ToInt32(setting._proxyID), setting.CBMediaType, }).To(interactionChannel);
                }
                else
                {
                    new ExceptionAnalyzer(ContainerAccessPoint.Container).PublishError(AlertSection.Public,
                    "interactionChannel is null ", null, null);

RequestCancelNotReadyForMedia requestCanceNotReady = RequestCancelNotReadyForMedia.Create();
                requestCanceNotReady.MediaTypeName = setting.CBMediaType;
                requestCanceNotReady.ProxyClientId = Convert.ToInt32(setting._proxyID);
                IMessage message = interactionChannel.Protocol.Request(requestCanceNotReady);
                }

Can any one help me to resolve this issue. 

Offline smeatonj

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: how to use existing protocol created in iWS
« Reply #1 on: April 26, 2012, 12:51:10 AM »
Interaction Workspace, and more specifically, the ESDK, tries to abstract away the Requests/Responses into simple method calls, and reacting to certain events that come back via another channel. If all you want to do is change the state of the agent, the below code will show you how to access all medias that the agent is currently logged in to. You can explore the other methods and properties on the IMedia type to get the specific media you're interested in.

[code]IAgent myAgent = container.Resolve<IAgent>();
foreach (var media in myAgent.MyState.Place.ListOfMedia)
{
    media.NotReady("Some Reason");
}[/code]

Offline Robertgrint

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: how to use existing protocol created in iWS
« Reply #2 on: April 28, 2012, 05:15:28 AM »
I have also encountered with same issue and i resolve by using the following code instead of putting a null value, i have inserted the  value 1 that is why error was encountered, but thank you for sharing the code.