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.
Create an endpoint
- Create an endpoint on Plivo with a username and a password.
- Make sure you attach the built-in direct_dial application.
- 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.
- Create a file with the following contents. Append
phone.plivo.comto your endpoint username and change the SIP URI "sip:firstname.lastname@example.org" in the below example to your endpoint's SIP URI. Make sure your URI starts with "sip:"
<Response> <Dial callerId="18004321321"> <User>sip:email@example.com</User> </Dial> </Response>
- Host your file on github or Dropbox
- Create a Plivo Application and set the Answer URL as the URL of your static file.
- Open the numbers page and click on the number to link the application you created in the above step
- 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.