public void OnHoldStateChanged(SipHoldStateState newState)
 {
     if (onHoldEvent != null)
     {
         onHoldEvent(this, new SipHoldEventArgs(newState));
     }
 }
Exemple #2
0
 internal static String HoldStateToString(SipHoldStateState state)
 {
     if ((state & SipHoldStateState.Error) == SipHoldStateState.Error)
     {
         return("Error");
     }
     else if ((state & SipHoldStateState.LocalHeld) == SipHoldStateState.LocalHeld && (state & SipHoldStateState.RemoteHeld) == SipHoldStateState.RemoteHeld)
     {
         return("Inactive");
     }
     else if ((state & SipHoldStateState.LocalHeld) == SipHoldStateState.LocalHeld)
     {
         return("Local");
     }
     else if ((state & SipHoldStateState.RemoteHeld) == SipHoldStateState.RemoteHeld)
     {
         return("Remote");
     }
     return("None");
 }
Exemple #3
0
        override internal void Update()
        {
            base.Update();

            bool                 mediaActivated = false;
            bool                 callActived    = false;
            bool                 videoActivated = false;
            SipAVCall            avCall         = null;
            SipHoldStateState    holdState      = SipHoldStateState.None;
            CameraSensorLocation cameraLocation = CameraSensorLocation.Front;

            SipService sipService = BackgroundProcessController.Instance.SipService;

            if (sipService != null)
            {
                avCall = sipService.SipActiveAVCall;
            }

            if (avCall != null)
            {
                mediaActivated = (avCall.State == SipAVCallState.InCall || avCall.State == SipAVCallState.EarlyMedia);
                callActived    = (avCall.State != SipAVCallState.Terminated && avCall.State != SipAVCallState.Terminating);
                videoActivated = (mediaActivated && avCall.WithVideo);
                holdState      = avCall.HoldState;
                cameraLocation = sipService.CameraLocation;
            }

            IsHangUpButtonEnabled       = callActived;
            IsHoldButtonEnabled         = mediaActivated;
            IsHoldButtonChecked         = ((holdState & SipHoldStateState.LocalHeld) == SipHoldStateState.LocalHeld);
            IsCameraToggleButtonEnabled = videoActivated;
            LittleHeadVisibility        = videoActivated ? Visibility.Visible : Visibility.Collapsed;
            LittleHeadPreviewUri        = videoActivated ? (cameraLocation == CameraSensorLocation.Back ? rearFacingCameraStreamUri : frontFacingCameraStreamUri) : null;
            CameraLocation    = cameraLocation;
            BigHeadVisibility = videoActivated ? Visibility.Visible : Visibility.Collapsed;
            BigHeadPreviewUri = videoActivated ? renderStreamUri : null;
            HoldState         = holdState;

            UpdateAudioButtons();
        }
 internal SipHoldEventArgs(SipHoldStateState state)
 {
     mState = state;
 }
 public void OnHoldStateChanged(SipHoldStateState newState)
 {
     if (onHoldEvent != null)
     {
         onHoldEvent(this, new SipHoldEventArgs(newState));
     }
 }
 internal SipHoldEventArgs(SipHoldStateState state)
 {
     mState = state;
 }
Exemple #7
0
 internal static String HoldStateToString(SipHoldStateState state)
 {
     if ((state & SipHoldStateState.Error) == SipHoldStateState.Error)
     {
         return "Error";
     }
     else if ((state & SipHoldStateState.LocalHeld) == SipHoldStateState.LocalHeld && (state & SipHoldStateState.RemoteHeld) == SipHoldStateState.RemoteHeld)
     {
         return "Inactive";
     }
     else if ((state & SipHoldStateState.LocalHeld) == SipHoldStateState.LocalHeld)
     {
         return "Local";
     }
     else if ((state & SipHoldStateState.RemoteHeld) == SipHoldStateState.RemoteHeld)
     {
         return "Remote";
     }
     return "None";
 }