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?
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.
The problem is that with only this Voice module we intercept both InteractionVoiceAnswerCall and InteractionChatAcceptChat (the name of the chain of command).
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.
Ok, I’ll try to explain in a best way (sorry for my english)
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() { 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