EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen.WebView", "..\src\Tizen.WebView\Tizen.WebView.csproj", "{8D3289A5-591B-421D-A79C-776B9AC74B95}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen.CallManager", "..\src\Tizen.CallManager\Tizen.CallManager.csproj", "{05DD16B8-2027-4728-AEB6-6296E7457533}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{8D3289A5-591B-421D-A79C-776B9AC74B95}.Release|x64.Build.0 = Release|x64
{8D3289A5-591B-421D-A79C-776B9AC74B95}.Release|x86.ActiveCfg = Release|x86
{8D3289A5-591B-421D-A79C-776B9AC74B95}.Release|x86.Build.0 = Release|x86
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Debug|x64.ActiveCfg = Debug|x64
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Debug|x64.Build.0 = Debug|x64
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Debug|x86.ActiveCfg = Debug|x86
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Debug|x86.Build.0 = Debug|x86
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Release|Any CPU.Build.0 = Release|Any CPU
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Release|x64.ActiveCfg = Release|x64
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Release|x64.Build.0 = Release|x64
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Release|x86.ActiveCfg = Release|x86
+ {05DD16B8-2027-4728-AEB6-6296E7457533}.Release|x86.Build.0 = Release|x86
EndGlobalSection
EndGlobal
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using Tizen.CallManager;
+
+/// <summary>
+/// Interop class for CallManager
+/// </summary>
+internal static partial class Interop
+{
+ /// <summary>
+ /// CallManager Native Apis
+ /// </summary>
+ internal static partial class CallManager
+ {
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void CallStatusChangedCallback(CallStatus callStatus, string number, IntPtr userData);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void CallMuteStatusChangedCallback(CallMuteStatus muteStatus, IntPtr userData);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void DialStatusChangedCallback(DialStatus dialStatus, IntPtr userData);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void DtmfIndicationChangedCallback(DtmfIndication indiType, string number, IntPtr userData);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void AudioStateChangedCallback(AudioState state, IntPtr userData);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void GoForegroundCallback(IntPtr userData);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void VoiceRecordStatusChangedCallback(VrStatus vrStatus, VrStatusExtraType extraType, IntPtr userData);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void CallEventNotificationCallback(CallEvent callEvent, IntPtr eventData, IntPtr userData);
+
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_init")]
+ internal static extern int InitCm(out IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_deinit")]
+ internal static extern int DeinitCm(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_reject_call")]
+ internal static extern int RejectCall(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_stop_alert")]
+ internal static extern int StopAlert(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_get_call_status")]
+ internal static extern int GetStatus(IntPtr handle, out CallStatus callStatus);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_call_status_cb")]
+ internal static extern int SetCallStatusCallback(IntPtr handle, CallStatusChangedCallback callback, IntPtr userData);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_call_status_cb")]
+ internal static extern int UnsetCallstatusCallback(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_get_mute_status")]
+ internal static extern int GetMuteStatus(IntPtr handle, out CallMuteStatus muteStatus);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_mute_status_cb")]
+ internal static extern int SetCallMuteStatusCallback(IntPtr handle, CallMuteStatusChangedCallback callback, IntPtr userData);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_mute_status_cb")]
+ internal static extern int UnsetCallMuteStatusCallback(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_enable_recovery")]
+ internal static extern int EnableRecovery(IntPtr handle, string appId);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_dial_call")]
+ internal static extern int DialCall(IntPtr handle, string number, CallType type, MultiSimSlot simSlot);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_swap_call")]
+ internal static extern int SwapCall(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_join_call")]
+ internal static extern int JoinCall(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_split_call")]
+ internal static extern int SplitCall(IntPtr handle, uint callId);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_transfer_call")]
+ internal static extern int TransferCall(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_answer_call_ex")]
+ internal static extern int AnswerCallEx(IntPtr handle, CallAnswerType answerType, CallType callType);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_answer_call")]
+ internal static extern int AnswerCall(IntPtr handle, CallAnswerType answerType);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_upgrade_call")]
+ internal static extern int UpgradeCall(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_downgrade_call")]
+ internal static extern int DowngradeCall(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_confirm_upgrade_call")]
+ internal static extern int ConfirmUpgradeCall(IntPtr handle, CallUpgradeResponseType respType);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_speaker_on")]
+ internal static extern int SpeakerOn(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_speaker_off")]
+ internal static extern int SpeakerOff(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_bluetooth_on")]
+ internal static extern int BluetoothOn(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_bluetooth_off")]
+ internal static extern int BluetoothOff(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_extra_vol")]
+ internal static extern int SetExtraVolume(IntPtr handle, bool isExtraVolume);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_noise_reduction")]
+ internal static extern int SetNoiseReduction(IntPtr handle, bool isNoiseReduction);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_mute_state")]
+ internal static extern int SetMuteState(IntPtr handle, bool isMuteState);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_start_dtmf")]
+ internal static extern int StartDtmf(IntPtr handle, byte dtmfDigit);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_stop_dtmf")]
+ internal static extern int StopDtmf(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_burst_dtmf")]
+ internal static extern int BurstDtmf(IntPtr handle, string dtmfDigits);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_send_dtmf_resp")]
+ internal static extern int SendDtmfResponse(IntPtr handle, DtmfResponseType respType);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_get_audio_state")]
+ internal static extern int GetAudioState(IntPtr handle, out AudioState state);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_activate_ui")]
+ internal static extern int ActivateUi(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_lcd_timeout")]
+ internal static extern int SetLcdTimeOut(IntPtr handle, LcdTimeOut timeOut);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_get_all_call_list")]
+ internal static extern int GetAllCallList(IntPtr handle, out IntPtr list);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_get_conference_call_list")]
+ internal static extern int GetConferenceCallList(IntPtr handle, out IntPtr list);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_get_all_calldata")]
+ internal static extern int GetAllCallData(IntPtr handle, out IntPtr incoming, out IntPtr active, out IntPtr held);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_start_voice_record")]
+ internal static extern int StartVoiceRecord(IntPtr handle, string number);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_stop_voice_record")]
+ internal static extern int StopVoiceRecord(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_dial_status_cb")]
+ internal static extern int SetDialStatusCb(IntPtr handle, DialStatusChangedCallback callback, IntPtr userData);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_dial_status_cb")]
+ internal static extern int UnsetDialStatusCb(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_audio_state_changed_cb")]
+ internal static extern int SetAudioStateChangedCb(IntPtr handle, AudioStateChangedCallback callback, IntPtr userData);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_audio_state_changed_cb")]
+ internal static extern int UnsetAudioStateChangedCb(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_dtmf_indication_cb")]
+ internal static extern int SetDtmfIndicationCb(IntPtr handle, DtmfIndicationChangedCallback callback, IntPtr userData);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_dtmf_indication_cb")]
+ internal static extern int UnsetDtmfIndicationCb(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_foreground_cb")]
+ internal static extern int SetForegroundCb(IntPtr handle, GoForegroundCallback callback, IntPtr userData);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_foreground_cb")]
+ internal static extern int UnsetForegroundCb(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_voice_record_status_cb")]
+ internal static extern int SetVoiceRecordStatusCb(IntPtr handle, VoiceRecordStatusChangedCallback callback, IntPtr userData);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_voice_record_status_cb")]
+ internal static extern int UnsetVoiceRecordStatusCb(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_person_id")]
+ internal static extern int GetPersonId(IntPtr handle, out int personId);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_member_count")]
+ internal static extern int GetCallMemberCount(IntPtr handle, out int memberCount);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_is_emergency_call")]
+ internal static extern int IsEmergencyCall(IntPtr handle, out bool isEmergency);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_is_voicemail_number")]
+ internal static extern int IsVoiceMailNumber(IntPtr handle, out bool isVoiceMailNumber);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_start_time")]
+ internal static extern int GetStartTime(IntPtr handle, out long startTime);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_session_id")]
+ internal static extern int GetSessionId(IntPtr handle, out int sessionId);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_hd_icon_state")]
+ internal static extern int GetHdIconState(IntPtr handle, out int IsHdEnable);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_is_wifi_calling")]
+ internal static extern int IsWiFiCalling(IntPtr handle, out int isWiFiCalling);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_upgrade_downgrade_state")]
+ internal static extern int GetUpgradeDowngradeState(IntPtr handle, out int isUpgradeDowngradeEnable);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_is_added_to_conf")]
+ internal static extern int IsAddedToConference(IntPtr handle, out int isAddedToConf);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_is_remote_on_hold")]
+ internal static extern int IsRemoteOnHold(IntPtr handle, out int isRemoteOnHold);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_get_call_id")]
+ internal static extern int GetConfCallId(IntPtr handle, out uint callId);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_get_call_number")]
+ internal static extern int GetConfCallNumber(IntPtr handle, out string number);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_get_person_id")]
+ internal static extern int GetConfCallPersonId(IntPtr handle, out int personId);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_get_name_mode")]
+ internal static extern int GetConfCallNameMode(IntPtr handle, out CallNameMode nameMode);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_free")]
+ internal static extern int FreeConfCallData(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_lcd_state")]
+ internal static extern int SetLcdState(LcdControlState state);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_start_alert")]
+ internal static extern int StartAlert(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_set_call_event_cb")]
+ internal static extern int SetCallEventCb(IntPtr handle, CallEventNotificationCallback callback, IntPtr userData);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_call_event_cb")]
+ internal static extern int UnsetCallEventCb(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_free")]
+ internal static extern int FreeCallData(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_id")]
+ internal static extern int GetCallId(IntPtr handle, out uint callId);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_direction")]
+ internal static extern int GetCallDirection(IntPtr handle, out CallDirection direction);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_number")]
+ internal static extern int GetCallNumber(IntPtr handle, out string number);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_calling_name")]
+ internal static extern int GetCallingName(IntPtr handle, out string name);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_type")]
+ internal static extern int GetCallType(IntPtr handle, out CallType type);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_state")]
+ internal static extern int GetCallState(IntPtr handle, out CallState state);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_domain")]
+ internal static extern int GetCallDomain(IntPtr handle, out CallDomain domain);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_name_mode")]
+ internal static extern int GetNameMode(IntPtr handle, out CallNameMode nameMode);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_mt_forwarded")]
+ internal static extern int IsForwardedCall(IntPtr handle, out bool isForwarded);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_sim_slot")]
+ internal static extern int GetSimSlot(IntPtr handle, out MultiSimSlot simSlot);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_incom_call")]
+ internal static extern int GetIncomingCallData(IntPtr handle, out IntPtr incomCall);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_call_id")]
+ internal static extern int GetEventDataCallId(IntPtr handle, out uint callId);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_active_call")]
+ internal static extern int GetActiveCall(IntPtr handle, out IntPtr activeCall);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_held_call")]
+ internal static extern int GetHeldCall(IntPtr handle, out IntPtr heldCall);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_end_cause")]
+ internal static extern int GetEndCause(IntPtr handle, out CallEndCause endCause);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_hold_call")]
+ internal static extern int HoldCall(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_unhold_call")]
+ internal static extern int UnholdCall(IntPtr handle);
+ [DllImport(Libraries.CallManager, EntryPoint = "cm_end_call")]
+ internal static extern int EndCall(IntPtr handle, uint callId, CallReleaseType releaseType);
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+internal static partial class Interop
+{
+ internal static partial class Libraries
+ {
+ public const string CallManager = "libcall-manager.so.0";
+ public const string Glib = "libglib-2.0.so.0";
+ public const string Libc = "libc.so.6";
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <Import Project="../../build/common.props" />
+
+ <PropertyGroup>
+ <TargetFramework>netstandard1.6</TargetFramework>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Tizen\Tizen.csproj" />
+ <ProjectReference Include="..\Tizen.Log\Tizen.Log.csproj" />
+ </ItemGroup>
+
+ <Import Project="../../build/common.targets" />
+</Project>
--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26430.13
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.CallManager", "Tizen.CallManager.csproj", "{18DF1A45-32B3-4577-84DF-BB3A1537ADC9}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{D06D0004-6A5F-4D6C-98C4-ADD3766A867A}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{78875590-41AB-4382-B64E-73A50DE0851C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|x64.Build.0 = Debug|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|x86.Build.0 = Debug|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|x64.ActiveCfg = Release|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|x64.Build.0 = Release|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|x86.ActiveCfg = Release|Any CPU
+ {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|x86.Build.0 = Release|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|x64.Build.0 = Debug|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|x86.Build.0 = Debug|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|x64.ActiveCfg = Release|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|x64.Build.0 = Release|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|x86.ActiveCfg = Release|Any CPU
+ {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|x86.Build.0 = Release|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|x64.Build.0 = Debug|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|x86.Build.0 = Debug|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Release|x64.ActiveCfg = Release|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Release|x64.Build.0 = Release|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Release|x86.ActiveCfg = Release|Any CPU
+ {78875590-41AB-4382-B64E-73A50DE0851C}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.CallManager
+{
+ /// <summary>
+ /// A class which defines the properties of call.
+ /// </summary>
+ public class CallData
+ {
+ internal uint CallId;
+ internal CallDirection CallDirection;
+ internal string Number;
+ internal string Name;
+ internal CallType CallType;
+ internal CallState CallState;
+ internal int Count;
+ internal bool IsEcc;
+ internal bool IsVoiceMail;
+ internal CallDomain CallDomain;
+ internal int PersonIndex;
+ internal long CallStartTime;
+ internal CallNameMode CallNameMode;
+ internal int SessionIdIms;
+ internal bool IsHdEnableIms;
+ internal bool IsWiFiCall;
+ internal bool IsUpgradeDowngrade;
+ internal bool IsRemoteHold;
+ internal bool IsAddedToConf;
+ internal bool IsForwardedCall;
+
+ internal CallData()
+ {
+ }
+
+ /// <summary>
+ /// Gets call id.
+ /// </summary>
+ public uint Id
+ {
+ get
+ {
+ return CallId;
+ }
+ }
+
+ /// <summary>
+ /// Gets call direction(MO or MT).
+ /// </summary>
+ public CallDirection Direction
+ {
+ get
+ {
+ return CallDirection;
+ }
+ }
+
+ /// <summary>
+ /// Get the call number.
+ /// </summary>
+ public string CallNumber
+ {
+ get
+ {
+ return Number;
+ }
+ }
+
+ /// <summary>
+ /// Get the contact name of calling number.
+ /// </summary>
+ public string CallingName
+ {
+ get
+ {
+ return Name;
+ }
+ }
+
+ /// <summary>
+ /// Get the call type(Voice call or Video call).
+ /// </summary>
+ public CallType Type
+ {
+ get
+ {
+ return CallType;
+ }
+ }
+
+ /// <summary>
+ /// Get the call state(Incoming, Active, etc).
+ /// </summary>
+ public CallState State
+ {
+ get
+ {
+ return CallState;
+ }
+ }
+
+ /// <summary>
+ /// Get the member count.
+ /// </summary>
+ public int MemberCount
+ {
+ get
+ {
+ return Count;
+ }
+ }
+
+ /// <summary>
+ /// Checks if the call is emergency call.
+ /// </summary>
+ public bool IsEmergency
+ {
+ get
+ {
+ return IsEcc;
+ }
+ }
+
+ /// <summary>
+ /// Checks if the number is voice mail number.
+ /// </summary>
+ public bool IsVoiceMailNumber
+ {
+ get
+ {
+ return IsVoiceMail;
+ }
+ }
+
+ /// <summary>
+ /// Get the call domain(PS call, CS call, etc).
+ /// </summary>
+ public CallDomain Domain
+ {
+ get
+ {
+ return CallDomain;
+ }
+ }
+
+ /// <summary>
+ /// Get the person ID.
+ /// </summary>
+ public int PersonId
+ {
+ get
+ {
+ return PersonIndex;
+ }
+ }
+
+ /// <summary>
+ /// Get the start time of the call.
+ /// </summary>
+ public long StartTime
+ {
+ get
+ {
+ return CallStartTime;
+ }
+ }
+
+ /// <summary>
+ /// Get the contact name mode.
+ /// </summary>
+ public CallNameMode Mode
+ {
+ get
+ {
+ return CallNameMode;
+ }
+ }
+
+ /// <summary>
+ /// Get the session ID of the call.
+ /// </summary>
+ public int SessionId
+ {
+ get
+ {
+ return SessionIdIms;
+ }
+ }
+
+ /// <summary>
+ /// Checks if HD is enabled for calling.
+ /// </summary>
+ public bool IsHdEnable
+ {
+ get
+ {
+ return IsHdEnableIms;
+ }
+ }
+
+ /// <summary>
+ /// Checks if the call is a WiFi call.
+ /// </summary>
+ public bool IsWiFiCalling
+ {
+ get
+ {
+ return IsWiFiCall;
+ }
+ }
+
+ /// <summary>
+ /// Checks if upgrade/downgrade is enabled.
+ /// </summary>
+ public bool IsUpgradeDowngradeEnable
+ {
+ get
+ {
+ return IsUpgradeDowngrade;
+ }
+ }
+
+ /// <summary>
+ /// Checks if the remote call is on hold.
+ /// </summary>
+ public bool IsRemoteOnHold
+ {
+ get
+ {
+ return IsRemoteHold;
+ }
+ }
+
+ /// <summary>
+ /// Checks if the call is added to conference.
+ /// </summary>
+ public bool IsAddedToConference
+ {
+ get
+ {
+ return IsAddedToConf;
+ }
+ }
+
+ /// <summary>
+ /// Checks if the incoming call is a forwarded call.
+ /// </summary>
+ public bool IsMtForwarded
+ {
+ get
+ {
+ return IsForwardedCall;
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.CallManager
+{
+ /// <summary>
+ /// A class which contains information about call event data.
+ /// </summary>
+ public class CallEventData
+ {
+ internal uint EventId;
+ internal MultiSimSlot Slot;
+ internal CallEndCause Cause;
+ internal CallData Incoming;
+ internal CallData Active;
+ internal CallData Held;
+ internal CallEventData()
+ {
+ }
+
+ /// <summary>
+ /// Get the Call id of the number for which Call event has occurred.
+ /// </summary>
+ public uint Id
+ {
+ get
+ {
+ return EventId;
+ }
+ }
+
+ /// <summary>
+ /// Get the Sim slot type.
+ /// </summary>
+ public MultiSimSlot SimSlot
+ {
+ get
+ {
+ return Slot;
+ }
+ }
+
+ /// <summary>
+ /// Get call end cause type.
+ /// </summary>
+ public CallEndCause EndCause
+ {
+ get
+ {
+ return Cause;
+ }
+ }
+
+ /// <summary>
+ /// Get incoming call data.
+ /// </summary>
+ public CallData IncomingData
+ {
+ get
+ {
+ return Incoming;
+ }
+ }
+
+ /// <summary>
+ /// Get active call data.
+ /// </summary>
+ public CallData ActiveData
+ {
+ get
+ {
+ return Active;
+ }
+ }
+
+ /// <summary>
+ /// Get the call data for held call.
+ /// </summary>
+ public CallData HeldData
+ {
+ get
+ {
+ return Held;
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.CallManager
+{
+ /// <summary>
+ /// A class which manages the use of Call Manager APIs.
+ /// </summary>
+ public static class CallManager
+ {
+ /// <summary>
+ /// Initializes the call manager.
+ /// </summary>
+ /// <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);
+ }
+
+ /// <summary>
+ /// Deinitializes the Call Manager handle.
+ /// </summary>
+ /// <param name="handle">The Call Manager handle to be deinitialized.</param>
+ /// <exception cref="ArgumentNullException">Thrown when CmClientHandle is passed as null.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public static void DeinitCm(CmClientHandle handle)
+ {
+ if (handle == null)
+ {
+ throw new ArgumentNullException("Call manager client handle is null");
+ }
+
+ int ret = Interop.CallManager.DeinitCm(handle._handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to deinitialize call manager, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, handle._handle);
+ }
+
+ handle._handle = IntPtr.Zero;
+ }
+
+ /// <summary>
+ /// Sets LCD state for the device display.
+ /// </summary>
+ /// <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);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Tizen.CallManager
+{
+ /// <summary>
+ /// A class which manages call manager events, properties and functions.
+ /// </summary>
+ public class CmClientHandle
+ {
+ internal IntPtr _handle = IntPtr.Zero;
+ private event EventHandler<CallStatusChangedEventArgs> _callStatusChanged;
+ private event EventHandler<CallMuteStatusChangedEventArgs> _callMuteStatusChanged;
+ private event EventHandler<CallEventEventArgs> _callEvent;
+ private event EventHandler<DialStatusEventArgs> _dialStatusChanged;
+ private event EventHandler<AudioStatusChangedEventArgs> _audioStateChanged;
+ private event EventHandler<DtmfIndicationEventArgs> _dtmfIndication;
+ private event EventHandler<EventArgs> _goForeGround;
+ private event EventHandler<VoiceRecordStatusEventArgs> _voiceRecordStatusChanged;
+
+ private Interop.CallManager.CallStatusChangedCallback _callStatusChangedCb;
+ private Interop.CallManager.CallMuteStatusChangedCallback _callMuteStatusChangedCb;
+ private Interop.CallManager.CallEventNotificationCallback _callEventCb;
+ private Interop.CallManager.DialStatusChangedCallback _dialStatusChangedCb;
+ private Interop.CallManager.AudioStateChangedCallback _audioStateChangedCb;
+ private Interop.CallManager.DtmfIndicationChangedCallback _dtmfIndicationChangedCb;
+ private Interop.CallManager.GoForegroundCallback _goForeGroundCb;
+ private Interop.CallManager.VoiceRecordStatusChangedCallback _voiceRecordStatusChangedCb;
+
+ internal CmClientHandle(IntPtr handle)
+ {
+ _handle = handle;
+ }
+
+ /// <summary>
+ /// This event is raised when call status changes.
+ /// </summary>
+ public event EventHandler<CallStatusChangedEventArgs> CallStatusChanged
+ {
+ add
+ {
+ if (_callStatusChanged == null)
+ {
+ RegisterCallStatusChangedEvent();
+ }
+
+ _callStatusChanged += value;
+ }
+
+ remove
+ {
+ _callStatusChanged -= value;
+ if (_callStatusChanged == null)
+ {
+ UnregisterCallStatusChangedEvent();
+ }
+ }
+ }
+
+ /// <summary>
+ /// This event is raised when the mute status changes.
+ /// </summary>
+ public event EventHandler<CallMuteStatusChangedEventArgs> CallMuteStatusChanged
+ {
+ add
+ {
+ if (_callMuteStatusChanged == null)
+ {
+ RegisterCallMuteStatusChangedEvent();
+ }
+
+ _callMuteStatusChanged += value;
+ }
+
+ remove
+ {
+ _callMuteStatusChanged -= value;
+ if (_callMuteStatusChanged == null)
+ {
+ UnregisterCallMuteStatusChangedEvent();
+ }
+ }
+ }
+
+ /// <summary>
+ /// This event is raised when call events change.
+ /// </summary>
+ public event EventHandler<CallEventEventArgs> CallEvent
+ {
+ add
+ {
+ if (_callEvent == null)
+ {
+ RegisterCallEventNotification();
+ }
+
+ _callEvent += value;
+ }
+
+ remove
+ {
+ _callEvent -= value;
+ if (_callEvent == null)
+ {
+ UnregisterCallEventNotification();
+ }
+ }
+ }
+
+ /// <summary>
+ /// This event is raised when dial status changes.
+ /// </summary>
+ public event EventHandler<DialStatusEventArgs> DialStatusChanged
+ {
+ add
+ {
+ if (_dialStatusChanged == null)
+ {
+ RegisterDialStatusEvent();
+ }
+
+ _dialStatusChanged += value;
+ }
+
+ remove
+ {
+ _dialStatusChanged -= value;
+ if (_dialStatusChanged == null)
+ {
+ UnregisterDialStatusEvent();
+ }
+ }
+ }
+
+ /// <summary>
+ /// This event is raised when audio status changes.
+ /// </summary>
+ public event EventHandler<AudioStatusChangedEventArgs> AudioStateChanged
+ {
+ add
+ {
+ if (_audioStateChanged == null)
+ {
+ RegisterAudioStateChangedEvent();
+ }
+
+ _audioStateChanged += value;
+ }
+
+ remove
+ {
+ _audioStateChanged -= value;
+ if (_audioStateChanged == null)
+ {
+ UnregisterAudioStateChangedEvent();
+ }
+ }
+ }
+
+ /// <summary>
+ /// This event is raised during DTMF indication.
+ /// </summary>
+ public event EventHandler<DtmfIndicationEventArgs> DtmfIndication
+ {
+ add
+ {
+ if (_dtmfIndication == null)
+ {
+ RegisterDtmfIndicationEvent();
+ }
+
+ _dtmfIndication += value;
+ }
+
+ remove
+ {
+ _dtmfIndication -= value;
+ if (_dtmfIndication == null)
+ {
+ UnregisterDtmfIndicationEvent();
+ }
+ }
+ }
+
+ /// <summary>
+ /// This event is raised when call comes to foreground.
+ /// </summary>
+ public event EventHandler<EventArgs> GoForeground
+ {
+ add
+ {
+ if (_goForeGround == null)
+ {
+ RegisterGoForegroundEvent();
+ }
+
+ _goForeGround += value;
+ }
+
+ remove
+ {
+ _goForeGround -= value;
+ if (_goForeGround == null)
+ {
+ UnregisterGoForegroundEvent();
+ }
+ }
+ }
+
+ /// <summary>
+ /// This event is raised when voice record status is changed.
+ /// </summary>
+ public event EventHandler<VoiceRecordStatusEventArgs> VoiceRecordStatusChanged
+ {
+ add
+ {
+ if (_voiceRecordStatusChanged == null)
+ {
+ RegisterVoiceRecordStatusEvent();
+ }
+
+ _voiceRecordStatusChanged += value;
+ }
+
+ remove
+ {
+ _voiceRecordStatusChanged -= value;
+ if (_voiceRecordStatusChanged == null)
+ {
+ UnregisterVoiceRecordStatusEvent();
+ }
+ }
+ }
+
+ private void RegisterCallStatusChangedEvent()
+ {
+ _callStatusChangedCb = (CallStatus status, string number, IntPtr userData) =>
+ {
+ _callStatusChanged?.Invoke(null, new CallStatusChangedEventArgs(status, number));
+ };
+ int ret = Interop.CallManager.SetCallStatusCallback(_handle, _callStatusChangedCb, IntPtr.Zero);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to set call status changed callback, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ private void UnregisterCallStatusChangedEvent()
+ {
+ int ret = Interop.CallManager.UnsetCallstatusCallback(_handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to unset call status changed callback, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ private void RegisterCallEventNotification()
+ {
+ _callEventCb = (CallEvent callEvent, IntPtr eventData, IntPtr userData) =>
+ {
+ _callEvent?.Invoke(null, new CallEventEventArgs(callEvent, CmUtility.GetCallEventData(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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ private void UnregisterDialStatusEvent()
+ {
+ int ret = Interop.CallManager.UnsetDialStatusCb(_handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to unset dial status changed callback, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ public CallStatus CallStatus
+ {
+ get
+ {
+ int ret = Interop.CallManager.GetStatus(_handle, out CallStatus status);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get call status, Error: " + (CmError)ret);
+ return default(CallStatus);
+ }
+
+ return status;
+ }
+ }
+
+ /// <summary>
+ /// Gets the mute status.
+ /// </summary>
+ public CallMuteStatus CallMuteStatus
+ {
+ get
+ {
+ int ret = Interop.CallManager.GetMuteStatus(_handle, out CallMuteStatus status);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get call mute status, Error: " + (CmError)ret);
+ return default(CallMuteStatus);
+ }
+
+ return status;
+ }
+ }
+
+ /// <summary>
+ /// Gets the audio state.
+ /// </summary>
+ public AudioState AudioState
+ {
+ get
+ {
+ int ret = Interop.CallManager.GetAudioState(_handle, out AudioState state);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get audio state, Error: " + (CmError)ret);
+ return default(AudioState);
+ }
+
+ return state;
+ }
+ }
+
+ /// <summary>
+ /// Gets the list of call data.
+ /// </summary>
+ public IEnumerable<CallData> AllCalls
+ {
+ get
+ {
+ int ret = Interop.CallManager.GetAllCallList(_handle, out IntPtr list);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get all call list, Error: " + (CmError)ret);
+ return null;
+ }
+
+ List<CallData> callList = new List<CallData>();
+ int offset = 0;
+ IntPtr data = Marshal.ReadIntPtr(list, offset);
+ if (data != IntPtr.Zero)
+ {
+ do
+ {
+ offset += Marshal.SizeOf(data);
+ callList.Add(CmUtility.GetCallData(data));
+ Interop.CallManager.FreeCallData(data);
+ data = IntPtr.Zero;
+ }
+
+ while ((data = Marshal.ReadIntPtr(list, offset)) != IntPtr.Zero);
+ }
+
+ return callList;
+ }
+ }
+
+ /// <summary>
+ /// Gets the list of conference call data.
+ /// </summary>
+ public IEnumerable<ConferenceCallData> AllConferenceCalls
+ {
+ get
+ {
+ int ret = Interop.CallManager.GetConferenceCallList(_handle, out IntPtr list);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get conference call list, Error: " + (CmError)ret);
+ return null;
+ }
+
+ List<ConferenceCallData> confList = new List<ConferenceCallData>();
+ int offset = 0;
+ IntPtr data = Marshal.ReadIntPtr(list, offset);
+ if (data != IntPtr.Zero)
+ {
+ do
+ {
+ offset += Marshal.SizeOf(data);
+ confList.Add(CmUtility.GetConfCallData(data));
+ Interop.CallManager.FreeConfCallData(data);
+ data = IntPtr.Zero;
+ }
+
+ while ((data = Marshal.ReadIntPtr(list, offset)) != IntPtr.Zero);
+ }
+
+ return confList;
+ }
+ }
+
+ /// <summary>
+ /// Rejects the incoming call.
+ /// </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 RejectCall()
+ {
+ int ret = Interop.CallManager.RejectCall(_handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to reject call, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.reject");
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <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");
+ }
+ }
+
+ /// <summary>
+ /// Enables call recovery.
+ /// </summary>
+ /// <param name="appId">App ID to be recovered.</param>
+ /// <exception cref="ArgumentNullException">Thrown appId is passed as null.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void EnableRecovery(string appId)
+ {
+ if (appId == null)
+ {
+ throw new ArgumentNullException("App ID is null");
+ }
+
+ int ret = Interop.CallManager.EnableRecovery(_handle, appId);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to enable recovery, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <summary>
+ /// Dials a call.
+ /// </summary>
+ /// <param name="number">Calling number to be dialed.</param>
+ /// <param name="type">Type of the call to be dialed.</param>
+ /// <param name="slot">Multi sim slot type in which the call is dialed.</param>
+ /// <exception cref="UnauthorizedAccessException">Thrown when privilege access is denied.</exception>
+ /// <exception cref="ArgumentNullException">Thrown number is passed as null.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void DialCall(string number, CallType type, MultiSimSlot slot)
+ {
+ if (number == null)
+ {
+ throw new ArgumentNullException("Calling number is null");
+ }
+
+ int ret = Interop.CallManager.DialCall(_handle, number, type, slot);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to dial call, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <summary>
+ /// Swaps the calls.
+ /// </summary>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void SwapCall()
+ {
+ int ret = Interop.CallManager.SwapCall(_handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to swap call, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <summary>
+ /// Joins a call with another.
+ /// </summary>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void JoinCall()
+ {
+ int ret = Interop.CallManager.JoinCall(_handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to join call, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <summary>
+ /// Transfers a call.
+ /// </summary>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void TransferCall()
+ {
+ int ret = Interop.CallManager.TransferCall(_handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to transfer call, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <summary>
+ /// Accepts MT ViLTE call as VoLTE.
+ /// </summary>
+ /// <param name="answerType">Call answer type.</param>
+ /// <param name="type">Call type.</param>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void AnswerCallEx(CallAnswerType answerType, CallType type)
+ {
+ int ret = Interop.CallManager.AnswerCallEx(_handle, answerType, type);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to answer call, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <summary>
+ /// Upgrades a call.
+ /// </summary>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void UpgradeCall()
+ {
+ int ret = Interop.CallManager.UpgradeCall(_handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to upgrade call, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <summary>
+ /// Sets the speaker on/off.
+ /// </summary>
+ /// <param name="status">Status of the speaker to be set.</param>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void ManageSpeaker(FeatureStatus status)
+ {
+ int ret = -1;
+ if (status == FeatureStatus.Off)
+ {
+ ret = Interop.CallManager.SpeakerOff(_handle);
+ }
+
+ else if (status == FeatureStatus.On)
+ {
+ ret = Interop.CallManager.SpeakerOn(_handle);
+ }
+
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to manage speaker, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <summary>
+ /// Sets the bluetooth feature on/off.
+ /// </summary>
+ /// <param name="status">Status of the bluetooth to be set.</param>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void ManageBluetooth(FeatureStatus status)
+ {
+ int ret = -1;
+ if (status == FeatureStatus.Off)
+ {
+ ret = Interop.CallManager.BluetoothOff(_handle);
+ }
+
+ else if (status == FeatureStatus.On)
+ {
+ ret = Interop.CallManager.BluetoothOn(_handle);
+ }
+
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to manage bluetooth, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <summary>
+ /// Starts sending signal through DTMF digit.
+ /// </summary>
+ /// <param name="dtmfDigit">DTMF digit to be pressed on the phone.</param>
+ /// <exception cref="ArgumentException">Thrown when method failed due to invalid parameter.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void StartDtmf(byte dtmfDigit)
+ {
+ int ret = Interop.CallManager.StartDtmf(_handle, dtmfDigit);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to start DTMF, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <summary>
+ /// Sends signal through DTMF digits.
+ /// </summary>
+ /// <param name="dtmfDigits">DTMF digits.</param>
+ /// <exception cref="ArgumentNullException">Thrown when dtmfDigits is passed as null.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void BurstDtmf(string dtmfDigits)
+ {
+ if (dtmfDigits == null)
+ {
+ throw new ArgumentNullException("DTMF digits is null");
+ }
+
+ int ret = Interop.CallManager.BurstDtmf(_handle, dtmfDigits);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to burst DTMF, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <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);
+ }
+ }
+
+ /// <summary>
+ /// Starts voice recording.
+ /// </summary>
+ /// <param name="number">Call number.</param>
+ /// <exception cref="ArgumentNullException">Thrown when number is passed as null.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void StartVoiceRecord(string number)
+ {
+ if (number == null)
+ {
+ throw new ArgumentNullException("Call number is null");
+ }
+
+ int ret = Interop.CallManager.StartVoiceRecord(_handle, number);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to start voice record, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <summary>
+ /// Stops voice record.
+ /// </summary>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void StopVoiceRecord()
+ {
+ int ret = Interop.CallManager.StopVoiceRecord(_handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to stop voice record, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+ }
+
+ /// <summary>
+ /// Gets all current call data.
+ /// </summary>
+ /// <param name="incoming">Incoming calldata instance to be filled.</param>
+ /// <param name="active">Active calldata instance to be filled.</param>
+ /// <param name="held">Held calldata instance to be filled.</param>
+ /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation.</exception>
+ public void GetAllCallData(out CallData incoming, out CallData active, out CallData held)
+ {
+ int ret = Interop.CallManager.GetAllCallData(_handle, out IntPtr incomingCall, out IntPtr activeCall, out IntPtr heldCall);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get all call data, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle);
+ }
+
+ incoming = CmUtility.GetCallData(incomingCall);
+ active = CmUtility.GetCallData(activeCall);
+ held = CmUtility.GetCallData(heldCall);
+ }
+
+ /// <summary>
+ /// Holds 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 HoldCall()
+ {
+ int ret = Interop.CallManager.HoldCall(_handle);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to hold call, Error: " + (CmError)ret);
+ CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.admin");
+ }
+ }
+
+ /// <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");
+ }
+ }
+
+ /// <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");
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Tizen.CallManager
+{
+ /// <summary>
+ /// Enumeration for Call status.
+ /// </summary>
+ public enum CallStatus
+ {
+ /// <summary>
+ /// Call is in idle state.
+ /// </summary>
+ Idle,
+ /// <summary>
+ /// A new call arrived and is ringing or waiting.
+ /// </summary>
+ Ringing,
+ /// <summary>
+ /// At least one call exist that is in dialing, alerting, active, on hold state.
+ /// </summary>
+ OffHook,
+ /// <summary>
+ /// Max state.
+ /// </summary>
+ Max
+ }
+
+ /// <summary>
+ /// Enumeration for Mute status.
+ /// </summary>
+ public enum CallMuteStatus
+ {
+ /// <summary>
+ /// Mute state is off.
+ /// </summary>
+ Off,
+ /// <summary>
+ /// Mute state is on.
+ /// </summary>
+ On,
+ /// <summary>
+ /// Max status.
+ /// </summary>
+ Max
+ }
+
+ /// <summary>
+ /// Enumeration for call dial status.
+ /// </summary>
+ public enum DialStatus
+ {
+ /// <summary>
+ /// Dial status is success.
+ /// </summary>
+ Success = 0,
+ /// <summary>
+ /// Dial status is cancel.
+ /// </summary>
+ Cancel,
+ /// <summary>
+ /// Dial status is fail.
+ /// </summary>
+ Fail,
+ /// <summary>
+ /// Dial status is fail SS.
+ /// </summary>
+ FailSS,
+ /// <summary>
+ /// Dial status is fail FDN.
+ /// </summary>
+ FailFdn,
+ /// <summary>
+ /// Dial status is fail flight mode.
+ /// </summary>
+ FailFlightMode
+ }
+
+ /// <summary>
+ /// Enumeration for DTMF indication type.
+ /// </summary>
+ public enum DtmfIndication
+ {
+ /// <summary>
+ /// DTMF indication type is idle.
+ /// </summary>
+ Idle = 0,
+ /// <summary>
+ /// DTMF indication type is progressing.
+ /// </summary>
+ Progressing,
+ /// <summary>
+ /// DTMF indication type is wait.
+ /// </summary>
+ Wait
+ }
+
+ /// <summary>
+ /// Enumeration for audio state type.
+ /// </summary>
+ public enum AudioState
+ {
+ /// <summary>
+ /// None.
+ /// </summary>
+ None,
+ /// <summary>
+ /// System LoudSpeaker path.
+ /// </summary>
+ Speaker,
+ /// <summary>
+ /// System Receiver.
+ /// </summary>
+ Receiver,
+ /// <summary>
+ /// Earjack path.
+ /// </summary>
+ EarJack,
+ /// <summary>
+ /// System BT Headset path.
+ /// </summary>
+ BTHeadset
+ }
+
+ /// <summary>
+ /// Enumeration for video record status.
+ /// </summary>
+ public enum VrStatus
+ {
+ /// <summary>
+ /// Video recording is started.
+ /// </summary>
+ Started = 0,
+ /// <summary>
+ /// Video recording is stopped.
+ /// </summary>
+ Stopped
+ }
+
+ /// <summary>
+ /// Enumeration for Video record status extra type.
+ /// </summary>
+ public enum VrStatusExtraType
+ {
+ /// <summary>
+ /// Start.
+ /// </summary>
+ Start = 0x00,
+ /// <summary>
+ /// Normal recording.
+ /// </summary>
+ StartNormal,
+ /// <summary>
+ /// Answering message.
+ /// </summary>
+ StartAnswerMessage,
+ /// <summary>
+ /// Start max.
+ /// </summary>
+ StartMax = 0x0f,
+ /// <summary>
+ /// Stop.
+ /// </summary>
+ Stop = 0x10,
+ /// <summary>
+ /// Stop by normal.
+ /// </summary>
+ StopByNormal,
+ /// <summary>
+ /// Stop by max size.
+ /// </summary>
+ StopByMaxSize,
+ /// <summary>
+ /// Stop by no free space.
+ /// </summary>
+ StopByNoFreeSpace,
+ /// <summary>
+ /// Stop by time limit.
+ /// </summary>
+ StopByTimeLimit,
+ /// <summary>
+ /// Error.
+ /// </summary>
+ StopError,
+ /// <summary>
+ /// Stop by max.
+ /// </summary>
+ StopMax = 0x1f
+ }
+
+ /// <summary>
+ /// Enumeration for call type.
+ /// </summary>
+ public enum CallType
+ {
+ /// <summary>
+ /// Voice call type.
+ /// </summary>
+ Voice,
+ /// <summary>
+ /// Video call type.
+ /// </summary>
+ Video,
+ /// <summary>
+ /// Invalid call type.
+ /// </summary>
+ Invalid
+ }
+
+ /// <summary>
+ /// Enumeration for sim slot type.
+ /// </summary>
+ public enum MultiSimSlot
+ {
+ /// <summary>
+ /// Sim slot 1.
+ /// </summary>
+ Slot1,
+ /// <summary>
+ /// Sim slot 2.
+ /// </summary>
+ Slot2,
+ /// <summary>
+ /// Follow system configuration.
+ /// </summary>
+ Default
+ }
+
+ /// <summary>
+ /// Enumeration for call answer types for accepting the incoming call.
+ /// </summary>
+ public enum CallAnswerType
+ {
+ /// <summary>
+ /// Only single call exist, Accept the Incoming call.
+ /// </summary>
+ Normal = 0,
+ /// <summary>
+ /// Put the active call on hold and accepts the call.
+ /// </summary>
+ HoldActiveAndAccept,
+ /// <summary>
+ /// Releases the active call and accept the call.
+ /// </summary>
+ ReleaseActiveAndAccept,
+ /// <summary>
+ /// Releases the held call and accept the call.
+ /// </summary>
+ ReleaseHoldAndAccept,
+ /// <summary>
+ /// Releases all calls and accept the call.
+ /// </summary>
+ ReleaseAllAndAccept
+ }
+
+ /// <summary>
+ /// Enumeration for call upgrade response type while receiving upgrade request.
+ /// </summary>
+ public enum CallUpgradeResponseType
+ {
+ /// <summary>
+ /// Accept incoming upgrade request.
+ /// </summary>
+ Accept,
+ /// <summary>
+ /// Reject Incoming upgrade request.
+ /// </summary>
+ Reject
+ }
+
+ /// <summary>
+ /// Enumeration for feature(speaker/bluetooth) status.
+ /// </summary>
+ public enum FeatureStatus
+ {
+ /// <summary>
+ /// On.
+ /// </summary>
+ On,
+ /// <summary>
+ /// Off.
+ /// </summary>
+ Off
+ }
+
+ /// <summary>
+ /// Enumeration for DTMF response type.
+ /// </summary>
+ public enum DtmfResponseType
+ {
+ /// <summary>
+ /// Cancel.
+ /// </summary>
+ Cancel = 0,
+ /// <summary>
+ /// Continue.
+ /// </summary>
+ Continue
+ }
+
+ /// <summary>
+ /// Enumeration for LCD time out.
+ /// </summary>
+ public enum LcdTimeOut
+ {
+ /// <summary>
+ /// Set.
+ /// </summary>
+ Set = 1,
+ /// <summary>
+ /// Unset.
+ /// </summary>
+ Unset,
+ /// <summary>
+ /// After lock-screen comes in Connected state LCD goes to OFF in 5 secs.
+ /// </summary>
+ LockscreenSet,
+ /// <summary>
+ /// When Keypad is ON, LCD goes to DIM in 3 secs then goes to OFF in 5 secs.
+ /// </summary>
+ KeypadSet,
+ /// <summary>
+ /// Default.
+ /// </summary>
+ Default
+ }
+
+ /// <summary>
+ /// Enumeration for contact name mode.
+ /// </summary>
+ public enum CallNameMode
+ {
+ /// <summary>
+ /// None.
+ /// </summary>
+ None,
+ /// <summary>
+ /// Unknown.
+ /// </summary>
+ Unknown,
+ /// <summary>
+ /// Private.
+ /// </summary>
+ Private,
+ /// <summary>
+ /// Payphone.
+ /// </summary>
+ PayPhone
+ }
+
+ /// <summary>
+ /// Enumeration for LCD control state.
+ /// </summary>
+ public enum LcdControlState
+ {
+ /// <summary>
+ /// Off.
+ /// </summary>
+ Off = 1,
+ /// <summary>
+ /// On.
+ /// </summary>
+ On,
+ /// <summary>
+ /// On lock.
+ /// </summary>
+ OnLock,
+ /// <summary>
+ /// On unlock.
+ /// </summary>
+ OnUnlock,
+ /// <summary>
+ /// Off sleep lock.
+ /// </summary>
+ OffSleepLock,
+ /// <summary>
+ /// Off sleep unlock.
+ /// </summary>
+ OffSleepUnlock
+ }
+
+ /// <summary>
+ /// Enumeration for call event type.
+ /// </summary>
+ public enum CallEvent
+ {
+ /// <summary>
+ /// Call Idle event.
+ /// </summary>
+ Idle = 0,
+ /// <summary>
+ /// Call Dialling event.
+ /// </summary>
+ Dialing,
+ /// <summary>
+ /// Call Active event.
+ /// </summary>
+ Active,
+ /// <summary>
+ /// Call Held event.
+ /// </summary>
+ Held,
+ /// <summary>
+ /// Call Alert event.
+ /// </summary>
+ Alert,
+ /// <summary>
+ /// Call Incoming event.
+ /// </summary>
+ Incoming,
+ /// <summary>
+ /// Call Waiting event.
+ /// </summary>
+ Waiting,
+ /// <summary>
+ /// Call Join event.
+ /// </summary>
+ Join,
+ /// <summary>
+ /// Call Split event.
+ /// </summary>
+ Split,
+ /// <summary>
+ /// Call Swapped event.
+ /// </summary>
+ Swapped,
+ /// <summary>
+ /// Call Retrieved event.
+ /// </summary>
+ Retrieved,
+ /// <summary>
+ /// Sat call control event.
+ /// </summary>
+ SatCallControl,
+ /// <summary>
+ /// Call upgrade request event.
+ /// </summary>
+ UpgradeRequest,
+ /// <summary>
+ /// Call downgraded event.
+ /// </summary>
+ Downgraded,
+ /// <summary>
+ /// Call upgrade success event.
+ /// </summary>
+ UpgradeSuccess,
+ /// <summary>
+ /// Call upgrade failure event.
+ /// </summary>
+ UpgradeFailure,
+ /// <summary>
+ /// Call downgrade success event.
+ /// </summary>
+ DowngradeSuccess,
+ /// <summary>
+ /// Call downgrade failure event.
+ /// </summary>
+ DowngradeFailure,
+ /// <summary>
+ /// Call confirm upgrade success event.
+ /// </summary>
+ ConfirmUpgradeSuccess,
+ /// <summary>
+ /// Call confirm upgrade failure event.
+ /// </summary>
+ ConfirmUpgradeFailure,
+ /// <summary>
+ /// VoWiFi ~ LTE hand-over update event.
+ /// </summary>
+ VoWiFiLteHandoverUpdate
+ }
+
+ /// <summary>
+ /// Enumeration for call direction
+ /// </summary>
+ public enum CallDirection
+ {
+ /// <summary>
+ /// MO call.
+ /// </summary>
+ MO,
+ /// <summary>
+ /// MT call.
+ /// </summary>
+ MT
+ }
+
+ /// <summary>
+ /// Enumeration for the call state.
+ /// </summary>
+ public enum CallState
+ {
+ /// <summary>
+ /// Call is in idle state.
+ /// </summary>
+ Idle,
+ /// <summary>
+ /// Call is in connected and conversation state.
+ /// </summary>
+ Active,
+ /// <summary>
+ /// Call is in held state.
+ /// </summary>
+ Held,
+ /// <summary>
+ /// Call is in dialing state.
+ /// </summary>
+ Dialing,
+ /// <summary>
+ /// Call is in alerting state.
+ /// </summary>
+ Alert,
+ /// <summary>
+ /// Call is in incoming state.
+ /// </summary>
+ Incoming,
+ /// <summary>
+ /// Call is in answered state, and waiting for connected indication event.
+ /// </summary>
+ Waiting
+ }
+
+ /// <summary>
+ /// Enumeration for call domain.
+ /// </summary>
+ public enum CallDomain
+ {
+ /// <summary>
+ /// CS call domain.
+ /// </summary>
+ Cs,
+ /// <summary>
+ /// PS call domain.
+ /// </summary>
+ Ps,
+ /// <summary>
+ /// Wearable call through BT handsfree profile.
+ /// </summary>
+ Hfp
+ }
+
+ /// <summary>
+ /// Enumeration for call end cause type.
+ /// </summary>
+ public enum CallEndCause
+ {
+ /// <summary>
+ /// Call ended.
+ /// </summary>
+ Ended,
+ /// <summary>
+ /// Call disconnected.
+ /// </summary>
+ Disconnected,
+ /// <summary>
+ /// Service not allowed.
+ /// </summary>
+ ServiceNotAllowed,
+ /// <summary>
+ /// Call barred.
+ /// </summary>
+ Barred,
+ /// <summary>
+ /// No service.
+ /// </summary>
+ NoService,
+ /// <summary>
+ /// Network busy.
+ /// </summary>
+ NwBusy,
+ /// <summary>
+ /// Network failed.
+ /// </summary>
+ NwFailed,
+ /// <summary>
+ /// No answer from other party.
+ /// </summary>
+ NoAnswer,
+ /// <summary>
+ /// No credit available.
+ /// </summary>
+ NoCredit,
+ /// <summary>
+ /// Call rejected.
+ /// </summary>
+ Rejected,
+ /// <summary>
+ /// User busy.
+ /// </summary>
+ UserBusy,
+ /// <summary>
+ /// Wrong group.
+ /// </summary>
+ WrongGroup,
+ /// <summary>
+ /// Call not allowed.
+ /// </summary>
+ NotAllowed,
+ /// <summary>
+ /// Tapi error.
+ /// </summary>
+ TapiError,
+ /// <summary>
+ /// Call failed.
+ /// </summary>
+ Failed,
+ /// <summary>
+ /// User not responding.
+ /// </summary>
+ NoUserResponding,
+ /// <summary>
+ /// User alerting no answer.
+ /// </summary>
+ UserAlertingNoAnswer,
+ /// <summary>
+ /// Circuit Channel Unavailable,Network is out of Order,Switching equipment congestion,Temporary Failure.
+ /// </summary>
+ ServiceTempUnavailable,
+ /// <summary>
+ /// Called Party Rejects the Call.
+ /// </summary>
+ UserUnavailable,
+ /// <summary>
+ /// Entered number is invalid or incomplete.
+ /// </summary>
+ InvalidNumberFormat,
+ /// <summary>
+ /// Entered number has been changed.
+ /// </summary>
+ NumberChanged,
+ /// <summary>
+ /// Unassigned/Unallocated number.
+ /// </summary>
+ UnassignedNumber,
+ /// <summary>
+ /// Called Party does not respond.
+ /// </summary>
+ UserDoesNotRespond,
+ /// <summary>
+ /// IMEI rejected.
+ /// </summary>
+ ImeiRejected,
+ /// <summary>
+ /// FDN number only.
+ /// </summary>
+ FixedDialingNumberOnly,
+ /// <summary>
+ /// SAT call control reject.
+ /// </summary>
+ SatCallControlReject,
+ /// <summary>
+ /// This number cannot receive video calls.
+ /// </summary>
+ CannotReceiveVideoCall
+ }
+
+ /// <summary>
+ /// Enumeration for call release type.
+ /// </summary>
+ public enum CallReleaseType
+ {
+ /// <summary>
+ /// Release call using given call handle.
+ /// </summary>
+ ByCallHandle = 0,
+ /// <summary>
+ /// Release all Calls.
+ /// </summary>
+ AllCalls,
+ /// <summary>
+ /// Releases all hold calls.
+ /// </summary>
+ AllHoldCalls,
+ /// <summary>
+ /// Releases all active calls.
+ /// </summary>
+ AllActiveCalls
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.CallManager
+{
+ /// <summary>
+ /// An extended EventArgs class which contains information about DTMF indication.
+ /// </summary>
+ public class DtmfIndicationEventArgs : EventArgs
+ {
+ private DtmfIndication _indication;
+ private string _dtmfNumber;
+
+ internal DtmfIndicationEventArgs(DtmfIndication indication, string dtmfNumber)
+ {
+ _indication = indication;
+ _dtmfNumber = dtmfNumber;
+ }
+
+ /// <summary>
+ /// DTMF indication.
+ /// </summary>
+ public DtmfIndication Indication
+ {
+ get
+ {
+ return _indication;
+ }
+ }
+
+ /// <summary>
+ /// DTMF number.
+ /// </summary>
+ public string DtmfNumber
+ {
+ get
+ {
+ return _dtmfNumber;
+ }
+ }
+ }
+
+ /// <summary>
+ /// An extended EventArgs class which contains changed audio status.
+ /// </summary>
+ public class AudioStatusChangedEventArgs : EventArgs
+ {
+ private AudioState _state;
+
+ internal AudioStatusChangedEventArgs(AudioState state)
+ {
+ _state = state;
+ }
+
+ /// <summary>
+ /// Audio state.
+ /// </summary>
+ public AudioState State
+ {
+ get
+ {
+ return _state;
+ }
+ }
+ }
+
+ /// <summary>
+ /// An extended EventArgs class which contains changed voice record status.
+ /// </summary>
+ public class VoiceRecordStatusEventArgs : EventArgs
+ {
+ private VrStatus _status;
+ private VrStatusExtraType _extraType;
+
+ internal VoiceRecordStatusEventArgs(VrStatus status, VrStatusExtraType extraType)
+ {
+ _status = status;
+ _extraType = extraType;
+ }
+
+ /// <summary>
+ /// Voice record status.
+ /// </summary>
+ public VrStatus Status
+ {
+ get
+ {
+ return _status;
+ }
+ }
+
+ /// <summary>
+ /// Voice record status extra type.
+ /// </summary>
+ public VrStatusExtraType ExtraType
+ {
+ get
+ {
+ return _extraType;
+ }
+ }
+ }
+
+ /// <summary>
+ /// An extended EventArgs class which contains changed call mute status.
+ /// </summary>
+ public class CallMuteStatusChangedEventArgs : EventArgs
+ {
+ private CallMuteStatus _Status;
+
+ internal CallMuteStatusChangedEventArgs(CallMuteStatus status)
+ {
+ _Status = status;
+ }
+
+ /// <summary>
+ /// Call mute status.
+ /// </summary>
+ public CallMuteStatus Status
+ {
+ get
+ {
+ return _Status;
+ }
+ }
+ }
+
+ /// <summary>
+ /// An extended EventArgs class which contains changed call status.
+ /// </summary>
+ public class CallStatusChangedEventArgs : EventArgs
+ {
+ private CallStatus _status;
+ private string _callNumber;
+
+ internal CallStatusChangedEventArgs(CallStatus status, string number)
+ {
+ _status = status;
+ _callNumber = number;
+ }
+
+ /// <summary>
+ /// Call status.
+ /// </summary>
+ public CallStatus Status
+ {
+ get
+ {
+ return _status;
+ }
+ }
+
+ /// <summary>
+ /// Call number.
+ /// </summary>
+ public string CallNumber
+ {
+ get
+ {
+ return _callNumber;
+ }
+ }
+ }
+
+ /// <summary>
+ /// An extended EventArgs class which contains changed dial status.
+ /// </summary>
+ public class DialStatusEventArgs : EventArgs
+ {
+ private DialStatus _status;
+
+ internal DialStatusEventArgs(DialStatus status)
+ {
+ _status = status;
+ }
+
+ /// <summary>
+ /// Dial status.
+ /// </summary>
+ public DialStatus Status
+ {
+ get
+ {
+ return _status;
+ }
+ }
+ }
+
+ /// <summary>
+ /// An extended EventArgs class which contains changed call event.
+ /// </summary>
+ public class CallEventEventArgs : EventArgs
+ {
+ private CallEvent _event;
+ private CallEventData _eventData;
+
+ internal CallEventEventArgs(CallEvent callEvent, CallEventData data)
+ {
+ _event = callEvent;
+ _eventData = data;
+ }
+
+ /// <summary>
+ /// Call event.
+ /// </summary>
+ public CallEvent Event
+ {
+ get
+ {
+ return _event;
+ }
+ }
+
+ /// <summary>
+ /// Call event data.
+ /// </summary>
+ public CallEventData EventData
+ {
+ get
+ {
+ return _eventData;
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.CallManager
+{
+ internal enum CmError
+ {
+ None = ErrorCode.None,
+ OutOfMemory = ErrorCode.OutOfMemory,
+ InvalidParameter = ErrorCode.InvalidParameter,
+ PermissionDenied = ErrorCode.PermissionDenied,
+ NotSupported = ErrorCode.NotSupported,
+ NotRegistered = -0x00000000 | 0x01,
+ AlreadyRegistered = -0x00000000 | 0x02,
+ OperationFailed = -0x00000000 | 0x03,
+ InvalidState = -0x00000000 | 0x04
+ }
+
+ internal static class CmUtility
+ {
+ internal const string LogTag = "Tizen.CallManager";
+
+ internal static CallData GetCallData(IntPtr handle)
+ {
+ CallData data = new CallData();
+ int ret = Interop.CallManager.GetCallId(handle, out uint id);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get call ID from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.CallId = id;
+ }
+
+ ret = Interop.CallManager.GetCallDirection(handle, out CallDirection direction);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get call direction from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.CallDirection = direction;
+ }
+
+ ret = Interop.CallManager.GetCallNumber(handle, out string number);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get call number from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.Number = number;
+ }
+
+ ret = Interop.CallManager.GetCallingName(handle, out string name);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get calling name from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.Name = name;
+ }
+
+ ret = Interop.CallManager.GetCallType(handle, out CallType type);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get call type from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.CallType = type;
+ }
+
+ ret = Interop.CallManager.GetCallState(handle, out CallState state);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get call state from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.CallState = state;
+ }
+
+ ret = Interop.CallManager.GetCallMemberCount(handle, out int count);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get call member count from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.Count = count;
+ }
+
+ ret = Interop.CallManager.IsEmergencyCall(handle, out bool isEmergency);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to check if the call is emergency from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.IsEcc = isEmergency;
+ }
+
+ ret = Interop.CallManager.IsVoiceMailNumber(handle, out bool isVoiceMail);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to check if the number is voicemail number from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.IsVoiceMail = isVoiceMail;
+ }
+
+ ret = Interop.CallManager.GetCallDomain(handle, out CallDomain domain);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get call domain from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.CallDomain = domain;
+ }
+
+ ret = Interop.CallManager.GetPersonId(handle, out int personId);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get person ID from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.PersonIndex = personId;
+ }
+
+ ret = Interop.CallManager.GetStartTime(handle, out long startTime);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get start time from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.CallStartTime = startTime;
+ }
+
+ ret = Interop.CallManager.GetNameMode(handle, out CallNameMode nameMode);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get name mode from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.CallNameMode = nameMode;
+ }
+
+ ret = Interop.CallManager.GetSessionId(handle, out int sessionId);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get session ID from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.SessionIdIms = sessionId;
+ }
+
+ ret = Interop.CallManager.GetHdIconState(handle, out int isHdEnable);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get HD icon state from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.IsHdEnableIms = (isHdEnable == 1) ? true : false;
+ }
+
+ ret = Interop.CallManager.IsWiFiCalling(handle, out int isWiFiCalling);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to identify WiFi calling from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.IsWiFiCall = (isWiFiCalling == 1) ? true : false;
+ }
+
+ ret = Interop.CallManager.GetUpgradeDowngradeState(handle, out int isEnable);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get updagrade downgrade state from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.IsUpgradeDowngrade = (isEnable == 1) ? true : false;
+ }
+
+ ret = Interop.CallManager.IsRemoteOnHold(handle, out int isHold);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get remote on hold state from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.IsRemoteHold = (isHold == 1) ? true : false;
+ }
+
+ ret = Interop.CallManager.IsAddedToConference(handle, out int isAdded);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to check if the call is in conf state from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.IsAddedToConf = (isAdded == 1) ? true : false;
+ }
+
+ ret = Interop.CallManager.IsForwardedCall(handle, out bool isForwarded);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to check if the call is forwarded call from call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ data.IsForwardedCall = isForwarded;
+ }
+
+ return data;
+ }
+
+ internal static ConferenceCallData GetConfCallData(IntPtr handle)
+ {
+ ConferenceCallData confData = new ConferenceCallData();
+ int ret = Interop.CallManager.GetConfCallId(handle, out uint callId);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get conf call ID, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ confData.CallId = callId;
+ }
+
+ ret = Interop.CallManager.GetConfCallNumber(handle, out string number);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get conf call number, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ confData.Number = number;
+ }
+
+ ret = Interop.CallManager.GetConfCallPersonId(handle, out int personId);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get conf call person ID, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ confData.PersonIndex = personId;
+ }
+
+ ret = Interop.CallManager.GetConfCallNameMode(handle, out CallNameMode nameMode);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get conf call name mode, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ confData.NameMode = nameMode;
+ }
+
+ return confData;
+ }
+
+ internal static CallEventData GetCallEventData(IntPtr handle)
+ {
+ CallEventData eventData = new CallEventData();
+ int ret = Interop.CallManager.GetEventDataCallId(handle, out uint id);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get event data call ID, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ eventData.EventId = id;
+ }
+
+ ret = Interop.CallManager.GetSimSlot(handle, out MultiSimSlot simSlot);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get event data sim slot, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ eventData.Slot = simSlot;
+ }
+
+ ret = Interop.CallManager.GetEndCause(handle, out CallEndCause endCause);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get end cause, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ eventData.Cause = endCause;
+ }
+
+ ret = Interop.CallManager.GetIncomingCallData(handle, out IntPtr incoming);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get incoming call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ eventData.Incoming = GetCallData(incoming);
+ }
+
+ ret = Interop.CallManager.GetActiveCall(handle, out IntPtr active);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get active call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ eventData.Active = GetCallData(active);
+ }
+
+ ret = Interop.CallManager.GetHeldCall(handle, out IntPtr held);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get held call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ eventData.Held = GetCallData(held);
+ }
+
+ return eventData;
+ }
+
+ internal static void ThrowCmException(int exception)
+ {
+ _throwException(exception, false, "");
+ }
+
+ internal static void ThrowCmException(int exception, IntPtr handle)
+ {
+ _throwException(exception, (handle == IntPtr.Zero), "");
+ }
+
+ internal static void ThrowCmException(int exception, IntPtr handle, string message)
+ {
+ _throwException(exception, (handle == IntPtr.Zero), message);
+ }
+
+ private static void _throwException(int exception, bool isHandleNull, string message)
+ {
+ CmError _error = (CmError)exception;
+ switch(_error)
+ {
+ case CmError.NotSupported:
+ throw new NotSupportedException("Unsupported feature: http://tizen.org/feature/network.telephony");
+ case CmError.PermissionDenied:
+ throw new UnauthorizedAccessException("Permission denied: " + message);
+ case CmError.OutOfMemory:
+ throw new OutOfMemoryException("System out of memory");
+ case CmError.InvalidParameter:
+ if (isHandleNull)
+ {
+ throw new InvalidOperationException("Invalid instance (object may have been disposed or released)");
+ }
+
+ throw new ArgumentException("Invalid parameter");
+ default:
+ throw new InvalidOperationException(_error.ToString());
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.CallManager
+{
+ /// <summary>
+ /// A class which defines the properties of conference call.
+ /// </summary>
+ public class ConferenceCallData
+ {
+ internal uint CallId;
+ internal string Number;
+ internal int PersonIndex;
+ internal CallNameMode NameMode;
+ internal ConferenceCallData()
+ {
+ }
+
+ /// <summary>
+ /// Conference call ID.
+ /// </summary>
+ public uint Id
+ {
+ get
+ {
+ return CallId;
+ }
+ }
+
+ /// <summary>
+ /// Call number.
+ /// </summary>
+ public string CallNumber
+ {
+ get
+ {
+ return Number;
+ }
+ }
+
+ /// <summary>
+ /// Person ID.
+ /// </summary>
+ public int PersonId
+ {
+ get
+ {
+ return PersonIndex;
+ }
+ }
+
+ /// <summary>
+ /// Call name mode.
+ /// </summary>
+ public CallNameMode Mode
+ {
+ get
+ {
+ return NameMode;
+ }
+ }
+ }
+}