在Genesys Interaction Workspace中打开新的邮件交互窗口

时间:2014-12-02 15:54:30

标签: c# genesys workspace-desktop-edition

我的任务是显示"新的出站邮件" Genesys IWS中的对话来自Web服务的外部事件。我将IWS扩展放在适当的位置并加载并提供web服务接口。

我现在的主要问题是我不明白如何从代码中打开交互窗口。我尝试使用以下方法获取它的实例:

IInteractionsWindow interactionsView = Container.Resolve<IInteractionsWindow>();
interactionsView.Create();
interactionsView.ShowView();

这实际上只有一半,因为我有一个新窗口,但它完全是空的。我是否需要自己加载每个区域?是否有更简单的方法以完全整合的方式实现我的目标?

更新:我现在尝试使用Platform SDK实现目标,但我不知道这是否真的有助于我展示&#34;新邮件&#34;窗口到代理商。我尝试使用以下代码:

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发送电子邮件,但这不是我真正想要的。最初的问题仍然有效,因为我只想调用交互窗口,而这就是它。其他的东西取决于用户。有可能吗?

2 个答案:

答案 0 :(得分:0)

您需要使用PlatformSDK。添加Genesyslab.platform.webmedia.protocols.dll 之后你可以使用* webmedia.tserver.request,在那个标签下有requestWeb或者某事。

channelService.RegisterEvents(tServerChannel, new Action<Genesyslab.Enterprise.Model.Channel.IClientChannel>

在你的主模块中(有Initialize方法),需要像这样注册。您可以放一个按钮或某个按钮,然后您可以触发事件,或者您可以在登录后使用命令链,由您自己决定。

祝你好运。

答案 1 :(得分:0)

我使用了给定的命令链:

    public IObjectContainer Container { get; set; }

    public void NewItem(string contactId, string emailAddress)
    {
        IAgent agent = Container.Resolve<IAgent>();
        IRoutingBasedManager routingManager = Container.Resolve<IRoutingBasedManager>();

        IDictionary<string, object> parameters = new Dictionary<string, object>();
        parameters.Add("CommandParameter", agent.FirstMediaEmail);
        parameters.Add("TargetId", contactId);
        parameters.Add("OwnerId", agent.ConfPerson.EmailAddress);
        parameters.Add("Destination", emailAddress);
        parameters.Add("RecentIndex", contactId);
        bool todo = routingManager.RequestToDo("CreateNewOutboundEmail", RoutingBasedTarget.Contact, parameters);
        if (todo && parameters.ContainsKey("RoutingBaseCommand"))
        {
            IChainOfCommand chainOfCommand = parameters["RoutingBaseCommand"] as IChainOfCommand;
            if (chainOfCommand != null)
            {
                chainOfCommand.Execute(parameters["RoutingBaseCommandParameters"]);
            }
        }
    }