Skip to content

Commit

Permalink
Merge branch 'master' into ognjen_issue769
Browse files Browse the repository at this point in the history
* master:
  PR changes.
  Working on: #748 PR Changes

# Conflicts:
#	restcomm.android.sdk/src/main/java/org/restcomm/android/sdk/fcm/FcmConfigurationClient.java
  • Loading branch information
Ognjen Manevski committed Dec 18, 2017
2 parents a503b33 + a876e6a commit ed98df2
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,7 @@ public void onServiceConnected(ComponentName className, IBinder service)
params.put(RCDevice.ParameterKeys.MEDIA_ICE_SERVERS, iceServers);
*/

//we have isse with the signaling on Oreo device, while we looking for solution, set to false
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
params.put(RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED, false);
} else {
params.put(RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED, prefs.getBoolean(RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED, true));
}

params.put(RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED, prefs.getBoolean(RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED, true));


// The SDK provides the user with default sounds for calling, ringing, busy (declined) and message, but the user can override them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<EditTextPreference
android:defaultValue="cloud.restcomm.com"
android:key="push-http-domain"
android:title="Http Domain"
android:title="Restcomm Connect Domain"
android:summary="Restcomm Http domain, like: 'cloud.restcomm.com'"/>
</PreferenceCategory>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ private void startTurn()
turnEnabled = true;
}

RCDevice.MediaIceServersDiscoveryType iceServerDiscoveryType = (RCDevice.MediaIceServersDiscoveryType)deviceParameters.get(RCDevice.ParameterKeys.MEDIA_ICE_SERVERS_DISCOVERY_TYPE);
RCDevice.MediaIceServersDiscoveryType iceServerDiscoveryType = RCDevice.MediaIceServersDiscoveryType.values()[(int)deviceParameters.get(RCDevice.ParameterKeys.MEDIA_ICE_SERVERS_DISCOVERY_TYPE)];
if (iceServerDiscoveryType == RCDevice.MediaIceServersDiscoveryType.ICE_SERVERS_CONFIGURATION_URL_XIRSYS_V2) {
url = deviceParameters.get(RCDevice.ParameterKeys.MEDIA_ICE_URL) +
"?ident=" + deviceParameters.get(RCDevice.ParameterKeys.MEDIA_ICE_USERNAME) +
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ public void open(String jobId, Context androidContext, HashMap<String, Object> c

Properties properties = new Properties();
properties.setProperty("android.javax.sip.STACK_NAME", "androidSip");
properties.setProperty("android.gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", "android.gov.nist.javax.sip.stack.NioMessageProcessorFactory");

//we have issue with the signaling on Oreo device
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O) {
properties.setProperty("android.gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", "android.gov.nist.javax.sip.stack.NioMessageProcessorFactory");
}

// DNS SRV
// Important: for jain-sip.ext especially, we need to drop the 'android' part
properties.setProperty("javax.sip.ROUTER_PATH", DNSAwareRouter.class.getCanonicalName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*/
public class FcmConfigurationClient {

private static final String TAG = FcmConfigurationClient.class.getCanonicalName();
private static final String TAG = "FcmConfigurationClient";

private static final String ACCOUNT_SID_URL = "/restcomm/2012-04-24/Accounts.json";
private static final String CLIENT_SID_URL = "/restcomm/2012-04-24/Accounts";
Expand Down Expand Up @@ -123,7 +123,6 @@ public String getAccountSid(){
connection.disconnect();
}
}

RCLogger.v(TAG, "getAccountSid method ended; returning account sid: " + accountSid);
return accountSid;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

public class FcmConfigurationHandler {

private static final String TAG = FcmConfigurationHandler.class.getCanonicalName();
private static final String TAG = "FcmConfigurationHandler";

private static final String FCM_ACCOUNT_SID = "fcm-account-sid";
private static final String FCM_CLIENT_SID = "fcm-client-sid";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import android.util.Log;

import org.restcomm.android.sdk.RCDevice;
import org.restcomm.android.sdk.util.RCLogger;

public class FcmMessagingService extends FirebaseMessagingService {

Expand All @@ -44,9 +43,9 @@ public void onMessageReceived(RemoteMessage remoteMessage) {
private void sendNotification() {
//start service
Intent intent = new Intent(this, RCDevice.class);
intent.setAction(RCDevice.ACTION_IS_FCM);
intent.setAction(RCDevice.ACTION_FCM);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O){
startForegroundService(intent);
startService(intent);
} else{
startService(intent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public static void saveParams(StorageManagerInterface storageManagerInterface, H

if (value instanceof String){
storageManagerInterface.saveString(key, (String) value);
} else if (value instanceof Integer){
storageManagerInterface.saveInt(key, (int)value);
} else if (value instanceof Integer) {
storageManagerInterface.saveInt(key, (int) value);
} else if (value instanceof Enum){
storageManagerInterface.saveInt(key, ((Enum) value).ordinal());
} else if (value instanceof Boolean){
storageManagerInterface.saveBoolean(key, (boolean)value);
} else if (value instanceof Intent){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ private static String filter(String msg)
// Remove sensitive information. If we want to add more sensitive data, here's where we need to filter it
msg = msg.replaceAll("turn-password=.*?, ", "turn-password=, ") // turn password filtering
.replaceAll("pref_sip_password=.*?, ", "pref_sip_password=, ") // SIP password
.replaceAll("secret=.*?&", "secret=&"); // for ICE/TURN url password

.replaceAll("secret=.*?&", "secret=&") // for ICE/TURN url password
.replaceAll("push-fcm-key=.*?, ", "push-fcm-key==, ") //fcm server key
.replaceAll("push-account-email=.*?, ", "push-account-email==, ") // for push
.replaceAll("push-account-password=.*?, ", "push-account-password==, "); // for push
//return msg.replaceAll("\"", "").replaceAll("\\r", "").replaceAll("", "");
// Remove special carriage return characters that seem to not be allowed to be written in logcat.
// WARNING: Also another VERY weird issue is that if we are logging full INVITE requests (together with SDP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ public static void validateSettingsParms(HashMap<String, Object> parameters) thr
}
else {
// discovery type provided
RCDevice.MediaIceServersDiscoveryType iceServersDiscoveryType = (RCDevice.MediaIceServersDiscoveryType)parameters.get(RCDevice.ParameterKeys.MEDIA_ICE_SERVERS_DISCOVERY_TYPE);
RCDevice.MediaIceServersDiscoveryType iceServersDiscoveryType;
if (parameters.get(RCDevice.ParameterKeys.MEDIA_ICE_SERVERS_DISCOVERY_TYPE) instanceof Enum){
iceServersDiscoveryType = (RCDevice.MediaIceServersDiscoveryType)parameters.get(RCDevice.ParameterKeys.MEDIA_ICE_SERVERS_DISCOVERY_TYPE);
} else {
iceServersDiscoveryType = RCDevice.MediaIceServersDiscoveryType.values()[(int)parameters.get(RCDevice.ParameterKeys.MEDIA_ICE_SERVERS_DISCOVERY_TYPE)];
}

if (iceServersDiscoveryType.ordinal() < RCDevice.MediaIceServersDiscoveryType.ICE_SERVERS_CONFIGURATION_URL_XIRSYS_V2.ordinal() ||
iceServersDiscoveryType.ordinal() > RCDevice.MediaIceServersDiscoveryType.ICE_SERVERS_CUSTOM.ordinal()) {
throw new RCException(RCClient.ErrorCodes.ERROR_DEVICE_INVALID_ICE_SERVER_DISCOVERY_TYPE);
Expand Down

0 comments on commit ed98df2

Please sign in to comment.