Example #1
0
        private void btn_PickUp_Click(object sender, EventArgs e)
        {
            if (inComingCall)
            {
                inComingCall = false;
                call.Answer();

                InvokeGUIThread(() => { lb_Log.Items.Add("Call accepted."); });
                return;
            }

            if (call != null)
            {
                return;
            }

            if (phoneLineInformation != RegState.RegistrationSucceeded)
            {
                InvokeGUIThread(() => { lb_Log.Items.Add("Registratin Failed!"); tb_Display.Text = "OFFLINE"; });
                return;
            }

            reDialNumber = tb_Display.Text;
            call         = softPhone.CreateCallObject(phoneLine, tb_Display.Text);
            WireUpCallEvents();
            call.Start();
        }
Example #2
0
        public void lnkPickUp_Click(object sender, EventArgs e)
        {
            if (_incomingCall)
            {
                lnkPickUpInCall.Visible = false;
                timer3.Enabled          = true;

                _incomingCall = false;
                _call.Answer();

                return;
            }

            if (_call != null)
            {
                return;
            }

            if (_phoneLineState != RegState.RegistrationSucceeded)
            {
                InvokeGUIThread(() => { txtDisplay.Text = "OFFLINE! Please register."; });
                return;
            }

            if (!String.IsNullOrEmpty(txtDisplay.Text))
            {
                var userName = txtDisplay.Text;
                lnkConfigurar.Enabled = false;

                if (pnlLlamada.Visible == true)
                {
                    frmTelefono.Animate2(pnlLlamada, frmTelefono.Effect.Slide, 150, 180);
                    frmTelefono.Animate(pnlKeyPad, frmTelefono.Effect.Slide, 150, 360);
                    frmTelefono.Animate2(pnlLlamada, frmTelefono.Effect.Slide, 150, 180);
                }
                else
                {
                    frmTelefono.Animate(pnlKeyPad, frmTelefono.Effect.Slide, 150, 360);
                    frmTelefono.Animate2(pnlLlamada, frmTelefono.Effect.Slide, 150, 180);
                }

                lnkPickUpInCall.Visible = false;
                timer3.Enabled          = true;

                _call = _softPhone.CreateCallObject(_phoneLine, userName);
                WireUpCallEvents();
                _call.Start();
            }
        }
Example #3
0
        void btn_PickUp_Click(object sender, EventArgs e)
        {
            if (_incomingCall)
            {
                _incomingCall = false;
                _call.Answer();

                return;
            }

            if (_call != null)
            {
                return;
            }

            if (_phoneLineState != RegState.RegistrationSucceeded)
            {
                InvokeGUIThread(() => { tb_Display.Text = "OFFLINE! Please register."; });
                return;
            }

            if (!String.IsNullOrEmpty(tb_Display.Text))
            {
                var userName = tb_Display.Text;

                _call = _softPhone.CreateCallObject(_phoneLine, userName);
                WireUpCallEvents();
                _call.Start();

                _otherParty = _databaseManager.GetOtherPartyInfos(userName);
                ShowUserInfos(_otherParty);
            }
        }
 public void CreateCallToStream(string dial)
 {
     call = softPhone.CreateCallObject(phoneLine, dial);
     StartEvent();
     call.ModifyCallType(CallType.AudioVideo);
     call.Start();
 }
Example #5
0
 private void dialButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (agentSkill.SelectedItem != null && agentCurrentState.Text == "Dialing")
         {
             call = softphone.CreateCallObject(phoneLine1, to.Text);
             call.CallStateChanged += call_CallStateChanged;
             cStateDirection.Text   = "Out";
             call.Start();
             main.activateDefaultVoiceDevices();
             caller.Text = to.Text;
         }
         else
         {
             DialogResult result = MessageBox.Show("Dış arama yaparken statünüzün Dialing olması ve dış arama için kullanacağınız skill'i seçmeniz gerekir.", "Dialing ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
             if (result == DialogResult.Yes)
             {
                 wsc.changeAgentState("Dialing", e);
             }
             else
             {
                 main.errorModal("Dış arama yaparken statünüzün Dialing olması ve dış arama için kullanacağınız skill'i seçmeniz gerekir.");
             }
         }
     }
     catch (Exception err) { main.errorModal("Çağrı başlatılamadı. Hata:" + err); }
 }
        /// <summary>
        /// It starts a call with the dialed number or in case of an incoming call it accepts, picks up the call.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAramaYap_Click(object sender, EventArgs e)
        {
            if (inComingCall)
            {
                inComingCall = false;
                ////////////call.Accept();
                return;
            }

            if (call != null)
            {
                return;
            }

            if (string.IsNullOrEmpty(labelDialingNumber.Text))
            {
                return;
            }

            ////////////if (phoneLineInformation != PhoneLineState.RegistrationSucceeded && phoneLineInformation != PhoneLineState.NoRegNeeded)
            ////////////{
            ////////////    MessageBox.Show("Telefon hattı açılamadı.");
            ////////////    return;
            ////////////}

            call = softPhone.CreateCallObject(phoneLine, labelDialingNumber.Text);
            WireUpCallEvents();
            call.Start();
        }
 public void CreateCall(string dial)
 {
     call = softPhone.CreateCallObject(phoneLine, dial);
     WireUpCallEvents();
     call.Start();
     IsICall = true;
 }
		/// <summary>
		/// It starts a call with the dialed number or in case of an incoming call it accepts, picks up the call.
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void buttonPickUp_Click(object sender, EventArgs e)
		{
			if (inComingCall)
			{
				inComingCall = false;
				call.Accept();
				return;
			}

			if (call != null)
				return;

			if (string.IsNullOrEmpty(_TelefonNo))
				return;

			if (phoneLineInformation != PhoneLineState.RegistrationSucceeded && phoneLineInformation != PhoneLineState.NoRegNeeded)
			{
				MessageBox.Show("Phone line state is not valid!");
				return;
			}

			call = softPhone.CreateCallObject(phoneLine, _TelefonNo);
			WireUpCallEvents();
			call.Start();
		}
Example #9
0
        /// <summary>
        /// 拨号或者接听
        /// </summary>
        /// <param name="number"></param>
        public void PickUp(string number)
        {
            // accept incoming call
            if (call != null && call.IsIncoming)
            {
                RaiseMessage?.Invoke("Talking");
                call.Answer();
                return;
            }

            // dial
            if (call != null)
            {
                return;
            }

            if (string.IsNullOrEmpty(number))
            {
                return;
            }

            if (phoneLine.RegState != RegState.RegistrationSucceeded)
            {
                RaiseMessage?.Invoke("Phone line must be registered!");
                return;
            }

            call = softPhone.CreateCallObject(phoneLine, number);
            SubscribeToCallEvents(call);
            call.Start();
            RaiseMessage?.Invoke($"Calling {number}");
        }
Example #10
0
 private void Dial()
 {
     _log.Info(String.Format("Calling {0}", _config.GetStringValue("call")));
     _call = _softPhone.CreateCallObject(_phoneLine, _config.GetStringValue("call"));
     _call.CallStateChanged        += CallStateChangedHandler;
     _call.InstantMessageSendError += MessageSendError;
     _call.Start();
 }
 /// <summary>
 /// Starts calling the specified number.
 /// In this sample an outgoing call can be made if there is no current call (outgoing or incoming) on the phone line.
 /// </summary>
 public void StartCall(string numberToDial)
 {
     if (_call == null)
     {
         _call = _softphone.CreateCallObject(_phoneLine, numberToDial);
         WireUpCallEvents();
         _call.Start();
     }
 }
Example #12
0
        /// <summary>
        /// Starts dialling a number on the selected phone line.
        /// </summary>
        public void Dial(string dialNumber, CallType callType)
        {
            if (string.IsNullOrEmpty(dialNumber))
            {
                return;
            }

            IPhoneCall call = softPhone.CreateCallObject(SelectedLine, dialNumber, callType);

            StartCall(call);
        }
Example #13
0
 public void Calling()
 {
     if (_call != null || !(_phoneLineInformation.IsRegistered()))
     {
         InvokeGUIThread(() => { lb_Log.Items.Add("Call error: " + _phoneLineInformation.ToString()); });
         return;
     }
     _call = _softPhone.CreateCallObject(_phoneLine, txtNumber.Text);
     WireUpCallEvents();
     _call.Start();
 }
Example #14
0
        /// <summary>
        /// Starts calling the specified number.
        /// In this sample an outgoing call can be made if there is no current call (outgoing or incoming) on the phone line.
        /// </summary>
        public void StartCall(string numberToDial)
        {
            if (_call == null)
            {
                _call = _softphone.CreateCallObject(_phoneLine, numberToDial);
                WireUpCallEvents();

                // To make a call simply call the Start() method of the call object.
                _call.Start();
            }
        }
Example #15
0
 /// <summary>
 /// Iniciar llamada.
 /// </summary>
 private static void startCall()
 {
     try
     {
         call = softphone.CreateCallObject(phoneLine, registerName);
         call.CallStateChanged += callStateChanged;
         call.Start();
     }
     catch (Exception e)
     {
         log.Error(e);
     }
 }
        public OutGoingCallEngine(string dialedNumber, ISoftPhone softPhone, IPhoneLine phoneLine)
        {
            _connector = new MediaConnector();
            _videoSender = new PhoneCallVideoSender();
            _audioSender = new PhoneCallAudioSender();

            var dial = new DialParameters(dialedNumber) { CallType = CallType.AudioVideo };
            Call = softPhone.CreateCallObject(phoneLine, dial);
            Call.CallStateChanged += _call_CallStateChanged;        

            _videoSender.AttachToCall(Call);
            _audioSender.AttachToCall(Call);
        }
        /// <summary>
        /// Starts dialling a number on the selected phone line.
        /// </summary>
        public void Dial(string dialNumber, CallType callType)
        {
            if (string.IsNullOrEmpty(dialNumber))
            {
                return;
            }

            var dialParams = new DialParameters(dialNumber);

            dialParams.CallType = callType;

            IPhoneCall call = softPhone.CreateCallObject(SelectedLine, dialParams);

            StartCall(call);
        }
Example #18
0
 private void Calling()
 {
     if (_call != null || !(_phoneLine.RegState == RegState.RegistrationSucceeded))
     {
         InvokeGUIThread(() =>
         {
             lb_Log.Items.Add("Call error: " +
                              _phoneLine.RegistrationInfo.StatusCode.ToString());
         });
         return;
     }
     SetupCalling();
     _call = _softPhone.CreateCallObject(_phoneLine, txtNumber.Text);
     SubcribedCallEvents();
     _call.Start();
     RefeshControlCall();
 }
        public OutGoingCallEngine(string dialedNumber, ISoftPhone softPhone, IPhoneLine phoneLine)
        {
            _connector   = new MediaConnector();
            _videoSender = new PhoneCallVideoSender();
            _audioSender = new PhoneCallAudioSender();

            var dial = new DialParameters(dialedNumber)
            {
                CallType = CallType.AudioVideo
            };

            Call = softPhone.CreateCallObject(phoneLine, dial);
            Call.CallStateChanged += _call_CallStateChanged;

            _videoSender.AttachToCall(Call);
            _audioSender.AttachToCall(Call);
        }
        /// <summary>
        /// Create and start the call to the dialed number
        /// </summary>
        /// <param name="dialedNumber"></param>
        public void Call(string dialedNumber)
        {
            if (phoneLineInformation != RegState.RegistrationSucceeded)
            {
                Console.WriteLine("Phone line state is not valid!");
                return;
            }

            if (string.IsNullOrEmpty(dialedNumber))
            {
                return;
            }

            if (call != null)
            {
                return;
            }

            call = softPhone.CreateCallObject(phoneLine, dialedNumber);
            WireUpCallEvents();
            call.Start();
        }
Example #21
0
        public void Pick_up(string _numberDial)
        {
            if (_inComingCall)
            {
                _inComingCall = false;
                _call.Answer();
                return;
            }
            if (_call != null)
            {
                return;
            }
            if (_phoneLineInformation != RegState.RegistrationSucceeded)
            {
                _message.Add("Registratin Failed! OFFLINE");
                return;
            }

            _call = _softPhone.CreateCallObject(_phoneLine, string.IsNullOrWhiteSpace(_numberDial) ? _reDialNumber : _numberDial);
            WireUpCallEvents();
            _call.Start();
        }