JLChen
2021-08-28 27e9f729fa9532ebc22afea84aa80434b8765fa5
HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/HDLLinphoneKit.java
@@ -381,8 +381,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) {
@@ -415,6 +417,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();
@@ -430,6 +433,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();
@@ -557,14 +561,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);
        }
    }
    /**