Forward incoming calls to a Plivo SIP Endpoint

We are going to learn how to forward an incoming call to a Plivo number to a Plivo SIP Endpoint. If you are new to Plivo SIP Endpoints, you should read more about it here.

Getting Started

  1. Sign up for a Plivo Account
  2. Get a Plivo number in the Numbers tab.

Create an endpoint

  1. Create an endpoint on Plivo with a username and a password.
  2. Make sure you attach the built-in direct_dial application.
  3. Plivo will append random numbers to your endpoint username. Make a note of your endpoint username.

Host your XML

You need to host a static URL which returns a Dial XML when Plivo requests the URL.

  1. Create a file with the following contents. Append phone.plivo.com to your endpoint username and change the SIP URI "sip:yoda12312312@phone.plivo.com" in the below example to your endpoint's SIP URI. Make sure your URI starts with "sip:"
    <Response>
    <Dial callerId="18004321321">
        <User>sip:yoda12312312@phone.plivo.com</User>
    </Dial>
    </Response>
  2. Host your file on github or Dropbox
  3. Create a Plivo Application and set the Answer URL as the URL of your static file.
  4. Open the numbers page and click on the number to link the application you created in the above step
  5. Choose the application from the dropdown and click on Update

Register your endpoint

Register your endpoint using a softphone, hardware phone, web SDK or mobile SDK.

Try it out

Make a call to the Plivo number and see your endpoint receive the call.