Skip to content

GetData timeout raises an AGINoResultError #9

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Use the GetData method with a timeout: 
response = agi.execute(pystrix.agi.core.GetData('enter_pin', 5000, 4))

2. Enter nothing and wait for the timeout to expire

What is the expected output? 
Asterisk responds with 'result= (timeout)' so I want '(timeout)' in the 
response.

What do you see instead?
This raises an 'AGINoResultError' because of the space between the result and 
the value

What version of the product are you using? On what operating system?
Asterisk 1.8.25.0
pystrix latest
Debian 7

Please provide any additional information below.
I changed the regex in agi_core.py on line 45 to:
_RE_KV = 
re.compile(r'(?P<key>\w+)=[\s]?(?P<value>[^\s]+)(?:\s+\((?P<data>.*)\))?') 
#Matches Asterisk's key-value response-pairs

With this change it works as expected and I can call GetData again. I tried 
catching the exception and calling GetData but that doesn't seem to work.

Original issue reported on code.google.com by rok...@gmail.com on 29 Jul 2014 at 10:19

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions