public void OnHoldStateChanged(SipHoldStateState newState) { if (onHoldEvent != null) { onHoldEvent(this, new SipHoldEventArgs(newState)); } }
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"); }
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; }
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"; }