Error - 12100

I have just copied and pasted the example code you twilio published in order to create a incoming call answer server and it does not work. In my logs appears Error 12100
from flask import Flask from twilio.twiml.voice_response import VoiceResponse app = Flask(__name__) @app.route("/answer", methods=['GET', 'POST']) def answer_call(): """Respond to incoming phone calls with a brief message.""" # Start our TwiML response resp = VoiceResponse() # Read a message aloud to the caller resp.say("Thank you for calling! Have a great day.", voice='alice') return str(resp) if __name__ == "__main__": app.run(debug=True)
I do not receive any error in my ngrok server only in twilio.
I run the app.py and I checked the format..
<?xml version="1.0" encoding="UTF-8"?><Response><Say voice="alice">Thank you for calling! Have a great day.</Say></Response>
(I do not know why it is not working...)
Comments
-
Hi @ignamendi21 , I have sent this out to our support teams, please keep your eye out for an email. Thank you for your patience!
-
Ooh, I think I know what this might be. ngrok recently changed its behaviour for anonymous usage. If you don't have an ngrok account and you try to use ngrok to serve HTML or pages without a Content-Type then you get a page asking you to create an account. I think that might have caused the 12100 error in this case.
To solve this, you can either sign up for a free ngrok account then setup your authtoken and then try again. Or you can set the correct content type header on your response. I'm not a Python developer, but I think this might do the job:
from flask import Flask, make_response from twilio.twiml.voice_response import VoiceResponse app = Flask(__name__) @app.route("/answer", methods=['GET', 'POST']) def answer_call(): """Respond to incoming phone calls with a brief message.""" # Start our TwiML response resp = VoiceResponse() # Read a message aloud to the caller resp.say("Thank you for calling! Have a great day.", voice='alice') response = make_response(str(resp)) response.headers["Content-Type"] = "text/xml" return response if __name__ == "__main__": app.run(debug=True)
-
thank you! It worked
Categories
- 83 All Categories
- 19 SIGNAL 2021
- 376 Product Discussions
- 7 Community - Announcements
- 2 Changelog
- 4 Forum UI Updates
- 8 Welcome Guide
- 6 Community - Events
- 2 Twilio Relay Developer Conference 2021 Mega Thread
- 1 External Community Events
- 25 Inspiration
- 17 Community - Other Discussions
- 1 Community- Twilio Startups