JLChen
2021-09-01 daca4f973aeda5b816f0160eb121c5f3c7a6e66c
HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/HDLLinphoneKit.java
@@ -143,14 +143,12 @@
                super.callConnected();
                // 视频通话默认免提,语音通话默认非免提
                toggleSpeaker(true);
                // 所有通话默认非静音
                toggleMicro(false);
            }
            @Override
            public void callEnd() {
                super.callEnd();
                context.sendBroadcast(new Intent(HDLLinphoneIntercomActivity.RECEIVE_FINISH_VIDEO_ACTIVITY));
//                context.sendBroadcast(new Intent(HDLLinphoneIntercomActivity.RECEIVE_FINISH_VIDEO_ACTIVITY));
            }
        });
@@ -275,9 +273,6 @@
                        config.done();
                    }
                }
                core.clearAllAuthInfo();//清除所有认证信息。
//                core.clearProxyConfig();//从配置中删除所有代理。注意:目前不能直接删所有代理,因为服务器上还是标记已注册
            }
        } catch (Exception e) {
            e.printStackTrace();
@@ -290,6 +285,7 @@
    public void clearProxyConfig(){
        Core core = HDLLinphoneService.getCore();
        if (core != null) {
            core.setDefaultProxyConfig(null);
            core.clearAllAuthInfo();//清除所有认证信息。
            core.clearProxyConfig();//从配置中删除所有代理。
        }
@@ -383,8 +379,10 @@
            if (isVideoCall) {
                params.enableVideo(true);
                params.enableLowBandwidth(false);
                params.setAudioBandwidthLimit(0); // disable limitation
            } else {
                params.enableVideo(false);
                params.setAudioBandwidthLimit(40); // disable limitation
            }
            if (addressToCall != null) {
@@ -417,6 +415,7 @@
            Call currentCall = HDLLinphoneService.getCore().getCurrentCall();
            CallParams params = HDLLinphoneService.getCore().createCallParams(currentCall);
            params.enableVideo(true);
            params.setAudioBandwidthLimit(0); // disable limitation
            currentCall.acceptWithParams(params);
        } catch (Exception e) {
            e.printStackTrace();
@@ -432,6 +431,7 @@
            Call currentCall = HDLLinphoneService.getCore().getCurrentCall();
            CallParams params = HDLLinphoneService.getCore().createCallParams(currentCall);
            params.enableVideo(enableVideo);
            params.setAudioBandwidthLimit(enableVideo ? 0 : 40);
            currentCall.acceptWithParams(params);
        } catch (Exception e) {
            e.printStackTrace();
@@ -559,14 +559,22 @@
     * 获取当前通话状态
     */
    public Call.State getCallState() {
        return HDLLinphoneService.getInstance().getCurrentCallState();
        if(HDLLinphoneService.getInstance() == null) {
            return null;
        }else {
            return HDLLinphoneService.getInstance().getCurrentCallState();
        }
    }
    /**
     * 获取当前通话状态是否为来电中
     */
    public boolean isIncomingReceivedCallState() {
        return HDLLinphoneService.getInstance().getCurrentCallState() == Call.State.IncomingReceived;
        if(HDLLinphoneService.getInstance() == null || HDLLinphoneService.getInstance().getCurrentCallState() == null){
            return false;
        }else{
            return (HDLLinphoneService.getInstance().getCurrentCallState() == Call.State.IncomingReceived);
        }
    }
    /**