Пример #1
0
 void OnCloseProgram(CloseProgramMessage message)
 {
     if (MBAPhone != null)
     {
         MBAPhone.UnInitialize();
     }
 }
Пример #2
0
        public void PhoneCallButtonClick()
        {
            switch (phoneState)
            {
            case PhoneState.FREE:
                if (!MBAPhone.DialCall(1, Number, -1, -1))
                {
                    Trace.WriteLine("ERROR DialCall method. CODE: " + MBAPhone.GetVaxObjectError().ToString());
                }
                break;

            case PhoneState.TRYING:
            case PhoneState.TRYING_IN:
            case PhoneState.CALL_ACCEPTS:
                if (!MBAPhone.Disconnect(1))
                {
                    Trace.WriteLine("ERROR Disconnect method. CODE: " + MBAPhone.GetVaxObjectError().ToString());
                }
                else
                {
                    phoneState = PhoneState.FREE;
                    SoundPlayer.Stop();
                    phoneTimer.Enabled = false;
                    CallDuration       = 0;
                }
                break;

            case PhoneState.RINGING:
                break;

            default:
                break;
            }
        }
Пример #3
0
        private void MBAPhone_OnSuccessToConnect(int LineNo, string ToRTPIP, int ToRTPPort)
        {
            phoneState   = PhoneState.CALL_ACCEPTS;
            CallDuration = 0;
            SoundPlayer.Stop();

            var svol = MBAPhone.GetSpkVolume();
            var mvol = MBAPhone.GetMicVolume();

            //if (!MBAPhone.SetSpkVolume(255))
            //    Trace.WriteLine("ERROR SetSpkVolume method. CODE: " + MBAPhone.GetVaxObjectError().ToString());
            //if (!MBAPhone.SetSpkSoftVolume(255))
            //    Trace.WriteLine("ERROR SetSpkSoftVolume method. CODE: " + MBAPhone.GetVaxObjectError().ToString());
            //if (!MBAPhone.SetMicVolume(255))
            //    Trace.WriteLine("ERROR SetMicVolume method. CODE: " + MBAPhone.GetVaxObjectError().ToString());
            //svol = MBAPhone.GetSpkVolume();
            //mvol = MBAPhone.GetMicVolume();
        }