Skip to content

Commit

Permalink
Better callback message
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantinov-Innokentii committed Nov 21, 2024
1 parent 66b28f2 commit 7df3ea4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion engine/apps/twilioapp/gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ def process_gather_data(call_sid: str, digit: str) -> VoiceResponse:

response = VoiceResponse()

success_messages = {
"1": "Acknowledged",
"2": "Resolved",
"3": "Silenced",
}
if digit in ["1", "2", "3"]:
# Success case
response.say(f"You have pressed digit {digit}")
msg = success_messages.get(digit, f"You have pressed digit {digit}")
response.say(msg)
process_digit(call_sid, digit)
else:
# Error wrong digit pressing
Expand Down

0 comments on commit 7df3ea4

Please sign in to comment.