From 9ebf616172d15e66dd8d4c2283d7356409fff3c7 Mon Sep 17 00:00:00 2001 From: Maxim Litnitskiy Date: Mon, 22 Jun 2020 14:59:56 +0300 Subject: [PATCH 1/4] Originate async fix --- panoramisk/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panoramisk/actions.py b/panoramisk/actions.py index c1710c5..de29ea3 100644 --- a/panoramisk/actions.py +++ b/panoramisk/actions.py @@ -66,7 +66,7 @@ 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': + elif msg.endswith('successfully queued') and self['async'] == 'false': return True return False From 0c7e54145102783196ee4d974100659f5f36e0b9 Mon Sep 17 00:00:00 2001 From: Maxim Litnitskiy Date: Tue, 23 Jun 2020 00:36:31 +0300 Subject: [PATCH 2/4] Originate removed from multi actions --- panoramisk/actions.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/panoramisk/actions.py b/panoramisk/actions.py index de29ea3..38682d0 100644 --- a/panoramisk/actions.py +++ b/panoramisk/actions.py @@ -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 From 9a254d18237ac3b15d4e8bd4eec6211e944cf198 Mon Sep 17 00:00:00 2001 From: litnimax Date: Fri, 11 Jun 2021 11:43:59 +0300 Subject: [PATCH 3/4] Added login error handling --- panoramisk/manager.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/panoramisk/manager.py b/panoramisk/manager.py index 6ca6dcb..f0d2a3a 100644 --- a/panoramisk/manager.py +++ b/panoramisk/manager.py @@ -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 From 1ac72c436d9c11e12f7e55ae7d1a6107f9aa77f0 Mon Sep 17 00:00:00 2001 From: litnimax Date: Thu, 15 Jul 2021 14:21:30 +0300 Subject: [PATCH 4/4] AsyncAGIExec support --- panoramisk/actions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panoramisk/actions.py b/panoramisk/actions.py index 38682d0..53d42c4 100644 --- a/panoramisk/actions.py +++ b/panoramisk/actions.py @@ -73,6 +73,8 @@ def completed(self): resp = self.responses[-1] if resp.event.endswith('Complete'): return True + elif resp.event == 'AsyncAGIExec': + return True elif resp.subevent in ('End', 'Exec'): return True elif resp.response in ('Success', 'Error', 'Fail', 'Failure'):