Last active
January 3, 2016 19:49
-
-
Save elyase/8510943 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hangup_static_xml = """ | |
<Response> | |
<Hangup reason="rejected"/> | |
</Response> | |
""" | |
@app.route('/incoming_call', methods=['POST']) | |
def handle_call(): | |
app.logger.info("Received request: {}".format(request)) | |
to_number = request.form['From'] | |
app.logger.info("Received call from: {}".format(to_number)) | |
text = "*Comen 2 y paga 1*,Le Chansonnier,J # 257 e/ 13 y 15 Vedado | *70% descuento*,Rio Mar,3ra y Final # 11 La Puntilla Playa" | |
#------- send SMS -------# | |
if is_allowed(to_number): | |
app.logger.info("Sending message {} to: {}".format(text, to_number)) | |
response = send_sms(to_number, text) | |
app.logger.info("Message response: {}".format(response)) | |
return hangup_static_xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment