From 8fb1bc18bad99b2de79783848b41d07da01315a7 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期三, 01 九月 2021 17:04:05 +0800 Subject: [PATCH] 采用纯oc sdk解决版本适配问题;解决呼叫不能截屏问题 --- HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneManager.m | 28 +++++++++++++++++++++++++--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneManager.m b/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneManager.m index 29fdda0..1008e5f 100644 --- a/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneManager.m +++ b/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneManager.m @@ -390,7 +390,7 @@ linphone_core_add_callbacks(theLinphoneCore, cbs); [HDLCallManager.instance setCoreWithCore:theLinphoneCore]; - [HDLCoreManager.instance setCoreWithCore:theLinphoneCore]; +// [HDLCoreManager.instance setCoreWithCore:theLinphoneCore]; [HDLConfigManager.instance setDbWithDb:_configDb]; linphone_core_start(theLinphoneCore); @@ -826,8 +826,28 @@ } -(void)endCall{ - LinphoneCall * call = linphone_core_get_current_call(theLinphoneCore); - [HDLCallManager.instance terminateCallWithCall:call]; +// LinphoneCall * call = linphone_core_get_current_call(theLinphoneCore); +// [HDLCallManager.instance terminateCallWithCall:call]; + // + + LinphoneCall *currentcall = linphone_core_get_current_call(theLinphoneCore); + + if (linphone_core_is_in_conference(theLinphoneCore) || // In conference + + (linphone_core_get_conference_size(theLinphoneCore) > 0 ) // Only one conf + ) { +// NSLog(@"鏄細璁�"); + linphone_core_terminate_conference(theLinphoneCore); + } else if (currentcall != NULL) { + linphone_call_terminate(currentcall); + + } else { +// NSLog(@"鍏跺畠鎯呭喌"); + const MSList *calls = linphone_core_get_calls(theLinphoneCore); + if (bctbx_list_size(calls) == 1) { // Only one call + linphone_call_terminate((LinphoneCall *)(calls->data)); + } + } } -(void)acceptCall{ // [HDLCallManager configAudioSessionWithAudioSession:[AVAudioSession sharedInstance]]; @@ -889,6 +909,7 @@ return; } // For OutgoingCall, show CallOutgoingView + [HDLCallManager.instance startCallWithAddr:iaddr isSas:FALSE]; } @@ -979,6 +1000,7 @@ linphone_core_set_video_preset([HDLLinphoneManager getLc], [@"custom" UTF8String]); linphone_core_set_preferred_framerate([HDLLinphoneManager getLc], 5); + // LinphoneVideoPolicy policy; // policy.automatically_initiate = YES; // policy.automatically_accept = YES; -- Gitblit v1.8.0