Skip to content

Commit

Permalink
Merge pull request jfernandz#47 from alejandrozf/issue-46
Browse files Browse the repository at this point in the history
- Adds support for parsing manager data outputs from Asterisk >=14 versions
Thank you very much Alejandro :)
  • Loading branch information
c1cc10 authored Sep 17, 2019
2 parents 12d883c + a74c3a6 commit 288cfa2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions asterisk/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ def parse(self, response):

data = []
for n, line in enumerate(response):
# all valid header lines end in \r\n
if not line.endswith('\r\n'):
# all valid header lines end in \r\n in Asterisk<=13
# and all valid headers lines in Asterisk>13 dont's starts
# with 'Output:'
if not line.endswith('\r\n') or line.startswith('Output:'):
data.extend(response[n:])
break
try:
Expand Down

0 comments on commit 288cfa2

Please sign in to comment.