lo there,<br>
i am running a python agi script that gets a DTMF number from the user<br>
and passes it back to the script. It works fine with numbers, but if they enter a star (*), it doesn't want to play.<br>
Is there a difference in how this is handled?<br>
here is the snippit:<br>
<br>
def getNumber (sound, gTimeLimit, digit_count):<br>
"""<br>
the asterisk function GET DATA<br>
(filename, timeout, maxdigits)<br>
plays audiofile filename,<br>
gets DTMF digits <br>
up to timeout or max digits<br>
"""<br>
digit_count = int(digit_count)<br>
time_limit = int(gTimeLimit)<br>
sys.stderr.write("GET DATA %s %d %d\n" % (sound, time_limit, digit_count))<br>
sys.stderr.flush()<br>
sys.stdout.write("GET DATA %s %d %d\n" % (sound, time_limit, digit_count))<br>
sys.stdout.flush()<br>
result = sys.stdin.readline().strip()<br>
result = checkResult(result)<br>
if result:<br>
return result<br>
else:<br>
sys.stderr.write('dead result from IVR')<br>
return 'error'<br>
<br>
def checkResult(params):<br>
"""<br>
reads the result of an asterisk command<br>
parses the answer and reports<br>
whether or not the command is successful<br>
"""<br>
params = params.rstrip()<br>
if re.search('^200',params):<br>
result = re.search('result=(\d+)', params)<br>
if (not result):<br>
sys.stderr.write("FAIL ('%s')\n" % params)<br>
sys.stderr.flush()<br>
return -1<br>
else:<br>
result =
result.group(1)
<br>
sys.stderr.write('PASS (%s)\n' % result)<br>
sys.stderr.flush()<br>
return result<br>
else:<br>
sys.stderr.write("FAIL (unexpected result '%s')\n" % params)<br>
sys.stderr.flush()<br>
return -2<br>
<br>
menu_result = getNumber('menu', 5000, 1)<br>
<br>
any idea where i may be missing something here ?<br>
some of the code is from an example app that i found on the internet.<br>
There is something in this code ( i suppose ) that limits me from getting <br>
anything but an integer as a response from here<br>
<br>
if you have read this far, thanks for your time.<br>
<br>
shawn<br>