This example calls out to two phone numbers sequentially. The first call is made to a number with a timeout value of 20 seconds. If the call is not answered within that time, Plivo will dial out to the second number.

from plivo import plivoxml

response = plivoxml.ResponseElement()
response.add(
    plivoxml.DialElement(action='https://<yourdomain>.com/dial_action/', time_limit=20)
    .add(plivoxml.NumberElement('12025551111')))
response.add(plivoxml.DialElement().add(plivoxml.NumberElement('12025552222')))
print(response.to_string())
Response
<Response>
    <Dial timeout="20" action="https://<yourdomain>.com/dial_action/">
        <Number>12025551111</Number>
    </Dial>
    <Dial>
        <Number>12025552222</Number>
    </Dial>
</Response>