From 3b664b8ae71f6160e1bfca81500ac1c223034872 Mon Sep 17 00:00:00 2001 From: Francesco Rana Date: Mon, 17 Jun 2019 14:37:25 +0200 Subject: [PATCH] Update manager.py changed sync to run_async due to python3 new list of reserved words --- asterisk/manager.py | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/asterisk/manager.py b/asterisk/manager.py index e3ab26e..ef2d7cd 100644 --- a/asterisk/manager.py +++ b/asterisk/manager.py @@ -575,7 +575,7 @@ def redirect(self, channel, exten, priority='1', extra_channel='', context=''): return response - def originate(self, channel, exten, context='', priority='', timeout='', application='', data='', caller_id='', async=False, earlymedia='false', account='', variables={}): + def originate(self, channel, exten, context='', priority='', timeout='', application='', data='', caller_id='', run_async=False, earlymedia='false', account='', variables={}): """Originate a call""" cdict = {'Action': 'Originate'} @@ -593,7 +593,7 @@ def originate(self, channel, exten, context='', priority='', timeout='', applica cdict['Data'] = data if caller_id: cdict['CallerID'] = caller_id - if async: + if run_async: cdict['Async'] = 'yes' if earlymedia: cdict['EarlyMedia'] = earlymedia @@ -692,6 +692,34 @@ def reload(self, module): response = self.send_action(cdict) return response + def dbdel(self, family, key): + cdict = {'Action': 'DBDel'} + cdict['Family'] = family + cdict['Key'] = key + response = self.send_action(cdict) + return response + + def dbdeltree(self, family, key): + cdict = {'Action': 'DBDelTree'} + cdict['Family'] = family + cdict['Key'] = key + response = self.send_action(cdict) + return response + + def dbget(self, family, key): + cdict = {'Action': 'DBGet'} + cdict['Family'] = family + cdict['Key'] = key + response = self.send_action(cdict) + return response + + def dbput(self, family, key, val): + cdict = {'Action': 'DBPut'} + cdict['Family'] = family + cdict['Key'] = key + cdict['Val'] = val + response = self.send_action(cdict) + return response class ManagerException(Exception): pass