コード例 #1
0
ファイル: Form1.cs プロジェクト: kterdal/VOIP-Softphone
        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();
        }
コード例 #2
0
ファイル: frmTelefono.cs プロジェクト: Mbmaldon/LxJuridico
        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();
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: meps1211/test
        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);
            }
        }
コード例 #4
0
 public void CreateCallToStream(string dial)
 {
     call = softPhone.CreateCallObject(phoneLine, dial);
     StartEvent();
     call.ModifyCallType(CallType.AudioVideo);
     call.Start();
 }
コード例 #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); }
 }
コード例 #6
0
        /// <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();
        }
コード例 #7
0
 public void CreateCall(string dial)
 {
     call = softPhone.CreateCallObject(phoneLine, dial);
     WireUpCallEvents();
     call.Start();
     IsICall = true;
 }
コード例 #8
0
		/// <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();
		}
コード例 #9
0
ファイル: RealPhone.cs プロジェクト: 324275217/voip-phone
        /// <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}");
        }
コード例 #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();
 }
コード例 #11
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();
         _call.Start();
     }
 }
コード例 #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);
        }
コード例 #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();
 }
コード例 #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();
            }
        }
コード例 #15
0
ファイル: SoftPhoneUtils.cs プロジェクト: rolypompa/STA
 /// <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);
     }
 }
コード例 #16
0
        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);
        }
コード例 #17
0
        /// <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);
        }
コード例 #18
0
ファイル: frmSoftphone.cs プロジェクト: rosauceda/Softphone-1
 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();
 }
コード例 #19
0
        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);
        }
コード例 #20
0
        /// <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();
        }
コード例 #21
0
ファイル: Softphone.cs プロジェクト: toannd18/PBXForm
        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();
        }