Overview
Plivo extends the capabilities of your existing SIP phones, allowing you to add custom business logic when calls are made or received.
Traditionally, SIP phones had very basic functionality and needed to be connected to a PBX. Plivo endpoints eliminate the need to set up and manage a phone system. Any Plivo application can implement the business logic needed to control a SIP phone using any of several web languages without any telecom background knowledge needed. Plivo supports all popular SIP-based softphones and hardware phones, including Bria, Cisco, and Polycom.
Some interesting capabilities to add to your existing SIP phones:
-
Instant conferencing: Calls made through a SIP phone registered with Plivo can directly be added to a conference bridge.
-
Access control: With a few lines of code, you can add the ability to restrict calls made from SIP phones or limit the phone to only receive calls.
-
Monitoring and reporting: Monitor and report all calls made or received using a SIP phone. Create custom dashboards to analyze the data collected using the APIs.
-
Smart routing: Add intelligent extensions and shortcuts which route calls to and from traditional phone networks and WebRTC-enabled phones.
How it works
Once your SIP phone is configured and set up, your device will register with and establish a connection to Plivo. When you initiate a call using the SIP phone, you’re not connecting to another phone or extension directly. Rather, you’re instructing Plivo to fetch XML from the attached application on your server to handle the call request. This is similar to the way Plivo handles incoming calls from a regular phone number. All Plivo XML elements are available to handle the call request. You can also use the <Dial> element to dial to a regular phone, WebRTC device, or any other SIP phone.
Getting started
-
Sign up for a Plivo account.
-
Add an endpoint using the Plivo console and fill in the required details.
-
Make a note of the username Plivo assigns you. Plivo will add random numbers to your username, so it will look something like yodaXXXXXX. For the purpose of this tutorial, we'll use username yodaXXXXXX, password obiwan, alias obiwan.
Configure your SIP phone
Download and install a softphone. If you're on Mac or Windows, download X-Lite (now called Bria Solo Free). If you're on Linux, download Blink. For this tutorial, we'll use the X-Lite softphone.
Launch X-Lite and navigate to Preferences. Click on the Accounts tab and click the "+" icon to add an account.
Add the credentials of the endpoint you created: User ID yodaXXXXXX, password obiwan, domain phone.plivo.com, display name Yoda, authorization name yodaXXXXXX (same as your username).
Note: Field names may vary based on the make and model of your SIP phone. All the configurations will remain in each case.
Click OK when you’re done.
Your endpoint entry in the list should as “enabled.” This indicates that your SIP phone has successfully registered with Plivo.
Using a default dialer app
To start making a call, attach the default direct-dial app to the endpoint you just created. Go to the Endpoints tab and click on the endpoint username to open an endpoint edit window. Select the Direct Dial app from the Application dropdown list.
Next steps: customizing the endpoint app
When a call is made from the softphone, Plivo will send a request to the answer URL of the application attached to the endpoint with the parameters related to the call. Plivo expects a valid XML response from the answer URL in order to proceed with the call.
Let’s assume that we want to create a simple dial application and make an outbound call to the number entered from the softphone. The answer URL will receive a request with the From and To parameters. We need to parse these parameters and return a Dial XML element with the appropriate attributes.
<Response>
<Dial callerId="18004321321">
<Number>18001231234</Number>
</Dial>
</Response>
When the above XML is returned on the request, Plivo will make an outbound call to 18001231234 and connect it with the softphone.