Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Voice Android SDK 5.3.0 #346

Merged

Conversation

kbagchiGWC
Copy link
Contributor

5.3.0

June 3rd, 2020

API Changes

  • A new Call.Listener callback onCallQualityWarningsChanged() is introduced.
void onCallQualityWarningsChanged(Call call,
                                  Set<CallQualityWarning> currentWarnings,
                                  Set<CallQualityWarning> previousWarnings);

The Set that contain the warnings are consisted of enum with values of the newly introduced CallQualityWarning

public enum CallQualityWarning {
    WARN_HIGH_RTT("high-rtt"),
    WARN_HIGH_JITTER("high-jitter"),
    WARN_HIGH_PACKET_LOSS("high-packet-loss"),
    WARN_LOW_MOS("low-mos"),
    WARN_CONSTANT_AUDIO_IN_LEVEL("constant-audio-input-level"),
}

The trigger conditions for the warnings defined in the enumeration are defined as follows:

  • WARN_HIGH_RTT - Round Trip Time (RTT) > 400 ms for 3 out of last 5 samples.
  • WARN_HIGH_JITTER - Jitter > 30 ms for 3 out of last 5 samples.
  • WARN_HIGH_PACKET_LOSS - Raised when average packet loss > 3% in last 7 samples. Cleared when average packet loss <= 1% in last 7 samples.
  • WARN_LOW_MOS - Mean Opinion Score (MOS) < 3.5 for 3 out of last 5 samples.
  • WARN_CONSTANT_AUDIO_IN_LEVEL - Raised when the standard deviation of audio input levels for last 10 samples is less than or equals 1% of the maximum possible audio input level (32767) i.e. 327.67 and the call is not in the muted state and the call is not on hold. Cleared when the standard deviation of audio input levels for last 10 samples is greater than 3% of the maximum possible audio input level.
  • A new method getCallQualityWarnings() is added to Call to retrieve the present set of call quality related warnings.

  • This release also adds the Mean Opinion Score (MOS) measurement mos to RemoteAudioTrackStats. Use Call.getStats() API during a call to retrieve the score. The mos is computed once per second. Since the MOS is calculated from network performance measurements, it can be used to indicate the current network condition to the user to provide better usability. See API Docs for more information.

Example:

call.getStats(new StatsListener() {
    @Override
    public void onStats(@NonNull List<StatsReport> statsReports) {
        for (StatsReport statsReport : statsReports) {
            List<RemoteAudioTrackStats> remoteAudioStatsList = statsReport.getRemoteAudioTrackStats();
            for (RemoteAudioTrackStats remoteAudioStats : remoteAudioStatsList) {
                float mos = remoteAudioStats.mos;
            }
        }
    }
});
  • This release includes support for the expansion of Twilio’s Global Infrastructure via Edge Locations which allows customers to control their connectivity into and out of Twilio’s platform. The Voice Android SDK uses these Edges to connect to Twilio’s infrastructure via the new property Voice.edge. This new property supersedes the now deprecated Voice.region. See the new Edge names and how they map to the old region names.

Here is an example

// Connect using global low latency
Voice.setEdge("roaming")

Below are the new methods signatures introduced in Voice class.

@NonNull public static String getEdge();
public static void setEdge(@NonNull String edge)

The following APIs have been deprecated in favor of the new methods.

@NonNull public static String getRegion();
public static void setRegion(@NonNull String region)
  • Added a boolean property enableIceGatheringOnAnyAddressPorts in CallOptions that allows gathering of ICE candidates from "any address" ports. This allows applications to work in certain VPN environments.

Reference the following code snippet to enable or disable this feature. Note, enableIceGatheringOnAnyAddressPorts is disabled by default.

Configure enableIceGatheringOnAnyAddressPorts with ConnectOptions

ConnectOptions connectOptions = new ConnectOptions.Builder(accessToken)
        .enableIceGatheringOnAnyAddressPorts(iceGatheringOnAnyAddressPorts)
        .build();
Voice.connect(context, connectOptions, callListener);

Configure enableIceGatheringOnAnyAddressPorts with AcceptOptions

AcceptOptions acceptOptions = new AcceptOptions.Builder()
        .enableIceGatheringOnAnyAddressPorts(iceGatheringOnAnyAddressPorts)
        .build();
callInvite.accept(context, acceptOptions, callListener); 

Library Size Report

ABI App Size Increase
universal 15.2MB
armeabi-v7a 3.4MB
arm64-v8a 3.9MB
x86 4.1MB
x86_64 4.1MB

Things to Note

  • Restrictive networks may fail unless ICE servers are provided via ConnectOptions.Builder.iceOptions(...) or AcceptOptions.Builder.iceOptions(...). ICE servers can be obtained from Twilio Network Travarsal Service.
  • Occasional native crash in AsyncTask of registration/unregistration and event
    publishing. The crash has only been observed on API 18 devices and results from a
    thread safety bug in Android. Similar crashes
    have been reported in the popular networking library OkHttp
    #1520
    #1338. If this bug is impacting your applications,
    please open an issue on our quickstart and
    we will investigate potential fixes.

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

@kbagchiGWC kbagchiGWC merged commit 41282e3 into twilio:master Jun 4, 2020
@kbagchiGWC kbagchiGWC deleted the task/use_voice_android_sdk_5.3.0 branch June 4, 2020 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants