futel / asteriskserver

SIP server for Futel
Creative Commons Zero v1.0 Universal
24 stars 7 forks source link

wumpus game crash #338

Closed kra closed 4 years ago

kra commented 4 years ago

I think this is because I waited without entering anything?

Playing 'statements/anzie-wumpus/where-to.slin' (escapedigits=) (sample offset 0) (language 'en') [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: ERROR [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: Traceb ack (most recent call last): [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: File /opt/asterisk/var/lib/asterisk/agi-bin/util.py, line 40, in agi_traceback er [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: re turn func(*args, **kwargs) [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: File /opt/asterisk/var/lib/asterisk/agi-bin/wumpus.agi, line 10, in main [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: w. hunt(agi) [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: File /opt/asterisk/var/lib/asterisk/agi-bin/wumpus.py, line 170, in hunt [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: ro om = self.validate_choice(agi_o) [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: File /opt/asterisk/var/lib/asterisk/agi-bin/wumpus.py, line 132, in validate_c hoice [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: ro om = int(self.collect_digits(agi_o)) [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: wumpus.agi: ValueE rror: invalid literal for int() with base 10: '' [Jun 19 08:29:43] VERBOSE[27908][C-00000001] res_agi.c: <SIP/668-00000000> AGI Script wumpus.agi completed, returning 0

lboom commented 4 years ago

This is what I mentioned in the PR. It only happens on the collect_digits function because I am abusing timeout to collect 1 or 2 from the user. wait_for_digit() in pyst doesn't support multiple digits.

lboom commented 4 years ago

I was doing a conversion to int even when the input was an empty string... oops.