Skip to main content
This guide covers Plivo’s SDKs, SIP endpoints, WebRTC integration, and browser/mobile calling.

SDKs Overview

Plivo provides SDKs for multiple platforms:
PlatformUse Case
Web (JavaScript)Browser-based calling
iOSMobile app calling
AndroidMobile app calling
Node.jsServer-side integration
PythonServer-side integration
RubyServer-side integration
PHPServer-side integration
JavaServer-side integration
.NETServer-side integration
GoServer-side integration

Server-Side SDKs

Used for:
  • Making API calls
  • Generating XML responses
  • Managing resources (numbers, applications, recordings)

Client-Side SDKs

Used for:
  • Browser-based calls (WebRTC)
  • Mobile app integration
  • SIP endpoint functionality

SIP Endpoints

SIP endpoints allow users to make and receive calls via SIP protocol.

Create an Endpoint

  1. Navigate to Voice > Endpoints
  2. Click Add New Endpoint
  3. Enter username and password
  4. Attach to a Plivo application
  5. Save

Endpoint Credentials

FieldDescription
UsernameUnique identifier
PasswordAuthentication credential
AliasFriendly name (optional)
ApplicationPlivo app handling calls

Register Endpoint

Configure your SIP client with:
  • SIP URI: sip:<username>@phone.plivo.com
  • Domain: phone.plivo.com
  • Username and password from console

Multiple Device Registration

The same endpoint can register on multiple devices. Incoming calls ring all registered devices.

Supported Softphones

  • Zoiper
  • X-Lite (Bria Solo Free)
  • Linphone
  • Any SIP-compliant client

Make Outbound Calls from Endpoints

Dial SIP URIs directly:
sip:<destination>@phone.plivo.com

Receive Calls on Endpoints

Assign a phone number to the application linked to your endpoint. Incoming calls route through the application’s answer URL.

WebRTC Browser Calling

Enable calling directly from web browsers.

Setup

  1. Include the Plivo Browser SDK
  2. Create an endpoint in console
  3. Initialize SDK with endpoint credentials
  4. Handle call events

Basic Integration

const plivoBrowserSdk = new window.Plivo.Client({
  debug: false,
  permOnClick: true,
});

plivoBrowserSdk.login(username, password);

// Make a call
plivoBrowserSdk.call(destination);

// Answer incoming call
plivoBrowserSdk.answer();

// End call
plivoBrowserSdk.hangup();

Events

EventDescription
onLoginLogin successful
onLoginFailedLogin failed
onIncomingCallIncoming call received
onCallAnsweredCall connected
onCallTerminatedCall ended

Browser Permissions

Users must grant microphone access for calls to work.

Limitations

  • PreAnswer not supported (WebRTC specification)
  • Requires HTTPS (secure context)

Mobile SDKs

iOS SDK

Integrate voice calling into iOS apps. Requirements:
  • iOS 10.0+
  • Xcode
  • CallKit integration (optional, for native call UI)
Installation:
pod 'PlivoVoiceKit'

Android SDK

Integrate voice calling into Android apps. Requirements:
  • Android API 21+
  • Android Studio
Installation (Gradle):
implementation 'com.plivo.endpoint:endpoint:x.x.x'

Push Notifications

Configure push notifications for incoming calls when app is backgrounded:
PlatformService
iOSAPNs (Apple Push Notification service)
AndroidFCM (Firebase Cloud Messaging)
See SDK documentation for push notification setup.

Troubleshooting Endpoints

Common Issues

IssueCauseSolution
Registration failedIncorrect credentialsVerify username/password
No incoming callsApplication not linkedAttach endpoint to application
One-way audioFirewall blockingOpen required ports
EchoLocal audio feedbackAdjust microphone/speaker settings

Required Ports

TypePorts
SIP Signaling5060 (UDP/TCP), 5061 (TLS)
Media (RTP)10000-30000 (UDP)

Debug Connection

  1. Check endpoint status in console
  2. Verify network connectivity
  3. Test with different SIP client
  4. Review application answer URL

Making Outbound Calls to SIP URIs

You can call SIP URIs directly via the Make Call API:
POST /v1/Account/{auth_id}/Call/
{
  "from": "your_plivo_number",
  "to": "sip:[email protected]",
  "answer_url": "https://your-server.com/answer"
}

Calling Plivo Application SIP URI

You can call the SIP URI of your Plivo application:
Note: For receiving calls, create a SIP endpoint attached to your application rather than using the application SIP URI directly.

SDK Best Practices

Security

  • Never expose Auth ID/Token in client-side code
  • Use endpoint credentials for browser/mobile SDKs
  • Implement server-side validation

Performance

  • Initialize SDK once, reuse instance
  • Handle reconnection gracefully
  • Implement proper error handling

User Experience

  • Request permissions before call attempt
  • Show clear call state indicators
  • Handle network changes smoothly

Postman Collection

Test Voice API without code using Plivo’s Postman collection.

Setup

  1. Download Postman
  2. Import Plivo Voice collection
  3. Add your Auth ID and Auth Token
  4. Test API endpoints