コード例 #1
0
 public void CreateCall(string dial)
 {
     call = softPhone.CreateCallObject(phoneLine, dial);
     WireUpCallEvents();
     call.Start();
     IsICall = true;
 }
コード例 #2
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);
            }
        }
コード例 #3
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();
        }
コード例 #4
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();
        }
コード例 #5
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();
		}
コード例 #6
0
 public void CreateCallToStream(string dial)
 {
     call = softPhone.CreateCallObject(phoneLine, dial);
     StartEvent();
     call.ModifyCallType(CallType.AudioVideo);
     call.Start();
 }
コード例 #7
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); }
 }
コード例 #8
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}");
        }
コード例 #9
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();
 }
コード例 #10
0
ファイル: PhoneForm.cs プロジェクト: WereDouglas/Casepro
 private void StartCall(string numberToDial)
 {
     if (call == null)
     {
         call = softphone.CreateDirectIPCallObject(phoneLine, new DirectIPDialParameters("5060"), numberToDial);
         call.CallStateChanged += call_CallStateChanged;
         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
        protected override void GivenOverride()
        {
            _call = _phone.CreateCall();
            _call.CallErrorOccured += (s, e) => _callError = e.Item;
            _call.CallStateChanged += (s, e) => _callState = e.Item;
            _call.Start(_testClientUaUri.FormatToString());
            _waitingforInviteReceived.WaitOne();

            _phone.InternalState.Should().Be(_stateProvider.GetWaitProvisional()); /*required assertion*/
        }
コード例 #13
0
ファイル: frmTelefono.cs プロジェクト: Mbmaldon/LxJuridico
        private void btnTransfer_Click(object sender, EventArgs e)
        {
            string transferTo = txtNoTransferir.Text;

            _call.ToggleHold();

            _call2 = _softPhone.CreateCallObject(_phoneLine, transferTo);
            _call2.CallStateChanged += call2_CallStateChanged;
            _call2.Start();
        }
コード例 #14
0
        protected override void GivenOverride()
        {
            _call = _phone.CreateCall();
            _call.CallErrorOccured += (s, e) => _callError = e.Item;
            _call.CallStateChanged += (s, e) => _callState = e.Item;
            _call.Start(_testClientUaUri.FormatToString());
            _waitingforInviteReceived.WaitOne();

            _phone.InternalState.Should().Be(_stateProvider.GetWaitProvisional()); /*required assertion*/
        }
コード例 #15
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();
            }
        }
コード例 #16
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();
 }
コード例 #17
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);
     }
 }
コード例 #18
0
        public void StartCall(string numberToDial)
        {
            phoneLineInitialization();
            if (call == null)
            {
                Console.WriteLine("starting call");
                call = softphone.CreateDirectIPCallObject(phoneLine, new DirectIPDialParameters("5060"), numberToDial);

                call.CallStateChanged += call_CallStateChanged;
                call.Start();
                Console.WriteLine(call.CallID);
            }
        }
コード例 #19
0
ファイル: Home.cs プロジェクト: pawlikx/VoiceCommunicator
        private void StartCall(string numberToDial)
        {
            //phoneLineInit(myNumber);
            Caller = new Thread(Ozeki);
            Caller.Start();
            Thread.Sleep(1000);
            if (call == null)
            {
                call = softphone.CreateDirectIPCallObject(phoneLine, new DirectIPDialParameters("5060"), numberToDial);
                call.CallStateChanged += call_CallStateChanged;

                call.Start();
            }
        }
コード例 #20
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();
            }
        }
コード例 #21
0
ファイル: Form1.cs プロジェクト: kterdal/VOIP-Softphone
        private void btn_Redial_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(reDialNumber))
            {
                return;
            }

            if (call != null)
            {
                return;
            }

            call = softPhone.CreateCallObject(phoneLine, reDialNumber);
            WireUpCallEvents();
            call.Start();
        }
コード例 #22
0
        protected override void GivenOverride()
        {
            _call = _phone.CreateCall();
            _call.CallStateChanged += call_CallStateChanged;
            _call.Start(_testClientUaUri.FormatToString());

            _waitingforInviteReceived.WaitOne();
            _phone.InternalState.Should().Be(_stateProvider.GetWaitProvisional()); /*required assertion*/

            _toTag = SipUtil.CreateTag();
            var provResponse = CreateRingingResponse(_receivedInvite, _toTag);
            _network.SendTo(SipFormatter.FormatMessage(provResponse), _testClientUaEndPoint, _phoneUaEndPoint);
            _ringingProcessed.WaitOne();

            _phone.InternalState.Should().Be(_stateProvider.GetWaitFinal()); /*required assertion*/
        }
コード例 #23
0
        private void StartCall(IPhoneCall call)
        {
            if (call == null)
            {
                return;
            }

            SubscribeToCallEvents(call);
            call.Start();

            PhoneCalls.Add(call);

            if (SelectedCall == null)
            {
                SelectedCall = call;
            }
        }
コード例 #24
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();
 }
コード例 #25
0
        protected override void GivenOverride()
        {
            _call = _phone.CreateCall();
            _call.CallStateChanged += call_CallStateChanged;
            _call.Start(_testClientUaUri.FormatToString());

            _waitingforInviteReceived.WaitOne();
            _phone.InternalState.Should().Be(_stateProvider.GetWaitProvisional()); /*required assertion*/

            _toTag = SipUtil.CreateTag();
            var provResponse = CreateRingingResponse(_receivedInvite, _toTag);

            _network.SendTo(SipFormatter.FormatMessage(provResponse), _testClientUaEndPoint, _phoneUaEndPoint);
            _ringingProcessed.WaitOne();

            _phone.InternalState.Should().Be(_stateProvider.GetWaitFinal()); /*required assertion*/
        }
コード例 #26
0
        private void StartCall(IPhoneCall call)
        {
            lock (_sync)
            {
                if (call == null)
                {
                    return;
                }

                SubscribeToCallEvents(call);
                call.Start();
                MediaHandlers.LoadSpeechToText();
                PhoneCalls.Add(call);

                if (SelectedCall == null)
                {
                    SelectedCall = call;
                }
            }
        }
コード例 #27
0
        private void _btnPhone_Click(object sender, EventArgs e)
        {
            if (!_callState.HasValue || _callState.Value == CallState.Completed)
            {
                FormHelper.ValidateCondition(SipUtil.IsSipUri(_txtToUri.Text), "To-uri");

                _outgoingCall = _softPhone.CreateCall();
                WireEvents(_outgoingCall);
                _outgoingCall.Start(_txtToUri.Text);
                Log("Call started");
            }
            else if (_callState.Value == CallState.Ringing)
            {
                _incomingCall.Accept();
            }
            else if (_callState.Value == CallState.Ringback || _callState.Value == CallState.InCall)
            {
                _outgoingCall.Stop();
            }
        }
コード例 #28
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();
        }
コード例 #29
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();
        }
コード例 #30
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();
        }
コード例 #31
0
 void CreateCall()
 {
     var numberToDial = id2;
     call = softphone.CreateCallObject(phoneLine, numberToDial);
     call.CallStateChanged += call_CallStateChanged;
     call.Start();
 }
コード例 #32
0
ファイル: IntegrationTestBase.cs プロジェクト: goupviet/Hallo
 protected void CallAlice()
 {
     _outgoingCallAlice = _phoneBob.CreateCall();
     WireEventsBob(_outgoingCallAlice);
     _outgoingCallAlice.Start(_aliceEndPoint.ToString());
 }
コード例 #33
0
ファイル: IntegrationTestBase.cs プロジェクト: goupviet/Hallo
 protected void CallBob()
 {
     _outgoingCallBob = _phoneAlice.CreateCall();
     WireEventsAlice(_outgoingCallBob);
     _outgoingCallBob.Start(_bobEndPoint.ToString());
 }
コード例 #34
0
        public void CreateCall(string pPhoneNo, int pPhoneRingTimeOut = 30)
        {
            if (pPhoneRingTimeOut > 0)
                m_RingingTimeOut = pPhoneRingTimeOut;

            m_RingTimeOut = false;
            m_PhoneNo = pPhoneNo;

            m_UserMicrophone.Start();
            connector.Connect(m_UserMicrophone, mediaSender);

            AudioId = Guid.NewGuid();
            CommonApplicationData commonData = new CommonApplicationData("BrightVision", "BrightSales", true);
            m_UserMicrophone.Start();
            string fileNameTmp = String.Format(@"{0}\tmpwav\{1}_.wav", commonData.ApplicationFolderPath, AudioId);
            recorder = new WaveStreamRecorder(fileNameTmp);
            recorder.Stopped += new EventHandler<EventArgs>(recorder_Stopped);

            connector.Connect(m_UserMicrophone, mixer);
            connector.Connect(mediaReceiver, mixer);
            connector.Connect(mixer, recorder);
            m_UserSpeaker.Start();
            connector.Connect(mediaReceiver, m_UserSpeaker);

            call = softPhone.CreateCallObject(phoneLine, m_PhoneNo);
            mediaSender.AttachToCall(call);
            mediaReceiver.AttachToCall(call);

            this.WireUpCallEvents();
            //System.Threading.Thread.Sleep(1500);
            call.Start();
            //softPhone.RegisterPhoneLine(phoneLine);
            //this.InitializeSoftPhone();
        }
コード例 #35
0
ファイル: SoftPhoneForm.cs プロジェクト: HNeukermans/Hallo
        private void _btnPhone_Click(object sender, EventArgs e)
        {
            if (!_callState.HasValue || _callState.Value == CallState.Completed)
            {
                FormHelper.ValidateCondition(SipUtil.IsSipUri(_txtToUri.Text), "To-uri");

                _outgoingCall = _softPhone.CreateCall();
                WireEvents(_outgoingCall);
                _outgoingCall.Start(_txtToUri.Text);
                Log("Call started");
            }
            else if (_callState.Value == CallState.Ringing)
            {
                _incomingCall.Accept();
            }
            else if (_callState.Value == CallState.Ringback || _callState.Value == CallState.InCall)
            {
                _outgoingCall.Stop();
            }
        }
コード例 #36
0
 protected void CallAlice()
 {
     _outgoingCallAlice = _phoneBob.CreateCall();
     WireEventsBob(_outgoingCallAlice);
     _outgoingCallAlice.Start(_aliceEndPoint.ToString());
 }
コード例 #37
0
 protected void CallBob()
 {
     _outgoingCallBob = _phoneAlice.CreateCall();
     WireEventsAlice(_outgoingCallBob);
     _outgoingCallBob.Start(_bobEndPoint.ToString());
 }
コード例 #38
0
        private void StartCall(IPhoneCall call)
        {
            if (call == null)
                return;

            SubscribeToCallEvents(call);
            call.Start();

            PhoneCalls.Add(call);

            if (SelectedCall == null)
                SelectedCall = call;
        }