Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: Daere on October 02, 2015, 10:18:39 AM

Title: How to create a custom module for Voice and Chat (WDE)
Post by: Daere on October 02, 2015, 10:18:39 AM
Hi,
it's my first post and I hope that anyone can help me :)
I've tryed to customize the Chat and Voice events with the PSDK .NET and developed two different modules to handle this events.
It's possible to create an unique module for two different chains of commands?
Another problem is that when arrive the chat events and I accept the interaction through the WDE, this interaction will caught only from Voice module. Where I go wrong?

Thank You
Laura
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Kubig on October 02, 2015, 10:45:12 AM
It does not make sense, to develop to independent modules, where each of them will use same set of commands. You can divide it to the two modules, where each module will serve own set of commands.
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Daere on October 02, 2015, 11:08:01 AM
[quote author=Kubig link=topic=9134.msg41042#msg41042 date=1443782712]
It does not make sense, to develop to independent modules, where each of them will use same set of commands. You can divide it to the two modules, where each module will serve own set of commands.
[/quote]
The two modules are divided and use different chain of command, but it doesn't work anyway.
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Kubig on October 02, 2015, 11:19:04 AM
There must be any mistake in your code. What is the issue? What say logs or debug infos?
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: cavagnaro on October 02, 2015, 11:47:27 AM
Can you post you cfg file showing how you are calling the modules?
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Daere on October 02, 2015, 12:30:10 PM
This is the .module-config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
  <section name="modules" type="Microsoft.Practices.Composite.Modularity.ModulesConfigurationSection, Microsoft.Practices.Composite" />
  <section name="tasks" type="Genesyslab.Desktop.Infrastructure.Config.TasksSection, Genesyslab.Desktop.Infrastructure" />
</configSections>

<tasks>
    <task name="InteractionWorkspace.Voice.canUse" clickOnceGroupsToDownload="Voice" modulesToLoad="ExtensionModule" />
  </tasks>

<modules>
  <!-- Uncomment the following to load the module if the corresponding task is granted -->
  <module assemblyFile="Genesyslab.Desktop.Modules.Extension.dll"
    moduleType="Genesyslab.Desktop.Modules.Extension.ExtensionModule"
    moduleName="ExtensionModule"
    startupLoaded="false"/>
</modules>
</configuration>

Thank you
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Kubig on October 02, 2015, 12:41:54 PM
Ok, but this is just loading of one mentioned modules. Where is the second?
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Daere on October 02, 2015, 12:53:48 PM
[quote author=Kubig link=topic=9134.msg41049#msg41049 date=1443789714]
Ok, but this is just loading of one mentioned modules. Where is the second?
[/quote]
The problem is that with only this Voice module we intercept both InteractionVoiceAnswerCall and InteractionChatAcceptChat (the name of the chain of command).
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Kubig on October 02, 2015, 12:55:24 PM
I do not understand, why do you use both commands within one module, if this module is developed just as the voice? This does not make a sense. If your module is just for voice, use just commands related to the voice channel, in other module for chat use the chat's commands.
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Daere on October 02, 2015, 01:16:16 PM
Ok, I'll try to explain in a best way (sorry for my english) :D

With this module-config, that's used only for voice, during the event of accept chat, the behaviour is the same of the answer call. The chat module isn't deployed for this issue.
The code:

In the module.cs:
...
public void Initialize()
{
  ....
  commandManager.InsertCommandToChainOfCommandBefore("InteractionVoiceAnswerCall","AnswerCall",new List<CommandActivator>() { new CommandActivator() { CommandType = typeof(InteractionVoiceAnswerCallCommand), Name = "AnswerCall" } });

....
}

In the CustomCommand.cs:
...
public bool Execute(IDictionary<string, object> parameters, IProgressUpdater progress)
        {
            // To go to the main thread
            if (Application.Current.Dispatcher != null && !Application.Current.Dispatcher.CheckAccess())
            {
                object result = Application.Current.Dispatcher.Invoke(DispatcherPriority.Send, new ExecuteDelegate(Execute), parameters, progress);
                return (bool)result;
            }
            else
            {
                // Ok, we are in the main thread
                log.Info("Execute");
                try
                {
                   
                    IInteractionVoice interactionVoice = parameters["CommandParameter"] as IInteractionVoice;

                  MessageBox.Show("In the VoiceAnswer Command");
                 
    ...
    //Take URLWS from attached data
    ....
   
                    Process.Start("iexplore.exe", URLWS);

                }
                catch (Exception ex)
                {
                    mess = ex.Message;
                    MessageBox.Show("errore" + mess);
                }
                finally
                {
                 
                }
                return false;
            }
        }

The message box ("In the VoiceAnswer Command") is show for both voice and chat
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Kubig on October 02, 2015, 01:19:31 PM
As I wrote on Genesys community site, try to :
[list]
[li]check in RN for IWS/WDE[/li]
[li]find out what commands exactly are fired during the incoming chat (within debug IWS logs)[/li]
[li]check if there are no other commands, which can be related to mentioned action[/li]
[/list]
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: Daere on October 03, 2015, 10:52:45 AM
Thanks to all, I 've resolved! My mistake was that I've declared  a view that started every time both for voice and chat.
Title: Re: How to create a custom module for Voice and Chat (WDE)
Post by: cavagnaro on October 03, 2015, 03:46:02 PM
8) Good job