我的任务是在来自 Web 服务的外部事件时在 Genesys IWS 中显示“新出站邮件”对话框。我将 IWS 扩展安装到位,它会加载并提供 Web 服务接口。
我现在的主要问题是我不明白如何从我的代码中打开交互窗口。我尝试使用以下方法获取它的实例:
IInteractionsWindow interactionsView = Container.Resolve<IInteractionsWindow>();
interactionsView.Create();
interactionsView.ShowView();
这实际上只工作了一半,因为我得到了一个新窗口,但它完全是空的。我需要自己加载每个区域吗?有没有更简单的方法以完全集成的方式实现我的目标?
更新:我现在尝试使用 Platform SDK 来实现一些事情,尽管我不知道这是否真的有助于我向代理显示“新邮件”窗口。我尝试使用以下代码:
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 = "dummy@gmx.net",
ToAddresses = "dummy@gmx.net",
};
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();
不好的是来自交互服务器的响应是:
attr_ref_id [int] = 2
attr_error_code [int] = 34
attr_error_desc [str] = "Client is not logged in"
我认为这可能与以某种方式未正确登录有关,但我不知道如何实现这一点。有什么帮助吗?
更新 2我可以使用 Platform SDK 发送电子邮件,但这不是我真正想要的。最初的问题仍然有效,因为我只想调用交互窗口,仅此而已。其他的由用户决定。可能吗?