/// <summary> /// On call state. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Call_OnCallState(object sender, Param.CallStateParam e) { // Set the contact name. e.ContactName = _contactName; // If call is disconnected. if ((e.State == Nequeo.Net.Sip.InviteSessionState.PJSIP_INV_STATE_DISCONNECTED) || (e.State == Nequeo.Net.Sip.InviteSessionState.PJSIP_INV_STATE_NULL)) { // Stop the play if not already stopped. if (_playerStarted) { StopPlayer(); } // Close the window. _callEnded?.Invoke(); } else { UISync.Execute(() => { // If incomming. if ((e.State == Nequeo.Net.Sip.InviteSessionState.PJSIP_INV_STATE_INCOMING)) { } }); } }
/// <summary> /// On call state. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Call_OnCallState(object sender, Param.CallStateParam e) { // Set the contact name. e.ContactName = _contactName; // If call is disconnected. if ((e.State == Nequeo.Net.PjSip.InviteSessionState.PJSIP_INV_STATE_DISCONNECTED) || (e.State == Nequeo.Net.PjSip.InviteSessionState.PJSIP_INV_STATE_NULL)) { // Stop the play if not already stopped. if (_playerStarted) { StopPlayer(); } try { // Close the video window if any. if (_videoCallWindow != null) { _videoCallWindow.SetActiveState(false); _videoCallWindow.Close(); } } catch { } _videoCallWindow = null; // Close the window. _callEnded?.Invoke(); } else { UISync.Execute(() => { // If incomming. if ((e.State == Nequeo.Net.PjSip.InviteSessionState.PJSIP_INV_STATE_INCOMING)) { } }); } }