def get(self): key = self.get_argument('Digits', None, True) phone_number = self.get_argument('From', None, True) response = self.application.on_key_pressed(key, num_to_hash(phone_number, NUM_SALT)) logging.debug(str(response)) self.finish(str(response))
def on_pick_up(self, phone_number): if self.in_master_blacklist(phone_number): return str(self.__twilio_reject()) # number masking begins once we verify caller is not an abuser. session_id = num_to_hash(phone_number, NUM_SALT) if self.daily_calls_exceeded(session_id): return str(self.__twilio_reject()) self.db.delete(session_id) return str(self.route_next(session_id, init=True))