diff --git a/pyajam/pyajam.py b/pyajam/pyajam.py index 99cf74d..5163a92 100644 --- a/pyajam/pyajam.py +++ b/pyajam/pyajam.py @@ -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.