Author Topic: IWS Custumisation  (Read 5363 times)

Offline genesysBeginner

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
IWS Custumisation
« on: April 22, 2015, 02:28:37 PM »
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
    }
}

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: IWS Custumisation
« Reply #1 on: April 23, 2015, 08:41:51 AM »
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.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: IWS Custumisation
« Reply #2 on: April 23, 2015, 01:37:16 PM »
Can you name one command name Kubig? So at least he has a string where to pull from

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: IWS Custumisation
« Reply #3 on: April 23, 2015, 01:46:26 PM »
For voice interactions - InteractionVoiceAnswerCall.

Offline genesysBeginner

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: IWS Custumisation
« Reply #4 on: April 23, 2015, 02:10:31 PM »
DO  you have a sample that i can use it as a start ??

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: IWS Custumisation
« Reply #5 on: April 23, 2015, 02:14:30 PM »
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

Offline genesysBeginner

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: IWS Custumisation
« Reply #6 on: April 23, 2015, 02:21:12 PM »
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 ?

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: IWS Custumisation
« Reply #7 on: April 23, 2015, 03:18:43 PM »
If it doesn't work for you then needs some correction. As Kubig says, check samples. Read docs.

Offline PeteHoyle

  • Full Member
  • ***
  • Posts: 126
  • Karma: 13
Re: IWS Custumisation
« Reply #8 on: May 01, 2015, 11:06:39 AM »
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

[code]viewEventManager.Subscribe(iWSStartupEventHandler);[/code]

Then the handler should look like this:

[code]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);
            }
        }[/code]