From: Matthew A. N. <mni...@di...> - 2005-01-12 15:21:08
|
Dax Reyes wrote: > I get the following on asterisk console when I > call get_data > let it timeout > then call say_digits. > > COMMAND: get data demo-congrats 5000 255 > -- Playing 'demo-congrats' (language 'en') > RESULT_LINE: 200 result= (timeout) > RESULT_DICT: {'result': ('UNDEFINED', '')} > COMMAND: say digits "UNDEFINED" "" > RESULT_LINE: 520-Invalid command syntax. Proper usage follows: > Traceback (most recent call last): > File "/usr/local/share/asterisk/agi-bin/agi.py", line 516, in ? > agi.say_digits(mydigit) > File "/usr/local/share/asterisk/agi-bin/agi.py", line 231, in say_digits > res = self.execute('say digits', digits, escape_digits)['result'][0] > File "/usr/local/share/asterisk/agi-bin/agi.py", line 63, in execute > return self.get_result() > File "/usr/local/share/asterisk/agi-bin/agi.py", line 111, in get_result > raise AGIException(code, usage) > __main__.AGIException: (520, '520-Invalid command syntax. Proper usage follows: > > In order to avoid 520 AGIException for this situation: > > when agi asks for some input (get_data) then timeout without getting > any ( thus getting a result = {result:('UNDEFINED','')} ) and later > "playing/saying" the digits/number with digits = `"UNDEFINED"' > > I have added something like > > if digits = `"UNDEFINED"': return '' > > in function say_digits > Sounds reasonable, go ahead and send a patch. Also if you see any other cases like this send those as well. -- Matthew A. Nicholson Digium |