chenqiyang
2021-09-01 8fb1bc18bad99b2de79783848b41d07da01315a7
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;