SDKs Overview
Plivo provides SDKs for multiple platforms:| Platform | Use Case |
|---|---|
| Web (JavaScript) | Browser-based calling |
| iOS | Mobile app calling |
| Android | Mobile app calling |
| Node.js | Server-side integration |
| Python | Server-side integration |
| Ruby | Server-side integration |
| PHP | Server-side integration |
| Java | Server-side integration |
| .NET | Server-side integration |
| Go | Server-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
- Navigate to Voice > Endpoints
- Click Add New Endpoint
- Enter username and password
- Attach to a Plivo application
- Save
Endpoint Credentials
| Field | Description |
|---|---|
| Username | Unique identifier |
| Password | Authentication credential |
| Alias | Friendly name (optional) |
| Application | Plivo 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: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
- Include the Plivo Browser SDK
- Create an endpoint in console
- Initialize SDK with endpoint credentials
- Handle call events
Basic Integration
Events
| Event | Description |
|---|---|
onLogin | Login successful |
onLoginFailed | Login failed |
onIncomingCall | Incoming call received |
onCallAnswered | Call connected |
onCallTerminated | Call 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)
Android SDK
Integrate voice calling into Android apps. Requirements:- Android API 21+
- Android Studio
Push Notifications
Configure push notifications for incoming calls when app is backgrounded:| Platform | Service |
|---|---|
| iOS | APNs (Apple Push Notification service) |
| Android | FCM (Firebase Cloud Messaging) |
Troubleshooting Endpoints
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| Registration failed | Incorrect credentials | Verify username/password |
| No incoming calls | Application not linked | Attach endpoint to application |
| One-way audio | Firewall blocking | Open required ports |
| Echo | Local audio feedback | Adjust microphone/speaker settings |
Required Ports
| Type | Ports |
|---|---|
| SIP Signaling | 5060 (UDP/TCP), 5061 (TLS) |
| Media (RTP) | 10000-30000 (UDP) |
Debug Connection
- Check endpoint status in console
- Verify network connectivity
- Test with different SIP client
- Review application answer URL
Making Outbound Calls to SIP URIs
You can call SIP URIs directly via the Make Call API:Calling Plivo Application SIP URI
You can call the SIP URI of your Plivo application: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
- Download Postman
- Import Plivo Voice collection
- Add your Auth ID and Auth Token
- Test API endpoints