Skip to main content

SDK

  • Are there any functional or performance limitations while using the Plivo Browser SDK on mobile browsers?

    We have tested our BrowserSDK on mobile browsers and documented functional limitations and performance-related aspects in this FAQ to help you implement nuanced workflows and plan resources needed by your apps. 

    Our BrowserSDK supports most of the functionality available in these mobile browsers (Chrome, Firefox, and Safari), but there may be some functionality that differs between the browsers. The table below highlights these differences:

    Functional

    Browser Chrome Firefox Safari
    Make and receive calls Supported Supported Supported
    Mute and unmute Supported Supported Supported
    Support for DTMF Supported Supported Supported
    Call-quality metrics tracking Supported Supported Not supported
    Microphone and speaker toggling Supported Not Supported Not Supported
    Move browser to background during ongoing call Call continues Call continues Call continues
    Receive incoming call when browser is in background Rings only when the browser is brought to the foreground and then the call can be answered as usual. Rings only when the browser is brought to the foreground and then the call can be answered as usual.
    Rings only when the browser is brought to the foreground and then the call can be answered as usual.
    Incoming PSTN call during ongoing SDK call Both calls happen in parallel. SDK call will be overwritten by PSTN call (audio running in background and no audio heard from app), but when PSTN call is disconnected, SDK call continues.
    Both calls happen in parallel.
    Echo cancellation and noise reduction Supported Supported Supported

     

    Performance

    While using the Plivo BrowserSDK on mobile browsers, we have analyzed the performance aspects below.  You can use this information to help you plan the resources needed in your apps. If you notice any of these performance-related behaviors different in your case, please reach out to us via our support portal

    Browser Chrome Firefox Safari
    CPU usage on-call Max 7%
    The browser doesn’t provide this information at the Javascript library (SDK) level.
    11.6%
    CPU usage idle state Max 1% 1.9%
    Memory consumption on-call Max 5 MB Max: 4.8 MB
    Memory consumption idle state Max 3.1MB Max: 4.8 MB
    Network usage Total requests: 23
    Transferred over Network: 645 B
    Resources loaded by the page: 1 MB
    Finish: 1.55 s (async loading of objects)
    Total requests: 7
    Transferred over Network: 1.26 KB
    Resources loaded by the page: 778.32 KB
    Finish: 19.88 s (async loading of objects)
    DOMContentLoaded: 121 ms
    Load: 142 ms
    Domains: 4
    Resources: 6
    Total loaded: 2.97 KB
    Bytes transferred: 536 B
    Time: 0
    Jitter 4ms No Jitter No jitter
    RTT 122ms 105.91ms,100.12ms
    150.48ms, 100.28ms
    Packet loss No Packet lost 0.03% (No Packet lost) No Packet lost

     

  • Can I receive calls using Plivo Client SDK?

    Yes. Plivo Client SDK uses Plivo Endpoint, hence capable to receive incoming calls from any Plivo Endpoints.

  • What can I build with the Plivo Client SDK?

    You can easily build any voice-enabled browser or mobile application for a seamless customer experience using the Plivo Client SDK. For examples and customer stories, read more in our getting started guides.

  • Pricing for Plivo Client SDK

    Calls placed or received using the Plivo Client SDK are charged the same per-minute rates anywhere in the world. These endpoint types are categorized as “SIP phone, browser and app calls” on our pricing page. 

    Two-way calls – those which connect two separate parties – have two types of call-related legs:

    • One connecting the Plivo Client SDK to Plivo
    • One connecting other parties to Plivo

    Pricing depends on the calling number, destination, and number type. For a complete pricing breakdown, visit our pricing page.

  • How does the Plivo Client SDK interact with other Plivo APIs?

    Plivo SDK is used to add voice functionality to client applications on mobile devices and through web browsers. Plivo’s APIs and XML are used to control calls on the server-side. Both interact with each other and work in tandem. Plivo’s APIs and XML are needed to control the SDK calls (for example: playing text to speech, recording a call, etc).

  • Does the Plivo Client SDK work internationally?

    Yes, Plivo Client SDK can be used domestically or internationally. Incoming and outgoing calls work the same way as Plivo’s Voice product.

  • How do I get started with Client SDKs?

    Plivo Client makes it easy to use a web browser or mobile device to send and receive voice calls using two-way audio streaming over a data connection.

    For more information, check out our Getting Started guides, which include sample applications. 

  • How does Plivo Client SDK work?

    Calls placed using the Plivo Client require the speakers and microphone on a computer or a mobile device to communicate using a data connection. Voice-enabled apps can be engaged using your browser, iOS, and Android SDK without using a telephone.

  • Can I make calls to SIP endpoints using Plivo Client SDK?

    Yes. Plivo Client acts like any other phone that works with Plivo. It can connect to any SIP Plivo or non-Plivo endpoint using the same Plivo XML.

  • Can I make calls to traditional phone numbers using the Plivo Client SDK?

    Yes. Plivo Client acts like any other phone that works with Plivo. It can connect to any existing phone number using the same Plivo XML. For more information, read this article: Plivo’s Geo-Permissions to Manage Outbound Calls Effectively.

  • Does the Plivo WebSDK support Flash?

    No, Plivo WebSDK does not support Flash. Click here to learn more about the browsers the Plivo SDK supports.

  • What are the limitations for SIP headers?

    SIP headers (also called SIP fields or extra headers) are a function of SIP. These headers help convey message attributes to ensure that information packets travel along the correct path when communicating between devices that exist on separate networks.

    SIP headers are present for every HTTP request made by an outbound call. They can be categorized into four main types: record route headers, route headers, via headers, and contact headers. SIP headers are similar to HTTP header fields and always use the following format:

    <header_name>:<value> 

    Use the following rules for header names:

    • Write headers in this format: X-PH-Yourfield
    • “Yourfield” must start with an uppercase letter. Other characters must be in lowercase.
    • The header name can only contain alphanumeric characters (A-Z, a-z, 0-9)
    • The header name can have a maximum length of 24 characters

    The following rules need to be followed for header values:

    • The header value may comprise of letters (A..Z, a..z), numerals (0-9), and '%' 
    • The header value should have a maximum length of 48 characters

    The header name-value pairs that do not follow the above rules will not be sent by Plivo. 

  • Will the ‘onLogout’ event be triggered without explicitly calling the logout API?

    Yes. The ‘onLogout’ event gets triggered for reasons outlined on this page. This is to aid use cases such as updating status on the UI.

  • What is DSCP used for?

    BrowserSDK 2.0 allows users to enable DSCP. DSCP gives you the capability to prioritize media packets in your internal network using the ‘dscp’ configuration parameter. This can help in providing better QoS. You can find more information in our WebSDK Getting Started guide.

  • How do I minimize echo and background noise while making calls using the SDK?

    We recommend using a USB headset with a built-in microphone that has auto-echo cancelation. This will help reduce background noise. If you are using a MacBook, check for a noise cancelation option under “Sound” settings.

  • How do I send feedback on BrowserSDK 2.0 call quality to Plivo?

    Please use the “sendQualityFeedback” API to report audio and network-related issues directly to Plivo. We will constantly monitor all feedback and take appropriate action as necessary from our end. 

  • How do I hang up a call on a page reload or refresh?

    Use the command ‘onbeforeunload’ with native JavaScript listener to look for reload and refresh changes and call the browser SDKs logout API. This will terminate any ongoing calls. More details about Plivo’s logout API are available in our WebSDK Getting Started guide

  • Should I call login() API if I’m auto-logged out?

    No, calling login() API is not required. Please listen for the ‘onLogin’ event as the websocket will auto-connect and log in again.

  • Why am I getting logged out of BrowserSDK 2.0 without calling the logout method?

    You may be logged out for one of the following reasons:

    1. If the internet connection is dropping packets continuously;
    2. The application is disconnected from the network;
    3. The system goes to sleep and disconnects network;
    4. Or if the websocket fails to stay active due to network drops or latency.
  • How do I detect audio and network issues in real-time?

    You can use MediaMetrics events to detect network and audio issues and quickly take

    Actions. Please refer to our WebSDK Getting Started guide for more details.

  • How do I optimize call quality using BrowserSDK 2.0?

    The quality of Voice over Internet (VoIP) calls is influenced by a number of external factors, such as the device software/hardware and the network it’s connected to. 

    In this article, we will explore the key factors that influence call quality on Browser SDK calls, best practices thereof.

    Network Characteristics

    The network is utilized by the device largely influences the quality of calls. The following network characteristics have a direct impact on call quality.

    Jitter and Latency

    VoIP calls involve the transmission of a continuous train of voice data packets. Due to network congestion, some packets may reach the recipient later than other packets. This out-of-order receipt of packets, known as Jitter, can result in the audio sounding jumbled or robotic.  

    Jitter is measured in milliseconds of delay, and Jitter values higher than 30 milliseconds on WebRTC calls can lead to poor audio quality. High Jitter can also lead to Jitter Induced Packet Loss, resulting in chunks of audio getting completely lost.

    The primary cause of Jitter is Network Congestion, due to an over-crowded network with many devices, consuming variable amounts of bandwidth at the same time. 

    Latency, in the context of VoIP calls, is the total spoken-to-heard delay in the transmission of audio. The major contributing factor to VoIP latency is the delay incurred in the transmission of voice packets from origin to destination. This is known as Network Latency. 

    Network latency (measured as Round Trip Time) of over 300ms results in an observable audio lag on the call. Higher network latency can sometimes lead to cross talk. 


    Plivo Recommends

    • Using a high bandwidth fiber connection from a reputed Internet provider. Dedicated business internet connections generally come with guaranteed SLAs on bandwidth and latency.

    • Using a physical (ethernet) connection instead of Wi-Fi, whenever possible.

    • If using Wi-Fi, limiting the number of devices connected on the same channel.

    • Using high-quality Wi-Fi routers built for enterprises or for real-time gaming. Look for routers that come with advanced QoS features.

    • Auditing your network firewall and NAT settings to check for transmission delays due to improper configuration.

    • Avoiding large data transfers on the same Wi-Fi network during calls.

    • Limiting bandwidth per connected device to ensure an even allocation of total available bandwidth.

    • Avoiding calls over cellular data connections (4G and older) as they are not optimized for low latency traffic.

    • Setting the Differentiated Service Code Point (dscp) parameter of Plivo Browser SDK to ‘true’. DSCP for WebRTC is supported by Chrome only. It informs network routers to prioritize voice packets over other network packets. Corresponding QoS configurations in the router may be also required.

    • Setting Plivo Media Server region selection in auto mode on Plivo Browser SDK. This ensures that calls get routed through the closest geographic PoP based on the device’s IP address.

    • Ensuring uplink and downlink bandwidth availability of at least 50 kbps for voice transmission. 

    • If operating in a low bandwidth environment, cap the bandwidth to be consumed on the call using the maxAverageBitrate configuration parameter of Plivo Browser SDK. 

    • Gracefully handling poor call quality experiences in real-time by consuming Media Metrics call quality events emitted by Plivo Browser SDK during the course of the call. 

    • Submitting call quality feedback to Plivo programmatically from the Browser SDK or through the Send Feedback REST API. Your feedback allows Plivo to learn and optimize its network by identifying patterns across calls.

    Network Firewalls

    Voice data on VoIP calls are transferred over UDP. Ensure that your network firewall allows the transmission of UDP packets between the client device and the public internet.  

    If your firewall requires whitelisting of external IP Addresses, ensure that Plivo’s SIP Signalling and Media Server IPs listed here are whitelisted on your network firewall. 

    Device Characteristics

    The following device characteristics have a direct impact on the quality of VoIP calls.

    Browser and OS

    Plivo Browser SDK uses WebRTC for voice calls. WebRTC is supported on the following browsers:

    • Chrome on Windows, Linux, macOS, and Android. Note that Chrome for iOS does not support WebRTC.

    • Firefox on Windows, Linux, macOS, and Android.  Note that Firefox for iOS does not support WebRTC.

    • Safari 11+ on iOS and macOS. 

    • New Microsoft Edge (Based on Chromium) on Windows.

    Please note that while WebRTC is supported on the above Browsers, the Plivo Browser SDK v2 is officially tested and supported on the following browser environments only:

    • Chrome v55+ in Desktop Environments

    • Firefox v51+ in Desktop Environments

    • Microsoft Edge v79+ on Windows.

    Plivo highly recommends using its native iOS and Android SDKs to build app-based calling functionality on mobile devices. Mobile browsers are required to be in the foreground for the entire duration of the call and do not have call interruption handling for cellular calls received while on a browser call. Both these features are well supported on Plivo iOS and Android SDKs.

    Device Hardware

    While most modern PC and smartphone devices are more than capable of handling VoIP media, incompatibilities between hardware components like network drivers, audio cards and other firmware components can result in unexpected issues with media handling. 

    Attempting to reproduce issues on other devices should be a key step in your debugging process.

    The Audio Input and Output Device

    Plivo recommends using quality headsets for browser-based calls. 

    Headsets minimize echo by providing acoustic isolation between the speaker and the microphone. High-quality VoIP headsets with noise-canceling features can greatly enhance call quality in noisy environments by eliminating background sounds. 

    Wired headsets generally offer more stable sound quality than wireless or Bluetooth headsets. Wireless headsets are more prone to adapter/driver configuration issues which can lead to static or white noise on calls. We recommend testing with a different headset, or with the inbuilt mic/speaker when troubleshooting such issues.

     

  • How do I reduce the CPU utilization of my application?

    You can initialize the SDK with the following parameters to improve CPU utilization. 

    1. Set  ‘permOnClick’ to true. This uses the microphone on demand to optimize CPU utilization. 
    2. Disable EchoCancallation and AutoGainControl in the ‘audioConstraints’ parameter. 

     Please refer to the initialization section in our WebSDK Getting Started guide for more details.

  • What browsers does BrowserSDK 2.0 support?

    BrowserSDK 2.0 uses webRTC APIs and currently supports the following browsers. 

    1. Chrome version 55 and above
    2. Firefox version 51 and above

    The SDK logs the event ‘onWebrtcNotSupported’ when you check if the browser can be used to make and receive calls. More details on this event are available in our WebSDK Getting Started guide.

  • What are AEC and AGC?

    AEC and AGC are configurations provided by the Chrome browser to adjust microphone levels and amplify the audio to make the call clear. AEC and AGC flags can be disabled in the browser SDK to improve CPU utilization as outlined in the WebSDK Getting Started Guide.

  • How can assess call quality?

    The four major call quality metrics are latency, jitter, packet loss, and mos-score. 

    Latency refers to the time it takes to transmit a packet from the source to the destination. When latency is high, users will experience a lag in their audio call. Calls tend to experience significant audio lags when the latency increases beyond 200ms.

    Packet loss is caused by network congestion. High loss of packets results in robotic or broken audio. Calls tend to experience issues when the packet loss is higher than 2%. 

    Jitter is caused when the packets arrive out of order. High measurements of jitter can cause muffled audio in voice calls. Calls tend to experience issues when jitter increases beyond 30ms.    

    How to enable MediaMetrics to access the call quality:

    • Go to the Plivo GitHub page to find an example of how to implement MediaMetrics on your application. If you want to see a MediaMetrics demo, use the online link. Select the network link conditioner for MacOs or Clumsy for Windows to simulate different network conditions. 
    • When you set “enableTracking” to “true” in an SDK configuration, you'll start to receive all network and audio-related WARNING  events under the "MediaMetrics" event listener.
    • Please refer to Plivo documentation to check the list of event names and their threshold limits.
  • Which languages should I use to write applications using Plivo SDK?

    Plivo web SDK is a JavaScript framework that allows you to embed voice call capability in your web apps. You can any standard web language to build a server-side app using our Web SDK.

    For Plivo’s mobile SDK, you should use Objective-C to embed VoIP capability into your mobile application. Mobile SDK is currently available for iOS-based devices (iPhone and iPad).

  • Where can I find examples of the Plivo Web SDK?

    Check out the Voice Chat API. It is a WebRTC-powered voice call app that uses the Plivo WebSDK. The app is open-sourced, so you can check out the source code, fork the repo and modify the app as you wish.

  • What is the Plivo SDK?

    SDK stands for Software Development Kit. The Plivo SDK is a Software Development Kit that enables you to embed voice call capability into your mobile and web applications. It provides a two-way audio capability for making and receiving voice calls. 

    We provide web and mobile SDKs. Our web SDK can be used to build web-based applications, such as a click-to-call button in the browser, real-time screen sharing, and a lot more. Our mobile SDK can be used to build IP-based voice call capabilities (VoIP) for your mobile applications.

  • What can I build with the Plivo SDK?

    With the Plivo Web and Mobile SDK, you can build all the common voice features, like IVR or conferencing. You can also write unique features such as click-to-call, audio recorders, in-app voice chat, or web and mobile softphone.

    Read how our customers have used the Plivo SDK here: https://www.plivo.com/customers/

    For more use cases, check out this page: https://www.plivo.com/use-cases/

  • The browser of my users doesn’t support WebRTC. Can I still use the Plivo Web SDK?

    No, you cannot. Plivo SDK calls are made via WebRTC. Plivo Web SDK V2 supports Google Chrome 55 and above and Firefox 51 and above.

    Please refer to our article, Does the Plivo Web SDK support WebRTC? for more information.