private void TriggerVoiceChainOfCommands(IInteractionVoice ixnVoice, String commandName)
        {
            try
            {
                IDictionary <string, object> parameters = new Dictionary <string, object>();

                parameters.Add("CommandParameter", ixnVoice);
                // parameters.Add("OtherKey", "OtherValue");

                IChainOfCommand voiceCallCommand = commandManager.GetChainOfCommandByName(commandName);

                if (voiceCallCommand != null)
                {
                    voiceCallCommand.Execute(parameters);

                    // Async way

                    /*
                     * voiceCallCommand.BeginExecute(parameters,
                     *      delegate(IAsyncResult ar)
                     *      {
                     *          voiceCallCommand.EndExecute(ar);
                     *      }, null);
                     */
                }
            }
            catch (Exception exp)
            {
                log.Error("Exception in TriggerVoiceChainOfCommands", exp);
            }
        }
        public void RequestMakeCall(String destination, String location)
        {
            // To go to the main thread
            if (Application.Current.Dispatcher != null && !Application.Current.Dispatcher.CheckAccess())
            {
                object result = Application.Current.Dispatcher.Invoke(DispatcherPriority.Send,
                                                                      new RequestMakeCallDelegate(RequestMakeCall), destination, location);
            }
            else
            {
                log.Info("Execute RequestMakeCall");
                try
                {
                    IDictionary <string, object> parameters = new Dictionary <string, object>();

                    parameters.Add("CommandParameter", agent.FirstMediaVoice);
                    parameters.Add("Destination", destination);
                    if (location == null)
                    {
                        location = "";
                    }
                    parameters.Add("Location", location);
                    parameters.Add("MakeCallType", Genesyslab.Enterprise.Model.Interaction.MakeCallType.Regular);

                    IChainOfCommand voiceCallCommand = commandManager.GetChainOfCommandByName("MediaVoiceMakeCall");

                    if (voiceCallCommand != null)
                    {
                        voiceCallCommand.Execute(parameters);

                        // Async way

                        /*
                         * voiceCallCommand.BeginExecute(parameters,
                         *      delegate(IAsyncResult ar)
                         *      {
                         *          voiceCallCommand.EndExecute(ar);
                         *      }, null);
                         */
                    }
                }
                catch (Exception exp)
                {
                    log.Error("Exception in RequestMakeCall", exp);
                }
            }
        }