Kubig
November 13, 2012, 3:32pm
1
Hi All,
did somebody solve following requirement:
I want to change agent’s state from IWS.So,I wrote custom code,but current DLL files from IWS (Genesys.Desktop) does not contain method,which allows to send “ReasonCodes” for Ready state.
Could you,please,point me to the solution - have to use other namespace(PSDK)?
Many thanks
RobertH
November 14, 2012, 4:27pm
2
Hi
Are you sure?
Did you try this?
Interaction Workspace 8.1.1 .NET Developer’s Guide and API Reference
NotReady Method
Namespaces ► Genesyslab.Desktop.Modules.Core.Model.Agents ► IAgent ► NotReady()
NotReady() Sets the agent’s state to Not Ready.
NotReady(String) Sets the current agent’s state to Not Ready with Action Code.
Regards
Robert
Kubig
November 15, 2012, 7:21am
3
But,as I wrote…I need set Ready state with ReasonCode. In BusinessAttributes I can create ReadyState with ReasonCode,but in IWS I cannot use it.
RobertH
November 15, 2012, 7:34am
4
Hi
Sorry my fault.
Then you need to use enterprise SDK.
using Genesyslab.Enterprise.Extensions;
IEnterpriseServiceProvider serviceProvider = agent_.EntrepriseService.Provider;
IDeviceService deviceService = serviceProvider.Resolve(“deviceService”);
IIdentityService identityService = serviceProvider.Resolve(“identityService”);
Genesyslab.Enterprise.Model.Device.IDevice deviceS = deviceService.GetDevice(deviceName, tenantName, channelName);
KeyValueCollection Reasons = new KeyValueCollection();
KeyValueCollection Extensions = new KeyValueCollection();
AgentServiceExtensions.Ready(identityService, agentESDK_, deviceS, null, WorkMode.Unknown, Reasons, Extensions);
I used it for NotReady lond time ago but can see it is available also for ready status.
Consult ESDK AgentServiceExtensions..::.Ready Method (IIdentityService, IAgent, IDevice, String, WorkMode, KeyValueCollection, KeyValueCollection)
Regards
Robert
Kubig
November 15, 2012, 12:15pm
5
Hi,
does not matter. Where do you get “agentESDK_”,which you used as argument in method AgentServiceExtensions.Ready()?
thx
RobertH
November 15, 2012, 8:32pm
6
Hi
Can be done this way:
using Genesyslab.Desktop.Modules.Core.Model.Agents;
private Genesyslab.Enterprise.Agent.IAgent agentESDK_;
// this is Workspace agent
IAgent agent_;
// this is enterprise agent
agentESDK_ = agent_.EnterpriseAgent;
Regards
Robert
1 Like
Kubig
November 16, 2012, 10:15am
7
Many thanks for your reply…What parameter values do you set in GetDevice method? Or where do you get this values(channelName,deviceName)?
thx
RobertH
November 16, 2012, 4:16pm
8
Hi
It is from Workspace agent object.
String deviceName = agent_.FirstMediaVoice.Device.Name;
String channelName = agent_.FirstMediaVoice.Channel.Name;
Regards
Robert
Kubig
November 19, 2012, 8:30am
9
Great,Robert. Many thanks…all works fine.
I have last question,if I use ESDK for set Ready state with ReasonCode,change of state take a “long” time(5sec),via IWS dll is more quickly..is any way how to improve it?
1 Like
RobertH
November 19, 2012, 5:53pm
10
Hi
You’re welcome.
Have no idea. Request should be sent instantly, if you don’t delay in code. How fast is response from tserver can be verified from tserver logs.
Regards
Robert
Kubig
November 26, 2012, 12:09pm
11
Hi,
it’s not a problem on Genesys site. That seems like the code take a long time. In T-Server logs I see that if the request received,the event is created immediately and have sended to the client. The create of request take a long time
2 Likes
RobertH
November 29, 2012, 3:12pm
12
Hi
You are right from extensions it takes some time.
I did create new project just to verify this and result can look like this:
public void Create()
{
agentESDK_ = agent_.EnterpriseAgent;
IEnterpriseServiceProvider serviceProvider = agent_.EntrepriseService.Provider;
IDeviceService deviceService = serviceProvider.Resolve<IDeviceService>("deviceService");
identityService_ = serviceProvider.Resolve<IIdentityService>("identityService");
String deviceName = agent_.FirstMediaVoice.Device.Name;
String channelName = agent_.FirstMediaVoice.Channel.Name;
string device = agent_.FirstMediaVoice.Device.ToString();
string[] tenant = device.Split(' ');
string[] arrTenantName = tenant[1].Split('=');
string tenantName = arrTenantName[1];
tenantName = tenantName.Replace(";", "");
deviceS_ = deviceService.GetDevice(deviceName, tenantName, channelName);
log_.Info("OK");
}
private void button1_Click(object sender, RoutedEventArgs e)
{
log_.Info("Click");
KeyValueCollection Reasons = new KeyValueCollection();
KeyValueCollection Extensions = new KeyValueCollection();
Reasons.Add("BCW", "0");
identityService_.Ready(agentESDK_, deviceS_, "", WorkMode.Unknown, Reasons, Extensions, 1000);
log_.Info("OK");
}
Reaction is about 1 second … it is timeout set in request I sent.
Workspace log:
12-11-29 16:05:53.597 [ 1] INFO ace.Test.TWRegionBtn - Click
12-11-29 16:05:53.607 [ 14] WARN ESDK - [GetVirtualDevice] Virtual Device is identical as input device 5001
12-11-29 16:05:53.608 [ 14] WARN ESDK - [GetVirtualMessage] No Switch Policy profile found for [Request] RequestAgentReady
12-11-29 16:05:53.630 [defaultInvoker] INFO ESDK - Voice strategy 'VoiceProtocolEventStrategy' [Dn] 5001 Processing msg [Name] EventAgentReady [EndPoint] sip_server - tcp://120-gen8:6000
12-11-29 16:05:53.710 [ 14] INFO edia.AgentMultimedia - DeviceEvent State:'Registered' Message:'' AgentMultimedia 'a5001' Place 'p5001'
12-11-29 16:05:53.741 [ 16] INFO Media.MediaOpenMedia - [AgentEvent Begin] event:EventCurrentAgentStatus ReferenceId:-1 State:LoggedIn SourceDevice:p5001[workitem(workitem)]
12-11-29 16:05:53.764 [ 16] INFO Media.MediaOpenMedia - [AgentEvent End] ReferenceId:-1 [workitem(workitem)]
12-11-29 16:05:53.838 [ 4] INFO edia.AgentMultimedia - [AgentEvent Begin] event:EventCurrentAgentStatus ReferenceId:-1 State:LoggedIn AgentMultimedia 'a5001' Place 'p5001'
12-11-29 16:05:53.860 [ 4] INFO edia.AgentMultimedia - [AgentEvent End] ReferenceId:-1 AgentMultimedia 'a5001' Place 'p5001'
12-11-29 16:05:53.991 [ 14] INFO edia.AgentMultimedia - DeviceEvent State:'Registered' Message:'' AgentMultimedia 'a5001' Place 'p5001'
12-11-29 16:05:54.018 [ 4] INFO edia.AgentMultimedia - [AgentEvent Begin] event:EventCurrentAgentStatus ReferenceId:-1 State:LoggedIn AgentMultimedia 'a5001' Place 'p5001'
12-11-29 16:05:54.021 [ 16] INFO Media.MediaOpenMedia - [AgentEvent Begin] event:EventCurrentAgentStatus ReferenceId:-1 State:LoggedIn SourceDevice:p5001[workitem(workitem)]
12-11-29 16:05:54.022 [ 16] INFO Media.MediaOpenMedia - [AgentEvent End] ReferenceId:-1 [workitem(workitem)]
12-11-29 16:05:54.025 [ 4] INFO edia.AgentMultimedia - [AgentEvent End] ReferenceId:-1 AgentMultimedia 'a5001' Place 'p5001'
12-11-29 16:05:54.030 [ 16] INFO ESDK - [Agent] 5001 (FQN=098b4b3e-bb79-4e20-a94a-75a5a764e3ea) Found Virtual Device '5001' (FQN=c35533b7-92c9-44a9-ba1b-81bdb3a0c4bf)
12-11-29 16:05:54.031 [ 16] INFO ice.Voice.MediaVoice - [AgentEvent Begin] EventAgentReady AgentID 5001 State:Ready [voice, AgentId:5001, SIP(5001)]
12-11-29 16:05:54.358 [ 16] INFO ndpointCommunication - 5001 is a SIP DN. Look for an already started SIP Endpoint for this DN and Sip Server 192.168.1.120:5060.
12-11-29 16:05:54.359 [ 16] INFO ndpointCommunication - There is already an IW SIP Endpoint for this 5001 SIP DN.
12-11-29 16:05:54.625 [ 1] WARN ESDK - Proxy [EndInvoke] Timeout on internal [ReqId] 6 Submitted [ReqId] -1 after (1006,0575 ms)
12-11-29 16:05:54.628 [ 1] INFO ace.Test.TWRegionBtn - OK
Hope this will help.
Robert
1 Like
Kubig
November 30, 2012, 9:16am
13
Great job,Robert! Thank you very much.
May I have last question?.. I would like to change status of whole place(ie. voice,email,chat,.., channels) - it is possible to change whole “place” status or what code do you preffer?
RobertH
November 30, 2012, 8:29pm
14
Hi
You’re welcome.
it is up to you what you want to achieve :-).
Regards
Robert
Kubig
December 1, 2012, 11:27pm
15
Yes, I would like to set same reason code at email channel - but similiar code for email does not work,logically. Did you any hint for me,Robert? Not Ready state on both channel type via “IWS” SDK is OK.
RobertH
December 3, 2012, 10:53pm
16
Hi
Same way it will never work.
You want to request interaction server not tserver.
Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.ReasonInfo reasons = Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.ReasonInfo.Create("BCW", "0");
Genesyslab.Enterprise.Model.Channel.IClientChannel chnl = agent_.FirstMediaEmail.Channel;
log_.Info("channel protocol id: " + isrv.ServerContext.ProxyId);
RequestCancelNotReadyForMedia request = RequestCancelNotReadyForMedia.Create(isrv.ServerContext.ProxyId+1, null, "email", reasons);
chnl.Protocol.Request(request);
I did short test with request using platform sdk.
But there is media type and proxy client id hardcoded.
Maybe it will give you some hint.
Regards
Robert
Kubig
December 4, 2012, 7:09am
17
Thx for your reply and hints. May be, I am on low-level SDK and I think,that I would use IWS commands. Commands for voice and openmedia contents request Ready with KeyValueCollection in parameter. So,I have created new topic.
I think,that I should use IdentityServiceExtensions and method ReadyMultimedia - but I cannot configure correctly all required parameters yet I still get exception " No place for agent"
Thanks again for all,Robert.