Revert to no media encryption as default but force ZRTP when doing calls for chat room security purposes
This commit is contained in:
parent
20d84f40fd
commit
7a93660d12
4 changed files with 21 additions and 8 deletions
|
@ -25,6 +25,7 @@ import org.linphone.core.Address;
|
||||||
import org.linphone.core.Call;
|
import org.linphone.core.Call;
|
||||||
import org.linphone.core.CallParams;
|
import org.linphone.core.CallParams;
|
||||||
import org.linphone.core.Core;
|
import org.linphone.core.Core;
|
||||||
|
import org.linphone.core.MediaEncryption;
|
||||||
import org.linphone.core.tools.Log;
|
import org.linphone.core.tools.Log;
|
||||||
import org.linphone.utils.FileUtils;
|
import org.linphone.utils.FileUtils;
|
||||||
import org.linphone.utils.LinphoneUtils;
|
import org.linphone.utils.LinphoneUtils;
|
||||||
|
@ -45,15 +46,19 @@ public class CallManager {
|
||||||
return BandwidthManager.getInstance();
|
return BandwidthManager.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void inviteAddress(Address lAddress) {
|
public void inviteAddress(Address lAddress, boolean forceZRTP) {
|
||||||
boolean isLowBandwidthConnection =
|
boolean isLowBandwidthConnection =
|
||||||
!LinphoneUtils.isHighBandwidthConnection(
|
!LinphoneUtils.isHighBandwidthConnection(
|
||||||
LinphoneService.instance().getApplicationContext());
|
LinphoneService.instance().getApplicationContext());
|
||||||
|
|
||||||
inviteAddress(lAddress, false, isLowBandwidthConnection);
|
inviteAddress(lAddress, false, isLowBandwidthConnection, forceZRTP);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void inviteAddress(Address lAddress, boolean videoEnabled, boolean lowBandwidth) {
|
public void inviteAddress(Address lAddress) {
|
||||||
|
inviteAddress(lAddress, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void inviteAddress(Address lAddress, boolean videoEnabled, boolean lowBandwidth, boolean forceZRTP) {
|
||||||
Core lc = LinphoneManager.getLc();
|
Core lc = LinphoneManager.getLc();
|
||||||
|
|
||||||
CallParams params = lc.createCallParams(null);
|
CallParams params = lc.createCallParams(null);
|
||||||
|
@ -70,6 +75,10 @@ public class CallManager {
|
||||||
Log.d("Low bandwidth enabled in call params");
|
Log.d("Low bandwidth enabled in call params");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (forceZRTP) {
|
||||||
|
params.setMediaEncryption(MediaEncryption.ZRTP);
|
||||||
|
}
|
||||||
|
|
||||||
String recordFile =
|
String recordFile =
|
||||||
FileUtils.getCallRecordingFilename(
|
FileUtils.getCallRecordingFilename(
|
||||||
LinphoneManager.getInstance().getContext(), lAddress);
|
LinphoneManager.getInstance().getContext(), lAddress);
|
||||||
|
@ -78,6 +87,10 @@ public class CallManager {
|
||||||
lc.inviteAddressWithParams(lAddress, params);
|
lc.inviteAddressWithParams(lAddress, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void inviteAddress(Address lAddress, boolean videoEnabled, boolean lowBandwidth) {
|
||||||
|
inviteAddress(lAddress, videoEnabled, lowBandwidth, false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add video to a currently running voice only call. No re-invite is sent if the current call is
|
* Add video to a currently running voice only call. No re-invite is sent if the current call is
|
||||||
* already video or if the bandwidth settings are too low.
|
* already video or if the bandwidth settings are too low.
|
||||||
|
|
|
@ -173,7 +173,7 @@ public class ChatMessagesFragment extends Fragment
|
||||||
if (oneParticipantOneDevice) {
|
if (oneParticipantOneDevice) {
|
||||||
ParticipantDevice device =
|
ParticipantDevice device =
|
||||||
mChatRoom.getParticipants()[0].getDevices()[0];
|
mChatRoom.getParticipants()[0].getDevices()[0];
|
||||||
CallManager.getInstance().inviteAddress(device.getAddress());
|
CallManager.getInstance().inviteAddress(device.getAddress(), true);
|
||||||
} else {
|
} else {
|
||||||
LinphoneActivity.instance()
|
LinphoneActivity.instance()
|
||||||
.goToContactDevicesInfos(mLocalSipUri, mRemoteSipUri);
|
.goToContactDevicesInfos(mLocalSipUri, mRemoteSipUri);
|
||||||
|
@ -893,7 +893,7 @@ public class ChatMessagesFragment extends Fragment
|
||||||
if (oneParticipantOneDevice) {
|
if (oneParticipantOneDevice) {
|
||||||
ParticipantDevice device =
|
ParticipantDevice device =
|
||||||
mChatRoom.getParticipants()[0].getDevices()[0];
|
mChatRoom.getParticipants()[0].getDevices()[0];
|
||||||
CallManager.getInstance().inviteAddress(device.getAddress());
|
CallManager.getInstance().inviteAddress(device.getAddress(), true);
|
||||||
} else {
|
} else {
|
||||||
LinphoneActivity.instance()
|
LinphoneActivity.instance()
|
||||||
.goToContactDevicesInfos(mLocalSipUri, mRemoteSipUri);
|
.goToContactDevicesInfos(mLocalSipUri, mRemoteSipUri);
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class DevicesFragment extends Fragment {
|
||||||
long l) {
|
long l) {
|
||||||
ParticipantDevice device =
|
ParticipantDevice device =
|
||||||
(ParticipantDevice) mAdapter.getChild(groupPosition, childPosition);
|
(ParticipantDevice) mAdapter.getChild(groupPosition, childPosition);
|
||||||
CallManager.getInstance().inviteAddress(device.getAddress());
|
CallManager.getInstance().inviteAddress(device.getAddress(), true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -101,7 +101,7 @@ public class DevicesFragment extends Fragment {
|
||||||
// in this case groups are childs, so call on click
|
// in this case groups are childs, so call on click
|
||||||
ParticipantDevice device =
|
ParticipantDevice device =
|
||||||
(ParticipantDevice) mAdapter.getGroup(groupPosition);
|
(ParticipantDevice) mAdapter.getGroup(groupPosition);
|
||||||
CallManager.getInstance().inviteAddress(device.getAddress());
|
CallManager.getInstance().inviteAddress(device.getAddress(), true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -6,7 +6,7 @@ keepalive_period=30000
|
||||||
sip_port=-1
|
sip_port=-1
|
||||||
sip_tcp_port=-1
|
sip_tcp_port=-1
|
||||||
sip_tls_port=-1
|
sip_tls_port=-1
|
||||||
media_encryption=zrtp
|
media_encryption=none
|
||||||
|
|
||||||
[video]
|
[video]
|
||||||
size=vga
|
size=vga
|
||||||
|
|
Loading…
Reference in a new issue