Exemplo n.º 1
0
 public void Stop()
 {
     if (CheckException.CheckNull(this.DirectAudio))
     {
         this.DirectAudio.Stop();
     }
 }
Exemplo n.º 2
0
        public void InitiateTransfer(string number, KeyValueCollection reasonCode)
        {
            //Input Validation
            CheckException.CheckDialValues(number);

            logger.Info("InitiateTransfer(" + number + ")");

            if ((Settings.GetInstance().CallControl == "both" ? Settings.GetInstance().ActiveDN : (Settings.GetInstance().CallControl == "acd" ?
                                                                                                   Settings.GetInstance().ACDPosition : Settings.GetInstance().ExtensionDN)) != number)
            {
                HoldingFlagStatus(PhoneFunctions.InitiateTransfer);
                logger.Debug("Set HoldingFlagStatus(PhoneFunctions.InitiateTransfer)");
            }

            RequestAgentTransfer.InitiateTransfer(number, reasonCode);

            ////TERR_INV_CALD_DN
            //OutputValues errorOutput = new OutputValues();
            //errorOutput.MessageCode = "71";
            //errorOutput.Message = "TERR_INV_CALD_DN" + " : " + "Invalid Called DN.";
            //if (Settings.GetInstance().IsEnableInitiateTransfer)
            //    Settings.GetInstance().IsEnableInitiateTransfer = false;
            //if (Settings.GetInstance().IsEnableInitiateConference)
            //    Settings.GetInstance().IsEnableInitiateConference = false;
            //VoiceManager.messageToClient.NotifyErrorMessage(errorOutput);
        }
 /// <summary>
 /// Occurs when videos lider value changes
 /// </summary>
 /// <param name="sender">Method for</param>
 /// <param name="e">delegate </param>
 private void VideoSlider_Click(object sender, EventArgs e)
 {
     if (CheckException.CheckNull(this.MainScreenInstance.video))
     {
         HolderForm.HandleBarMovemenetVideo(this.videoSlider, this.MainScreenInstance.video.DirectVideo);
     }
 }
Exemplo n.º 4
0
 public void Pause()
 {
     if (CheckException.CheckNull(this.DirectAudio))
     {
         this.DirectAudio.Pause();
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Handles slider movement
 /// </summary>
 /// <param name="slider">A custom slider object</param>
 /// <param name="video">A DirectX video</param>
 public static void HandleBarMovemenetVideo(
     CustomControls.CustomSlider slider, DirectXAllias::Video video)
 {
     if (CheckException.CheckNull(video))
     {
         video.CurrentPosition = slider.Value;
     }
 }
Exemplo n.º 6
0
 public static void HandleBarMovementAudio(
     CustomControls.CustomSlider slider, DirectXAllias::Audio audio)
 {
     if (CheckException.CheckNull(audio))
     {
         audio.CurrentPosition = slider.Value;
     }
 }
Exemplo n.º 7
0
 public void Close()
 {
     if (CheckException.CheckNull(this.DirectAudio))
     {
         this.DirectAudio.Dispose();
         this.DirectAudio = null;
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Moves back the current position of the video with x
 /// </summary>
 public void Rewind()
 {
     if (CheckException.CheckNull(this.DirectVideo))
     {
         if (this.DirectVideo.CurrentPosition + this.PlayBackSpeed > 0)
         {
             this.DirectVideo.CurrentPosition += this.PlayBackSpeed;
         }
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// Fast forwards the video
 /// </summary>
 /// <param name="button">Button to set styles to</param>
 public void FastForward(Button button, IPlayable playable)
 {
     this.SwitchButtonStyle(button);
     if (CheckException.CheckNull(playable))
     {
         this.MainScreenInstance.timerForRF.Start();
         playable.PlayBackSpeed += 5;
         this.MainScreenInstance.fastForwardFired = true;
     }
 }
Exemplo n.º 10
0
 public void FastForward()
 {
     if (CheckException.CheckNull(this.DirectAudio))
     {
         if (this.DirectAudio.CurrentPosition + this.PlayBackSpeed > 0)
         {
             this.DirectAudio.CurrentPosition += this.PlayBackSpeed;
         }
     }
 }
Exemplo n.º 11
0
        public void DistributeUserDataEvent(Dictionary <string, string> UserData, string connectionID = "")
        {
            KeyValueCollection getUserdata = GetUpdateUserData(UserData);

            //Input Validation
            CheckException.CheckUserDataValues((Settings.GetInstance().CallControl == "both" ? Settings.GetInstance().ActiveDN : (Settings.GetInstance().CallControl == "acd" ?
                                                                                                                                  Settings.GetInstance().ACDPosition : Settings.GetInstance().ExtensionDN)), (connectionID == string.Empty ? Settings.GetInstance().ConnectionID : connectionID), getUserdata);

            RequestUpdateAttachData.DistributeUserEvent((Settings.GetInstance().CallControl == "both" ? Settings.GetInstance().ActiveDN : (Settings.GetInstance().CallControl == "acd" ?
                                                                                                                                           Settings.GetInstance().ACDPosition : Settings.GetInstance().ExtensionDN)), (connectionID == string.Empty ? Settings.GetInstance().ConnectionID : connectionID), getUserdata);
        }
Exemplo n.º 12
0
 /// <summary>
 /// Decreases volume by a step
 /// and adjusts the progress bar
 /// </summary>
 /// <param name="video">A video object</param>
 /// <param name="slider">A custom slider object</param>
 public static void VolumeDown(DirectXAudioAllias audio, CustomSlider slider)
 {
     if (slider.Value > slider.Minimum)
     {
         slider.Value -= VolumeStep;
         if (CheckException.CheckNull(audio))
         {
             HandleAudio(audio, slider.Value);
         }
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// Increases volume with a step
 /// and adjusts the progress bar
 /// </summary>
 /// <param name="video">A video object</param>
 /// <param name="slider">A custom slider object</param>
 public static void VolumeUp(DirectXAudioAllias audio, CustomSlider slider)
 {
     if (slider.Value < MaxProgressBarValue)
     {
         slider.Value += VolumeStep;
         if (CheckException.CheckNull(audio))
         {
             HandleAudio(audio, slider.Value);
         }
     }
 }
Exemplo n.º 14
0
        public void InitiateConference(string number, KeyValueCollection userData)
        {
            //Input Validation
            CheckException.CheckDialValues(number);

            RequestAgentConference.InitiateConference(number, userData);
            if ((Settings.GetInstance().CallControl == "both" ? Settings.GetInstance().ActiveDN : (Settings.GetInstance().CallControl == "acd" ?
                                                                                                   Settings.GetInstance().ACDPosition : Settings.GetInstance().ExtensionDN)) != number)
            {
                HoldingFlagStatus(PhoneFunctions.IntiateConference);
            }
        }
Exemplo n.º 15
0
        public void InitiateConference(string otherDn, string location, KeyValueCollection userData, KeyValueCollection reasons, KeyValueCollection extensions)
        {
            //Input Validation
            CheckException.CheckDialValues(otherDn);

            RequestAgentConference.InitiateConference(otherDn, location, userData, reasons, extensions);
            if ((Settings.GetInstance().CallControl == "both" ? Settings.GetInstance().ActiveDN : (Settings.GetInstance().CallControl == "acd" ?
                                                                                                   Settings.GetInstance().ACDPosition : Settings.GetInstance().ExtensionDN)) != otherDn)
            {
                HoldingFlagStatus(PhoneFunctions.IntiateConference);
            }
        }
Exemplo n.º 16
0
 /// <summary>
 /// Opens a video
 /// </summary>
 public void Open(Button button)
 {
     this.SwitchButtonStyle(button);
     this.VideoName = ChooseVideoDialog.TakePathToVideo();
     if (CheckException.CheckNull(this.VideoName))
     {
         this.Open(this.VideoName);
     }
     else if (CheckException.CheckNull(this.MainScreenInstance.video))
     {
         this.VideoName = this.MainScreenInstance.video.PathToSource;
     }
 }
Exemplo n.º 17
0
        /// <summary>
        /// Kills the video and everything
        /// associated with it
        /// </summary>
        /// <param name="video">DirectX video</param>
        public static void NullVideoAndForm(DirectXAllias::Video video)
        {
            if (CheckException.CheckNull(FormForVideo))
            {
                FormForVideo.Dispose();
                FormForVideo = null;
            }

            if (CheckException.CheckNull(video))
            {
                video.Dispose();
                video = null;
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// Stops the video
        /// </summary>
        /// <param name="button">Button to set styles to</param>
        public void Stop(Button button, IPlayable playable)
        {
            this.SwitchButtonStyle(button);
            if (CheckException.CheckNull(playable))
            {
                this.MainScreenInstance.timerForRF.Stop();
                playable.Stop();
            }

            if (this.MainScreenInstance.timerForProgress.Enabled)
            {
                this.MainScreenInstance.timerForProgress.Stop();
                this.MainScreenInstance.WriteVideoTime();
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// Closes the video player
        /// </summary>
        /// <param name="button">Button to set styles to</param>
        public void ExitVideoPlayer(Button button)
        {
            this.SwitchButtonStyle(button);
            this.MainScreenInstance.Close();
            if (CheckException.CheckNull(this.MainScreenInstance.video))
            {
                this.MainScreenInstance.video.Close();
            }

            if (CheckException.CheckNull(this.MainScreenInstance.audio))
            {
                this.MainScreenInstance.audio.Close();
            }

            this.MainScreenInstance.Dispose();
        }
Exemplo n.º 20
0
 /// <summary>
 /// Occurs on video progress timer tick
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TimerForVideoProgress_Tick(object sender, EventArgs e)
 {
     if (CheckException.CheckNull(MainScreenInstance.video))
     {
         if (CheckException.CheckNull(MainScreenInstance.video.DirectVideo))
         {
             HolderForm.HandleVideoProgress(this.videoSlider, MainScreenInstance.video.DirectVideo);
         }
         else
         {
             timerForVideoProgress.Stop();
         }
     }
     else
     {
         timerForVideoProgress.Stop();
     }
 }
Exemplo n.º 21
0
 /// <summary>
 /// Goes to full screen
 /// </summary>
 /// <param name="button">Button to set styles to</param>
 public void FullScreenVideo(Button button)
 {
     this.SwitchButtonStyle(button);
     if (CheckException.CheckNull(this.MainScreenInstance.video))
     {
         this.MainScreenInstance.video.OpenVideoInFullScreen();
         this.MainScreenInstance.video.IsFullScreen = true;
     }
     if (CheckException.CheckNull(this.MainScreenInstance.video))
     {
         if (this.MainScreenInstance.video.IsFullScreen)
         {
             this.MainScreenInstance.menuBar = new MenuBarFullScreenForm();
             this.MainScreenInstance.menuBar.MainScreenInstance = MainScreen.Instance;
             this.MainScreenInstance.timerForMenuBar.Start();
         }
     }
 }
Exemplo n.º 22
0
        public void InitiateTransfer(string number, string location, KeyValueCollection userData)
        {
            //Input Validation
            CheckException.CheckDialValues(number);

            logger.Info("InitiateTransfer(" + number + ")");
            //Code Added - V.Palaniappan
            //28.10.2013
            if ((Settings.GetInstance().CallControl == "both" ? Settings.GetInstance().ActiveDN : (Settings.GetInstance().CallControl == "acd" ?
                                                                                                   Settings.GetInstance().ACDPosition : Settings.GetInstance().ExtensionDN)) != number)
            {
                HoldingFlagStatus(PhoneFunctions.InitiateTransfer);
                logger.Info("Set HoldingFlagStatus(PhoneFunctions.InitiateTransfer)");
            }
            //End

            RequestAgentTransfer.InitiateTransfer(number, location, userData);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Plays the video
        /// </summary>
        /// <param name="button">Button to set styles to</param>
        public void Play(Button button, IPlayable playable)
        {
            this.SwitchButtonStyle(button);
            if (CheckException.CheckNull(playable))
            {
                if (!this.MainScreenInstance.timerForProgress.Enabled)
                {
                    this.MainScreenInstance.timerForProgress.Start();
                }

                playable.Play();
            }

            if (this.MainScreenInstance.timerForRF.Enabled)
            {
                this.MainScreenInstance.timerForRF.Stop();
                playable.PlayBackSpeed = 0;
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// Closes the video
        /// </summary>
        /// <param name="button">Button to set styles to</param>
        public void Close(Button button)
        {
            this.SwitchButtonStyle(button);

            if (CheckException.CheckNull(this.MainScreenInstance.video))
            {
                HolderForm.NullVideoAndForm(this.MainScreenInstance.video.DirectVideo);
            }

            if (CheckException.CheckNull(this.MainScreenInstance.audio))
            {
                this.MainScreenInstance.audio.DirectAudio.Dispose();
                this.MainScreenInstance.audio = null;
            }

            this.MainScreenInstance.GetSlider().Value   = 0;
            this.MainScreenInstance.GetSlider().Enabled = false;
            this.MainScreenInstance.timerForProgress.Stop();
            this.MainScreenInstance.timerForSubsSync.Stop();
            this.MainScreenInstance.GetLabel().Text = string.Empty;
        }
Exemplo n.º 25
0
 public void LoadSubs(Button button, Subtitles subtitles)
 {
     if (CheckException.CheckNull(this.VideoName))
     {
         OpenFileDialog Dialog1 = new OpenFileDialog();
         Dialog1.InitialDirectory = "c:\\";
         Dialog1.Filter           = Formats;
         Dialog1.FilterIndex      = 2;
         Dialog1.RestoreDirectory = true;
         if (Dialog1.ShowDialog() == DialogResult.OK)
         {
             if (Dialog1.OpenFile() != null)
             {
                 this.SubsName = Dialog1.FileName;
             }
         }
         if (CheckException.CheckNull(this.SubsName))
         {
             subtitles.Load(this.SubsName);
         }
     }
 }
Exemplo n.º 26
0
 /// <summary>
 /// 校验是否注入Mapper
 /// </summary>
 private static void CheckMapper()
 {
     CheckException.CustomVerify(_mapper.IsNotNull(), "使用AutoMapper转换扩展失败,请检查是否注入获取`IMapper`");
 }
Exemplo n.º 27
0
 public OutputValues Dial(string number, KeyValueCollection reason = null)
 {
     //Input Validation
     CheckException.CheckDialValues(number);
     return(RequestAgentDial.Dial(number, reason));
 }
Exemplo n.º 28
0
 public void Redirect(string routeOtherDN)
 {
     CheckException.CheckDialValues(routeOtherDN);
     RequestAgentRedirectCall.Redirect(routeOtherDN);
 }
Exemplo n.º 29
0
        public OutputValues Login(string place, string userName, string workMode, string queue, string agentLoginId, string agentPassword)
        {
            logger.Debug("SoftPhone Login:"******"*********************************************");
            logger.Debug("Place: " + place + Environment.NewLine + "UserName: "******"WorkMode: "
                         + workMode + Environment.NewLine + "Queue: " + queue + Environment.NewLine + "AgentLoginId: " + agentLoginId);
            logger.Debug("*********************************************");
            var output = new OutputValues();

            //Input Validation
            CheckException.CheckLoginValues(place, userName);

            //Authenticate User
            Settings.GetInstance().QueueName = queue;

            CheckException.CheckDN(Settings.GetInstance().ACDPosition, Settings.GetInstance().ExtensionDN, Settings.GetInstance().PlaceName);
            EventRegistered evenReg  = null;
            string          fullName = "";

            if (Settings.GetInstance().ACDPosition == Settings.GetInstance().ExtensionDN)
            {
                var message = RegisterDNRequest(Settings.GetInstance().ExtensionDN);
                if (message != null)
                {
                    switch (message.Id)
                    {
                    case EventRegistered.MessageId:
                        evenReg = message as EventRegistered;
                        string AID = string.IsNullOrEmpty(evenReg.AgentID) ? "" : evenReg.AgentID;
                        if (CheckPlcaeTaken(AID, out fullName))
                        {
                            if (Settings.GetInstance().ACDPosition == Settings.GetInstance().ExtensionDN)
                            {
                                Pointel.Softphone.Voice.Core.Request.RequestUnRegisterPlace.UnRegisterDN(Settings.GetInstance().ExtensionDN);
                            }
                            else
                            {
                                Pointel.Softphone.Voice.Core.Request.RequestUnRegisterPlace.UnRegisterDN(Settings.GetInstance().ACDPosition);
                                Pointel.Softphone.Voice.Core.Request.RequestUnRegisterPlace.UnRegisterDN(Settings.GetInstance().ExtensionDN);
                            }
                            output.MessageCode = "2004";
                            output.Message     = "Place is already taken by " + fullName + ".";
                            return(output);
                        }
                        AssignPreAgentStatus(evenReg);
                        AssignPreCallStatus(evenReg);
                        Settings.GetInstance().IsDNRegistered = true;
                        break;

                    case EventError.MessageId:
                        Settings.GetInstance().IsDNRegistered = false;
                        break;
                    }
                }
                Register(Settings.GetInstance().ExtensionDN);
            }
            else
            {
                var message = RegisterDNRequest(Settings.GetInstance().ACDPosition);
                if (message != null)
                {
                    switch (message.Id)
                    {
                    case EventRegistered.MessageId:
                        evenReg = message as EventRegistered;
                        string AID = string.IsNullOrEmpty(evenReg.AgentID) ? "" : evenReg.AgentID;
                        if (CheckPlcaeTaken(AID, out fullName))
                        {
                            if (Settings.GetInstance().ACDPosition == Settings.GetInstance().ExtensionDN)
                            {
                                Pointel.Softphone.Voice.Core.Request.RequestUnRegisterPlace.UnRegisterDN(Settings.GetInstance().ExtensionDN);
                            }
                            else
                            {
                                Pointel.Softphone.Voice.Core.Request.RequestUnRegisterPlace.UnRegisterDN(Settings.GetInstance().ACDPosition);
                                //Pointel.Softphone.Voice.Core.Request.RequestUnRegisterPlace.UnRegisterDN(Settings.GetInstance().ExtensionDN);
                            }
                            output.MessageCode = "2004";
                            output.Message     = "Place is already taken by " + fullName + ".";
                            return(output);
                        }
                        AssignPreAgentStatus(evenReg);
                        Settings.GetInstance().IsDNRegistered = true;
                        break;

                    case EventError.MessageId:
                        Settings.GetInstance().IsDNRegistered = false;
                        break;
                    }
                }
                IMessage message1 = RegisterDNRequest(Settings.GetInstance().ExtensionDN);
                if (message1 != null)
                {
                    switch (message1.Id)
                    {
                    case EventRegistered.MessageId:
                        evenReg = message as EventRegistered;
                        AssignPreCallStatus(evenReg);
                        Settings.GetInstance().IsDNRegistered = true;
                        break;

                    case EventError.MessageId:
                        Settings.GetInstance().IsDNRegistered = false;
                        break;
                    }
                }
                Register(Settings.GetInstance().ACDPosition);
                Register(Settings.GetInstance().ExtensionDN);
            }
            if (!Settings.GetInstance().ISAlreadyLogin&& Settings.GetInstance().IsDNRegistered)
            {
                output = RequestLogin.LoginAgent(workMode, queue, agentLoginId, agentPassword);
            }
            else if (Settings.GetInstance().ISAlreadyLogin)
            {
                output.MessageCode = "201";
                output.Message     = "Agent Login Success";
            }
            if (output.MessageCode == "200")
            {
                output.Message = "Agent Login Success";
            }

            return(output);
        }
Exemplo n.º 30
0
        public OutputValues Initialize(string place, string userName, ConfService configObject, string tServerApplicationName, string agentLoginId, string agentPassword,
                                       CfgSwitch switchType)
        {
            Settings.GetInstance().AgentLoginID   = agentLoginId;
            Settings.GetInstance().Switch         = switchType;
            Settings.GetInstance().SwitchTypeName = switchType.Type == CfgSwitchType.CFGLucentDefinityG3 ?
                                                    "avaya" :
                                                    ((switchType.Type == CfgSwitchType.CFGNortelDMS100 || switchType.Type == CfgSwitchType.CFGNortelMeridianCallCenter) ? "nortel" : "avaya");
            var output  = OutputValues.GetInstance();
            var connect = new VoiceConnectionManager();
            var read    = new ReadConfigObjects();

            //Print DLL Info
            try
            {
                Assembly assemblyVersion = Assembly.LoadFrom(Environment.CurrentDirectory + @"\Pointel.Softphone.Voice.dll");
                if (assemblyVersion != null)
                {
                    logger.Debug("*********************************************");
                    logger.Debug(assemblyVersion.GetName().Name + " : " + assemblyVersion.GetName().Version);
                    logger.Debug("*********************************************");
                }
            }
            catch (Exception versionException)
            {
                logger.Error("Error occurred while getting the version of the SoftPhone library " + versionException.ToString());
            }

            try
            {
                //ConnectionSettings.comObject = configObject;
                //Get Place details
                Settings.GetInstance().PlaceName = place;
                Settings.GetInstance().UserName  = userName;
                output = read.ReadPlaceObject();
                //Read Person Details
                //output = read.ReadPersonObject(userName);
                read.ReadApplicationObject(tServerApplicationName, agentLoginId);
            }
            catch (Exception inputException)
            {
                logger.Error("Error occurred while login into SoftPhone " + inputException);
            }

            //Input Validation
            CheckException.CheckLoginValues(place, userName);
            if (output.MessageCode == "200")
            {
                //Register with TServer
                output = connect.ConnectTServer(Settings.GetInstance().PrimaryApplication, Settings.GetInstance().SecondaryApplication);

                if (output.MessageCode != "200")
                {
                    logger.Debug("Protocol is not opened, try to connect with server config keys");
                    if (Settings.GetInstance().VoiceProtocol != null && Settings.GetInstance().VoiceProtocol.State != ChannelState.Opened)
                    {
                        if (!string.IsNullOrEmpty(Settings.GetInstance().PrimaryTServerName))
                        {
                            logger.Debug("Primary TServer name : " + Settings.GetInstance().PrimaryTServerName);
                            Settings.GetInstance().PrimaryApplication = read.ReadApplicationLevelServerDetails(Settings.GetInstance().PrimaryTServerName);
                        }
                        if (!string.IsNullOrEmpty(Settings.GetInstance().SecondaryTServerName))
                        {
                            logger.Debug("Secondary TServer name : " + Settings.GetInstance().SecondaryTServerName);
                            Settings.GetInstance().SecondaryApplication = read.ReadApplicationLevelServerDetails(Settings.GetInstance().SecondaryTServerName);

                            if (Settings.GetInstance().PrimaryApplication == null && Settings.GetInstance().SecondaryApplication != null)
                            {
                                logger.Debug("Primary server is not configured, Secondary server is assigned to Primary server");
                                Settings.GetInstance().PrimaryApplication = Settings.GetInstance().SecondaryApplication;
                            }
                        }
                        else
                        {
                            logger.Debug("secondary application name is not configured");
                            if (Settings.GetInstance().SecondaryApplication == null)
                            {
                                logger.Debug("Secondary server is not configured, primary server is assigned to secondary server");
                                Settings.GetInstance().SecondaryApplication = Settings.GetInstance().PrimaryApplication;
                            }
                        }

                        //connect with server names from options tab
                        output = connect.ConnectTServer(Settings.GetInstance().PrimaryApplication, Settings.GetInstance().SecondaryApplication);
                    }
                    else
                    {
                        return(output);
                    }
                }
            }

            return(output);
        }