Я хочу сохранить информацию о вызывающем абоненте, если человек зависает в системе python IVR.
ex:
@app.route('/ivr/welcome', methods=['POST'])
def welcome():
caller = request.form['From']
response = VoiceResponse()
with response.gather(
num_digits=1, action=url_for('menu'), method="POST"
) as g:
g.say(message=f"")
# The functionality I want:
if caller.hangs_up:
hangup = HangUp(phone_number=caller)
db.session.add(hangup)
db.session.commit()
return twiml(response)