Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Originate async fix #89

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions panoramisk/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ def multi(self):
return True
elif msg.startswith('added') and msg.endswith('to queue'):
return True
elif msg.endswith('successfully queued') and self['async'] != 'false':
return True
return False

@property
Expand Down
12 changes: 9 additions & 3 deletions panoramisk/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,15 @@ def login(self, future):
self.authenticated = bool(resp.success)
if self.authenticated:
self.loop.call_soon(self.on_login, self)
if self.pinger is not None:
self.pinger.cancel()
self.pinger = self.loop.call_later(self.ping_delay, self.ping)
if self.pinger is not None:
self.pinger.cancel()
self.pinger = self.loop.call_later(self.ping_delay, self.ping)
else:
self.log.error(
'Asterisk AMI user %s with secret %s...%s login failed.',
self.config['username'],
str(self.config['secret'])[:1],
str(self.config['secret'])[-1:])
return self.authenticated

def ping(self): # pragma: no cover
Expand Down