Exemplo n.º 1
0
        /// <summary>
        /// Ends ongoing call.
        /// </summary>
        /// <param name="id">ID of the call which is to be ended.</param>
        /// <param name="type">Call release type.</param>
        /// <privlevel>platform</privlevel>
        /// <privilege>http://developer.samsung.com/tizen/privilege/call.admin</privilege>
        /// <exception cref="UnauthorizedAccessException">Thrown when privilege access is denied.</exception>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void EndCall(uint id, CallReleaseType type)
        {
            int ret = Interop.CallManager.EndCall(_handle, id, type);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to end call, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.admin");
            }
        }
Exemplo n.º 2
0
        private void UnregisterVoiceRecordStatusEvent()
        {
            int ret = Interop.CallManager.UnsetVoiceRecordStatusCb(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to unset voice record status changed callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sets LCD state for the device display.
        /// </summary>
        /// <since_tizen> 4 </since_tizen>
        /// <param name="state">LCD state to be set.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public static void SetLcdState(LcdControlState state)
        {
            int ret = Interop.CallManager.SetLcdState(state);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set LCD state, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Starts incoming call alert ringtone.
        /// </summary>
        /// <exception cref="UnauthorizedAccessException">Thrown when privilege access is denied.</exception>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void StartAlert()
        {
            int ret = Interop.CallManager.StartAlert(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to start incoming call alert, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Sets device LCD time out.
        /// </summary>
        /// <param name="timeout">LCD timeout to be set.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void SetLcdTimeout(LcdTimeOut timeout)
        {
            int ret = Interop.CallManager.SetLcdTimeOut(_handle, timeout);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set LCD timeout, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 6
0
        private void UnregisterCallMuteStatusChangedEvent()
        {
            int ret = Interop.CallManager.UnsetCallMuteStatusCallback(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to unset call mute status changed callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Activates call manager UI.
        /// </summary>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void ActivateUi()
        {
            int ret = Interop.CallManager.ActivateUi(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to activate UI, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 8
0
        private void UnregisterAudioStateChangedEvent()
        {
            int ret = Interop.CallManager.UnsetAudioStateChangedCb(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to unset audio state changed callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 9
0
        private void UnregisterCallEventNotification()
        {
            int ret = Interop.CallManager.UnsetCallEventCb(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to unset call event notification callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Stops incoming call alert ringtone.
        /// </summary>
        /// <privlevel>partner</privlevel>
        /// <privilege>http://developer.samsung.com/tizen/privilege/call.reject</privilege>
        /// <exception cref="UnauthorizedAccessException">Thrown when privilege access is denied.</exception>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void StopAlert()
        {
            int ret = Interop.CallManager.StopAlert(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to stop incoming call alert, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.reject");
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Stops sending DTMF signal.
        /// </summary>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void StopDtmf()
        {
            int ret = Interop.CallManager.StopDtmf(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to stop DTMF, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Sets the noise reduction feature during call.
        /// </summary>
        /// <param name="isNoiceReduction">Boolean value to indicate whether the call needs noise reduction.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void SetNoiseReduction(bool isNoiceReduction)
        {
            int ret = Interop.CallManager.SetNoiseReduction(_handle, isNoiceReduction);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set noise reduction, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Sets the mute state of the call.
        /// </summary>
        /// <param name="isMuteState">Mute state to be set.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void SetMuteState(bool isMuteState)
        {
            int ret = Interop.CallManager.SetMuteState(_handle, isMuteState);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set mute state, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Confirms upgrade call request.
        /// </summary>
        /// <param name="response">Upgrade response type.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void ConfirmUpgradeCall(CallUpgradeResponseType response)
        {
            int ret = Interop.CallManager.ConfirmUpgradeCall(_handle, response);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to confirm upgrade call, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// Sets extra volume if needed.
        /// </summary>
        /// <param name="isExtraVolume">Boolean value to indicate if the call is set to have extra volume.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void SetExtraVolume(bool isExtraVolume)
        {
            int ret = Interop.CallManager.SetExtraVolume(_handle, isExtraVolume);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set extra volume, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 16
0
        private void UnregisterDtmfIndicationEvent()
        {
            int ret = Interop.CallManager.UnsetDtmfIndicationCb(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to unset DTMF indication changed callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// Downgrades a call.
        /// </summary>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void DowngradeCall()
        {
            int ret = Interop.CallManager.DowngradeCall(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to downgrade call, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// Unholds the active call.
        /// </summary>
        /// <privlevel>platform</privlevel>
        /// <privilege>http://developer.samsung.com/tizen/privilege/call.admin</privilege>
        /// <exception cref="UnauthorizedAccessException">Thrown when privilege access is denied.</exception>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void UnholdCall()
        {
            int ret = Interop.CallManager.UnholdCall(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to unhold call, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.admin");
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// Splits a call.
        /// </summary>
        /// <param name="id">Call id to be splitted.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void SplitCall(uint id)
        {
            int ret = Interop.CallManager.SplitCall(_handle, id);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to split call, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 20
0
        private void UnregisterGoForegroundEvent()
        {
            int ret = Interop.CallManager.UnsetForegroundCb(_handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to unset go foreground callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// Sends DTMF response.
        /// </summary>
        /// <param name="response">DTMF response type.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void SendDtmfResponse(DtmfResponseType response)
        {
            int ret = Interop.CallManager.SendDtmfResponse(_handle, response);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to send DTMF response, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Answers an incoming call.
        /// </summary>
        /// <param name="answerType">Call answer type.</param>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public void AnswerCall(CallAnswerType answerType)
        {
            int ret = Interop.CallManager.AnswerCall(_handle, answerType);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to answer call, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// Initializes the call manager.
        /// </summary>
        /// <since_tizen> 4 </since_tizen>
        /// <returns>An instance of CmClientHandle class to use call manager APIs.</returns>
        /// <feature>http://tizen.org/feature/network.telephony</feature>
        /// <exception cref="NotSupportedException">Thrown when telephony feature is not supported.</exception>
        /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
        public static CmClientHandle InitCm()
        {
            int ret = Interop.CallManager.InitCm(out IntPtr handle);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to initialize call manager, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret);
            }

            return(new CmClientHandle(handle));
        }
Exemplo n.º 24
0
        private void RegisterAudioStateChangedEvent()
        {
            _audioStateChangedCb = (AudioState state, IntPtr userData) =>
            {
                _audioStateChanged?.Invoke(null, new AudioStatusChangedEventArgs(state));
            };
            int ret = Interop.CallManager.SetAudioStateChangedCb(_handle, _audioStateChangedCb, IntPtr.Zero);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set audio state changed callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 25
0
        private void RegisterVoiceRecordStatusEvent()
        {
            _voiceRecordStatusChangedCb = (VrStatus vrStatus, VrStatusExtraType extraType, IntPtr userData) =>
            {
                _voiceRecordStatusChanged?.Invoke(null, new VoiceRecordStatusEventArgs(vrStatus, extraType));
            };
            int ret = Interop.CallManager.SetVoiceRecordStatusCb(_handle, _voiceRecordStatusChangedCb, IntPtr.Zero);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set voice record status changed callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 26
0
        private void RegisterGoForegroundEvent()
        {
            _goForeGroundCb = (IntPtr userData) =>
            {
                _goForeGround?.Invoke(null, EventArgs.Empty);
            };
            int ret = Interop.CallManager.SetForegroundCb(_handle, _goForeGroundCb, IntPtr.Zero);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set go foreground callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 27
0
        private void RegisterDialStatusEvent()
        {
            _dialStatusChangedCb = (DialStatus status, IntPtr userData) =>
            {
                _dialStatusChanged?.Invoke(null, new DialStatusEventArgs(status));
            };
            int ret = Interop.CallManager.SetDialStatusCb(_handle, _dialStatusChangedCb, IntPtr.Zero);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set dial status changed callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 28
0
        private void RegisterDtmfIndicationEvent()
        {
            _dtmfIndicationChangedCb = (DtmfIndication indiType, string number, IntPtr userData) =>
            {
                _dtmfIndication?.Invoke(null, new DtmfIndicationEventArgs(indiType, number));
            };
            int ret = Interop.CallManager.SetDtmfIndicationCb(_handle, _dtmfIndicationChangedCb, IntPtr.Zero);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set DTMF indication changed callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 29
0
        private void RegisterCallMuteStatusChangedEvent()
        {
            _callMuteStatusChangedCb = (CallMuteStatus muteStatus, IntPtr userData) =>
            {
                _callMuteStatusChanged?.Invoke(null, new CallMuteStatusChangedEventArgs(muteStatus));
            };
            int ret = Interop.CallManager.SetCallMuteStatusCallback(_handle, _callMuteStatusChangedCb, IntPtr.Zero);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set call mute status changed callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }
Exemplo n.º 30
0
        private void RegisterCallEventNotification()
        {
            _callEventCb = (CallEvent callEvent, IntPtr eventData, IntPtr userData) =>
            {
                _callEvent?.Invoke(null, new CallEventEventArgs(callEvent, CmUtility.GetCallEventData(callEvent, eventData)));
            };
            int ret = Interop.CallManager.SetCallEventCb(_handle, _callEventCb, IntPtr.Zero);

            if (ret != (int)CmError.None)
            {
                Log.Error(CmUtility.LogTag, "Failed to set call event notification callback, Error: " + (CmError)ret);
                CmUtility.ThrowCmException(ret, _handle);
            }
        }