handle.py (229B)
1 #!/usr/bin/env python 2 import sys 3 4 print("ANSWER",flush=True) 5 6 dtmf="" 7 8 for line in sys.stdin: 9 split = line.strip().split(" ") 10 if split[0] == "DTMF": 11 dtmf += split[1] 12 if dtmf == "1337": 13 break; 14 15 print("HANGUP",flush=True)