IWS Custumisation

Hello,
I’m new in the Genesys World, i’m trying to make a simple customisation to the IWS when an interaction is received.
I want to open an webpage just at the moment when the interaction arrive to the agent but i d’ont know how to do it.
I already tried a lot of sample codes but nothing works.
Any one can help me please?
This is the code that i used
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Genesyslab.Desktop.Infrastructure;
using System.Windows;
using Genesyslab.Desktop.Infrastructure.Commands;
using Genesyslab.Desktop.Modules.Core.Model.Interactions;
using Genesyslab.Platform.Voice.Protocols.TServer.Events;
using Genesyslab.Platform.OpenMedia.Protocols.InteractionServer.Events;
using Genesyslab.Desktop.Infrastructure.ViewManager;
using Genesyslab.Desktop.Infrastructure.DependencyInjection;

using System.Diagnostics;

namespace Com.Learning.IW
{
public class CustomModule : IModule
{
ICommandManager commandManager;
IInteractionManager interactionManager;
IObjectContainer objectContainer;
IViewManager viewManager;
// IViewEventManager viewEventManager;

    public CustomModule(ICommandManager commandManager, 
        IInteractionManager interactionManager,
        IObjectContainer objectContainer,
        IViewManager viewManager)
    {
    
        this.commandManager = commandManager;

      
        this.interactionManager = interactionManager;

    
        this.objectContainer = objectContainer;

        this.viewManager = viewManager;
    }
 
   

    public void Initialize()
    {

        interactionManager.InteractionEvent += new EventHandler<EventArgs<IInteraction>>(interactionManager_InteractionEvent);


        interactionManager.InteractionCreated += new EventHandler<EventArgs<IInteraction>>(interactionManager_InteractionCreated);
    }

    void interactionManager_InteractionCreated(object sender, EventArgs<IInteraction> e)
    {
        MessageBox.Show("Interaction Created: " + e.Value.InteractionId);

        
    }

    void interactionManager_InteractionEvent(object sender, EventArgs<IInteraction> e)
    {
  
        IInteraction interaction = e.Value;
     
        switch (interaction.EntrepriseLastInteractionEvent.Name)
        {
    
            case EventInvite.MessageName:
                Process.Start("https://www.google.com");
                break;
            case EventDialing.MessageName:
                Process.Start("www.google.com");
                break;
           
            
        }
    }

    #endregion
}

}

Use commands which are there for these purposes. You can learn more within public documentation for IWS/WDE developers. In additional, there are a few samples of basic integration or developing own module.

Can you name one command name Kubig? So at least he has a string where to pull from

1 Like

For voice interactions - InteractionVoiceAnswerCall.

DO you have a sample that i can use it as a start ??

As I wrote, samples are public on docs.genesyslab.com. There you can find many hints for developing the WDE plug-ins and modules. If you will have some additional question, feel free to ask here or create new topic

1 Like

Thnaks :).
I just need to know if the code posted before in this conversation is correct or not so try another example to find the solution ?

1 Like

If it doesn’t work for you then needs some correction. As Kubig says, check samples. Read docs.

2 Likes

Hi,

You’ve got the right idea, it is just the timing of when you add your interactionManager_InteractionEvent event handler

You need a ViewEventManger, then in the class constructor add this

viewEventManager.Subscribe(iWSStartupEventHandler);

Then the handler should look like this:

void iWSStartupEventHandler(object eventObject)
        {
            try
            {
                string eventMessage = eventObject as string;
                if (eventMessage != null)
                {
                    switch (eventMessage)
                    {
                        case "Loggin":
                            log.Info(log_prefix + "Registering EventHandler");
                            interactionManager.InteractionEvent += new EventHandler<EventArgs<Genesyslab.Desktop.Modules.Core.Model.Interactions.IInteraction>>(interactionManager_InteractionEvent);
                            log.Info(log_prefix + "Registered EventHandler");
                            break;
                        case "Logout":
                            log.Info(log_prefix + "UnRegistering EventHandler");
                            interactionManager.InteractionEvent -= new EventHandler<EventArgs<Genesyslab.Desktop.Modules.Core.Model.Interactions.IInteraction>>(interactionManager_InteractionEvent);
                            log.Info(log_prefix + "UnRegistered EventHandler");
                            break;
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error(log_prefix + " Error with Logon Listener" + ex.Message, ex);
            }
        }