460 lines
30 KiB
HTML
460 lines
30 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>AGI — pyst2 0.4.9 documentation</title>
|
|
|
|
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: './',
|
|
VERSION: '0.4.9',
|
|
COLLAPSE_INDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
<link rel="top" title="pyst2 0.4.9 documentation" href="index.html" />
|
|
<link rel="next" title="AGITB" href="agitb.html" />
|
|
<link rel="prev" title="pyst2: A Python Interface to Asterisk" href="readme.html" />
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
|
|
|
</head>
|
|
<body role="document">
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body" role="main">
|
|
|
|
<div class="section" id="module-asterisk.agi">
|
|
<span id="agi"></span><h1>AGI<a class="headerlink" href="#module-asterisk.agi" title="Permalink to this headline">¶</a></h1>
|
|
<span class="target" id="module-agi"></span><p>pyvr</p>
|
|
<dl class="docutils">
|
|
<dt>{‘agi_callerid’ <span class="classifier-delimiter">:</span> <span class="classifier">‘mars.putland.int’,</span></dt>
|
|
<dd>‘agi_channel’ : ‘IAX[<a class="reference external" href="mailto:kputland%40kputland">kputland<span>@</span>kputland</a>]/119’,
|
|
‘agi_context’ : ‘default’,
|
|
‘agi_dnid’ : ‘1000’,
|
|
‘agi_enhanced’ : ‘0.0’,
|
|
‘agi_extension’: ‘1000’,
|
|
‘agi_language’ : ‘en’,
|
|
‘agi_priority’ : ‘1’,
|
|
‘agi_rdnis’ : ‘’,
|
|
‘agi_request’ : ‘pyst’,
|
|
‘agi_type’ : ‘IAX’}</dd>
|
|
</dl>
|
|
<div class="section" id="specification">
|
|
<h2>Specification<a class="headerlink" href="#specification" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="class">
|
|
<dt id="asterisk.agi.AGI">
|
|
<em class="property">class </em><code class="descclassname">asterisk.agi.</code><code class="descname">AGI</code><span class="sig-paren">(</span><em>stdin=<open file '<stdin>'</em>, <em>mode 'r'></em>, <em>stdout=<open file '<stdout>'</em>, <em>mode 'w'></em>, <em>stderr=<open file '<stderr>'</em>, <em>mode 'w'></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>This class encapsulates communication between Asterisk an a python script.
|
|
It handles encoding commands to Asterisk and parsing responses from
|
|
Asterisk.</p>
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.answer">
|
|
<code class="descname">answer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.answer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.answer" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.answer() –> None
|
|
Answer channel if not already in answer state.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.appexec">
|
|
<code class="descname">appexec</code><span class="sig-paren">(</span><em>application</em>, <em>options=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.appexec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.appexec" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Executes <application> with given <options>.
|
|
Returns whatever the application returns, or -2 on failure to find
|
|
application</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.channel_status">
|
|
<code class="descname">channel_status</code><span class="sig-paren">(</span><em>channel=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.channel_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.channel_status" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.channel_status(channel=’‘) –> int
|
|
Returns the status of the specified channel. If no channel name is
|
|
given the returns the status of the current channel.</p>
|
|
<p>Return values:
|
|
0 Channel is down and available
|
|
1 Channel is down, but reserved
|
|
2 Channel is off hook
|
|
3 Digits (or equivalent) have been dialed
|
|
4 Line is ringing
|
|
5 Remote end is ringing
|
|
6 Line is up
|
|
7 Line is busy</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.control_stream_file">
|
|
<code class="descname">control_stream_file</code><span class="sig-paren">(</span><em>filename</em>, <em>escape_digits=''</em>, <em>skipms=3000</em>, <em>fwd=''</em>, <em>rew=''</em>, <em>pause=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.control_stream_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.control_stream_file" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Send the given file, allowing playback to be interrupted by the given
|
|
digits, if any. escape_digits is a string ‘12345’ or a list of
|
|
ints [1,2,3,4,5] or strings [‘1’,‘2’,‘3’] or mixed [1,‘2’,3,‘4’]
|
|
If sample offset is provided then the audio will seek to sample
|
|
offset before play starts. Returns digit if one was pressed.
|
|
Throws AGIError if the channel was disconnected. Remember, the file
|
|
extension must not be included in the filename.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.database_del">
|
|
<code class="descname">database_del</code><span class="sig-paren">(</span><em>family</em>, <em>key</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.database_del"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.database_del" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.database_del(family, key) –> None
|
|
Deletes an entry in the Asterisk database for a
|
|
given family and key.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.database_deltree">
|
|
<code class="descname">database_deltree</code><span class="sig-paren">(</span><em>family</em>, <em>key=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.database_deltree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.database_deltree" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.database_deltree(family, key=’‘) –> None
|
|
Deletes a family or specific keytree with in a family
|
|
in the Asterisk database.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.database_get">
|
|
<code class="descname">database_get</code><span class="sig-paren">(</span><em>family</em>, <em>key</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.database_get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.database_get" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.database_get(family, key) –> str
|
|
Retrieves an entry in the Asterisk database for a given family and key.
|
|
Returns 0 if <key> is not set. Returns 1 if <key>
|
|
is set and returns the variable in parenthesis
|
|
example return code: 200 result=1 (testvariable)</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.database_put">
|
|
<code class="descname">database_put</code><span class="sig-paren">(</span><em>family</em>, <em>key</em>, <em>value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.database_put"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.database_put" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.database_put(family, key, value) –> None
|
|
Adds or updates an entry in the Asterisk database for a
|
|
given family, key, and value.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.get_data">
|
|
<code class="descname">get_data</code><span class="sig-paren">(</span><em>filename</em>, <em>timeout=2000</em>, <em>max_digits=255</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.get_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.get_data" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.get_data(filename, timeout=DEFAULT_TIMEOUT, max_digits=255) –> digits
|
|
Stream the given file and receive dialed digits</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.get_full_variable">
|
|
<code class="descname">get_full_variable</code><span class="sig-paren">(</span><em>name</em>, <em>channel=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.get_full_variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.get_full_variable" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get a channel variable.</p>
|
|
<p>This function returns the value of the indicated channel variable. If
|
|
the variable is not set, an empty string is returned.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.get_option">
|
|
<code class="descname">get_option</code><span class="sig-paren">(</span><em>filename</em>, <em>escape_digits=''</em>, <em>timeout=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.get_option"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.get_option" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.get_option(filename, escape_digits=’‘, timeout=0) –> digit
|
|
Send the given file, allowing playback to be interrupted by the given
|
|
digits, if any. escape_digits is a string ‘12345’ or a list of
|
|
ints [1,2,3,4,5] or strings [‘1’,‘2’,‘3’] or mixed [1,‘2’,3,‘4’]
|
|
Returns digit if one was pressed.
|
|
Throws AGIError if the channel was disconnected. Remember, the file
|
|
extension must not be included in the filename.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.get_result">
|
|
<code class="descname">get_result</code><span class="sig-paren">(</span><em>stdin=<open file '<stdin>'</em>, <em>mode 'r'></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.get_result"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.get_result" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Read the result of a command from Asterisk</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.get_variable">
|
|
<code class="descname">get_variable</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.get_variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.get_variable" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get a channel variable.</p>
|
|
<p>This function returns the value of the indicated channel variable. If
|
|
the variable is not set, an empty string is returned.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.hangup">
|
|
<code class="descname">hangup</code><span class="sig-paren">(</span><em>channel=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.hangup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.hangup" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Hangs up the specified channel.
|
|
If no channel name is given, hangs up the current channel</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.noop">
|
|
<code class="descname">noop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.noop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.noop" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.noop() –> None
|
|
Does nothing</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.receive_char">
|
|
<code class="descname">receive_char</code><span class="sig-paren">(</span><em>timeout=2000</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.receive_char"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.receive_char" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.receive_char(timeout=DEFAULT_TIMEOUT) –> chr
|
|
Receives a character of text on a channel. Specify timeout to be the
|
|
maximum time to wait for input in milliseconds, or 0 for infinite. Most channels
|
|
do not support the reception of text.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.record_file">
|
|
<code class="descname">record_file</code><span class="sig-paren">(</span><em>filename</em>, <em>format='gsm'</em>, <em>escape_digits='#'</em>, <em>timeout=20000</em>, <em>offset=0</em>, <em>beep='beep'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.record_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.record_file" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.record_file(filename, format, escape_digits, timeout=DEFAULT_TIMEOUT, offset=0, beep=’beep’) –> None
|
|
Record to a file until a given dtmf digit in the sequence is received
|
|
The format will specify what kind of file will be recorded. The timeout
|
|
is the maximum record time in milliseconds, or -1 for no timeout. Offset
|
|
samples is optional, and if provided will seek to the offset without
|
|
exceeding the end of the file</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.say_alpha">
|
|
<code class="descname">say_alpha</code><span class="sig-paren">(</span><em>characters</em>, <em>escape_digits=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.say_alpha"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.say_alpha" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.say_alpha(string, escape_digits=’‘) –> digit
|
|
Say a given character string, returning early if any of the given DTMF
|
|
digits are received on the channel.
|
|
Throws AGIError on channel failure</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.say_date">
|
|
<code class="descname">say_date</code><span class="sig-paren">(</span><em>seconds</em>, <em>escape_digits=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.say_date"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.say_date" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.say_date(seconds, escape_digits=’‘) –> digit
|
|
Say a given date, returning early if any of the given DTMF digits are
|
|
pressed. The date should be in seconds since the UNIX Epoch (Jan 1, 1970 00:00:00)</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.say_datetime">
|
|
<code class="descname">say_datetime</code><span class="sig-paren">(</span><em>seconds</em>, <em>escape_digits=''</em>, <em>format=''</em>, <em>zone=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.say_datetime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.say_datetime" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.say_datetime(seconds, escape_digits=’‘, format=’‘, zone=’‘) –> digit
|
|
Say a given date in the format specfied (see voicemail.conf), returning
|
|
early if any of the given DTMF digits are pressed. The date should be
|
|
in seconds since the UNIX Epoch (Jan 1, 1970 00:00:00).</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.say_digits">
|
|
<code class="descname">say_digits</code><span class="sig-paren">(</span><em>digits</em>, <em>escape_digits=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.say_digits"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.say_digits" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.say_digits(digits, escape_digits=’‘) –> digit
|
|
Say a given digit string, returning early if any of the given DTMF digits
|
|
are received on the channel.
|
|
Throws AGIError on channel failure</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.say_number">
|
|
<code class="descname">say_number</code><span class="sig-paren">(</span><em>number</em>, <em>escape_digits=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.say_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.say_number" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.say_number(number, escape_digits=’‘) –> digit
|
|
Say a given digit string, returning early if any of the given DTMF digits
|
|
are received on the channel.
|
|
Throws AGIError on channel failure</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.say_phonetic">
|
|
<code class="descname">say_phonetic</code><span class="sig-paren">(</span><em>characters</em>, <em>escape_digits=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.say_phonetic"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.say_phonetic" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.say_phonetic(string, escape_digits=’‘) –> digit
|
|
Phonetically say a given character string, returning early if any of
|
|
the given DTMF digits are received on the channel.
|
|
Throws AGIError on channel failure</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.say_time">
|
|
<code class="descname">say_time</code><span class="sig-paren">(</span><em>seconds</em>, <em>escape_digits=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.say_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.say_time" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.say_time(seconds, escape_digits=’‘) –> digit
|
|
Say a given time, returning early if any of the given DTMF digits are
|
|
pressed. The time should be in seconds since the UNIX Epoch (Jan 1, 1970 00:00:00)</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.send_command">
|
|
<code class="descname">send_command</code><span class="sig-paren">(</span><em>command</em>, <em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.send_command"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.send_command" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Send a command to Asterisk</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.send_image">
|
|
<code class="descname">send_image</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.send_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.send_image" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.send_image(filename) –> None
|
|
Sends the given image on a channel. Most channels do not support the
|
|
transmission of images. Image names should not include extensions.
|
|
Throws AGIError on channel failure</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.send_text">
|
|
<code class="descname">send_text</code><span class="sig-paren">(</span><em>text=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.send_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.send_text" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.send_text(text=’‘) –> None
|
|
Sends the given text on a channel. Most channels do not support the
|
|
transmission of text.
|
|
Throws AGIError on error/hangup</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.set_autohangup">
|
|
<code class="descname">set_autohangup</code><span class="sig-paren">(</span><em>secs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.set_autohangup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.set_autohangup" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.set_autohangup(secs) –> None
|
|
Cause the channel to automatically hangup at <secs> seconds in the
|
|
future. Of course it can be hungup before then as well. Setting to
|
|
0 will cause the autohangup feature to be disabled on this channel.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.set_callerid">
|
|
<code class="descname">set_callerid</code><span class="sig-paren">(</span><em>number</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.set_callerid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.set_callerid" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.set_callerid(number) –> None
|
|
Changes the callerid of the current channel.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.set_context">
|
|
<code class="descname">set_context</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.set_context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.set_context" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Sets the context for continuation upon exiting the application.
|
|
No error appears to be produced. Does not set exten or priority
|
|
Use at your own risk. Ensure that you specify a valid context.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.set_extension">
|
|
<code class="descname">set_extension</code><span class="sig-paren">(</span><em>extension</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.set_extension"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.set_extension" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Sets the extension for continuation upon exiting the application.
|
|
No error appears to be produced. Does not set context or priority
|
|
Use at your own risk. Ensure that you specify a valid extension.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.set_priority">
|
|
<code class="descname">set_priority</code><span class="sig-paren">(</span><em>priority</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.set_priority"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.set_priority" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Sets the priority for continuation upon exiting the application.
|
|
No error appears to be produced. Does not set exten or context
|
|
Use at your own risk. Ensure that you specify a valid priority.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.set_variable">
|
|
<code class="descname">set_variable</code><span class="sig-paren">(</span><em>name</em>, <em>value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.set_variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.set_variable" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Set a channel variable.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.stream_file">
|
|
<code class="descname">stream_file</code><span class="sig-paren">(</span><em>filename</em>, <em>escape_digits=''</em>, <em>sample_offset=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.stream_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.stream_file" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.stream_file(filename, escape_digits=’‘, sample_offset=0) –> digit
|
|
Send the given file, allowing playback to be interrupted by the given
|
|
digits, if any. escape_digits is a string ‘12345’ or a list of
|
|
ints [1,2,3,4,5] or strings [‘1’,‘2’,‘3’] or mixed [1,‘2’,3,‘4’]
|
|
If sample offset is provided then the audio will seek to sample
|
|
offset before play starts. Returns digit if one was pressed.
|
|
Throws AGIError if the channel was disconnected. Remember, the file
|
|
extension must not be included in the filename.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.tdd_mode">
|
|
<code class="descname">tdd_mode</code><span class="sig-paren">(</span><em>mode='off'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.tdd_mode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.tdd_mode" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.tdd_mode(mode=’on’|’off’) –> None
|
|
Enable/Disable TDD transmission/reception on a channel.
|
|
Throws AGIAppError if channel is not TDD-capable.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.test_hangup">
|
|
<code class="descname">test_hangup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.test_hangup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.test_hangup" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>This function throws AGIHangup if we have recieved a SIGHUP</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.verbose">
|
|
<code class="descname">verbose</code><span class="sig-paren">(</span><em>message</em>, <em>level=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.verbose"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.verbose" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.verbose(message=’‘, level=1) –> None
|
|
Sends <message> to the console via verbose message system.
|
|
<level> is the the verbose level (1-4)</p>
|
|
</dd></dl>
|
|
|
|
<dl class="method">
|
|
<dt id="asterisk.agi.AGI.wait_for_digit">
|
|
<code class="descname">wait_for_digit</code><span class="sig-paren">(</span><em>timeout=2000</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/asterisk/agi.html#AGI.wait_for_digit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#asterisk.agi.AGI.wait_for_digit" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>agi.wait_for_digit(timeout=DEFAULT_TIMEOUT) –> digit
|
|
Waits for up to ‘timeout’ milliseconds for a channel to receive a DTMF
|
|
digit. Returns digit dialed
|
|
Throws AGIError on channel falure</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h3><a href="index.html">Table Of Contents</a></h3>
|
|
<ul>
|
|
<li><a class="reference internal" href="#">AGI</a><ul>
|
|
<li><a class="reference internal" href="#specification">Specification</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="relations">
|
|
<h3>Related Topics</h3>
|
|
<ul>
|
|
<li><a href="index.html">Documentation overview</a><ul>
|
|
<li>Previous: <a href="readme.html" title="previous chapter">pyst2: A Python Interface to Asterisk</a></li>
|
|
<li>Next: <a href="agitb.html" title="next chapter">AGITB</a></li>
|
|
</ul></li>
|
|
</ul>
|
|
</div>
|
|
<div role="note" aria-label="source link">
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/agi.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="searchbox" style="display: none" role="search">
|
|
<h3>Quick search</h3>
|
|
<form class="search" action="search.html" method="get">
|
|
<input type="text" name="q" />
|
|
<input type="submit" value="Go" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
<p class="searchtip" style="font-size: 90%">
|
|
Enter search terms or a module, class or function name.
|
|
</p>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="footer">
|
|
©2016, Randall Degges.
|
|
|
|
|
|
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.6</a>
|
|
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.7</a>
|
|
|
|
|
|
|
<a href="_sources/agi.txt"
|
|
rel="nofollow">Page source</a>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
</html> |