| | |
| | | super.callConnected(); |
| | | // 视频通话默认免提,语音通话默认非免提 |
| | | toggleSpeaker(true); |
| | | // 所有通话默认非静音 |
| | | toggleMicro(false); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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) { |
| | |
| | | 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(); |
| | |
| | | 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(); |
| | |
| | | * 获取当前通话状态 |
| | | */ |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | /** |