I got the task to show the "new outbound mail" dialog in Genesys IWS upon an external event from a webservice. I put my IWS extension in place and it loads and can provide a webservice interface.
My main problem now is that I don't understand how I can open the interactions window from my code. I tried to get an instance of it by using:
IInteractionsWindow interactionsView = Container.Resolve<IInteractionsWindow>();
interactionsView.Create();
interactionsView.ShowView();
This actually works only halfway, as I get a new window, but it's completely empty. Do I need to load every single region on its own? Is there a simpler way to achieve my goals in a fully integrated way?
UPDATE: I have now tried to achieve things using the Platform SDK although I have no idea if this really helps me in showing the "new mail" window to the agent. I tried with the following code:
interactionServerProtocol = new InteractionServerProtocol(new Endpoint(new Uri("tcp://ixnServer:7319")));
interactionServerProtocol.ClientName = "CRMIntegrationModule";
interactionServerProtocol.ClientType = InteractionClient.AgentApplication;
contactServerProtocol = new UniversalContactServerProtocol(new Endpoint(new Uri("tcp://ucsServer:5130")));
contactServerProtocol.ClientName = "CRMIntegrationModule";
interactionServerProtocol.Open();
contactServerProtocol.Open();
RequestSubmit request = RequestSubmit.Create();
request.InteractionType = "Outbound";
request.InteractionSubtype = "OutboundNew";
request.MediaType = "email";
request.Queue = "default";
EventAck response = interactionServerProtocol.Request(request) as EventAck;
if (response != null)
{
string id = Convert.ToString(response.Extension["InteractionId"]);
RequestInsertInteraction insertRequest = RequestInsertInteraction.Create();
insertRequest.InteractionAttributes = new InteractionAttributes
{
Id = id,
MediaTypeId = "email",
TypeId = "Outbound",
SubtypeId = "OutboundNew",
TenantId = 101,
Status = new NullableStatuses(Statuses.Pending),
Subject = "Testmail",
EntityTypeId = new NullableEntityTypes(EntityTypes.EmailOut)
};
insertRequest.EntityAttributes = new EmailOutEntityAttributes()
{
FromAddress = "[email protected]",
ToAddresses = "[email protected]",
};
insertRequest.InteractionContent = new InteractionContent()
{
Text = "This is the e-mail body."
};
contactServerProtocol.Send(insertRequest);
RequestPlaceInQueue queueRequest = RequestPlaceInQueue.Create();
queueRequest.InteractionId = id;
queueRequest.Queue = "default";
interactionServerProtocol.Send(queueRequest);
}
interactionServerProtocol.Close();
contactServerProtocol.Close();
The bad thing is the response from the interaction server which is:
attr_ref_id [int] = 2
attr_error_code [int] = 34
attr_error_desc [str] = "Client is not logged in"
I think this could be related to not being logged in correctly somehow but I have not a single clue how to achieve this. Any help?
UPDATE 2 I could send an e-mail using the Platform SDK, but this is not what I really want. The initial question is still valid, as I just want to invoke the interactions window and that's it. The other stuff is up to the user. Is it possible?
I made use of the given command chains: