Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Verbs not properly nested in XML #341

@kylejfrost

Description

@kylejfrost

Version:
6.3.0
API Subdomain (api/taskrouter/ip_messaging):
twilio.twiml.VoiceResponse

Code Snippet

@app.route('/ivr/welcome', methods=['POST'])
def welcome():
    response = VoiceResponse()
    with response.gather(numDigits=1, action=url_for('menu'), method='POST') as g:
        g.say('Welcome to my IVR system.')
    return twiml(response)

Expected TwiML Response

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Gather action="/ivr/menu" method="POST" numdigits="1">
        <Say>Welcome to my IVR system.</Say>
    </Gather>
</Response>

Actual TwiML Response

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Gather action="/ivr/menu" method="POST" numdigits="1" />
    <Say>Welcome to my IVR system.</Say>
</Response>

Steps to Reproduce

  1. Use code provided with appropriate imports
  2. Print str(response) to view generated TwiML

More Information

Basically, it appears that when trying to use the say method of gather, instead of nesting the Say verb inside of the Gather, it appends it to the end after the Gather.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions