Skip to content

Commit

Permalink
Update manager.py
Browse files Browse the repository at this point in the history
changed sync to run_async due to python3 new list of reserved words
  • Loading branch information
Francesco Rana committed Jun 17, 2019
1 parent 343f649 commit 3b664b8
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions asterisk/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3b664b8

Please sign in to comment.