Skip to content

Commit

Permalink
[feat] add dial() function
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Bour committed May 6, 2013
1 parent 07e0620 commit e74c10c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pyajam/pyajam.py
Expand Up @@ -622,7 +622,23 @@ def peer(self, peername):
except AttributeError:
logging.error("peer(%s): unknown '%s' channel type" % (peername, tech))
raise Exception("unknown '%s' channel type" % tech)



def dial(self, caller, exten, context='default', priority=1, timeout=30):
"""
"""
if timeout <= .5:
raise Exception("dial(): timeout min value is .5 secs")

self._query('mxml', 'originate', {
'channel' : caller,
'context' : context,
'exten' : exten,
'priority': str(priority),
'timeout' : str(timeout*1000),
'callerid': 'pyajam '+__version__
})


def command(self, command, regex=None, normalizer=None, unifyin=None):
"""Execute an Asterisk command.
Expand Down

0 comments on commit e74c10c

Please sign in to comment.