To set up a call forwarding application, you need to set up an XML response using the <Dial> element.
The logic of call forwarding is simple. First, you receive an incoming call to your Plivo number. Plivo looks for the answer_url from the call forwarding application with which the number is associated. The answer_url should respond to Plivo’s request with an XML document that states which number or endpoint to forward the call to.
You can find a demo call forwarding app in the dashboard under Voice > Applications > Call Forward. The Primary Answer URL on that page is
http://callforward.herokuapp.com/forward/?Numbers=NUMBER_1_HERE,NUMBER_2_HERE, where Number_1 is the primary forwarding destination and Number_2 is a failover destination.
You can forward calls to a SIP endpoint using the same URL with the Users argument:
Read more in our Getting Started with Call Forwarding guide, which also talks about how to set up call forwarding using PHLO.