Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > media > contrib-updates > by-pkgid > c7095aefea7b97fbd2a596dcbfb9d481 > files > 445

asterisk-docs-1.4.26.1-1mdv2008.1.i586.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!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>Working with Interface Configuration Files</title><link rel="stylesheet" href="styles.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /><link rel="start" href="index.html" title="Asterisk™: The Future of Telephony" /><link rel="up" href="asterisk-CHP-4.html" title="Chapter 4. Initial Configuration of Asterisk" /><link rel="prev" href="asterisk-CHP-4-SECT-1.html" title="What Do I Really Need?" /><link rel="next" href="setting_up_dialplan.html" title="Setting Up the Dialplan for Some Test Calls" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Working with Interface Configuration Files</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="asterisk-CHP-4-SECT-1.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Initial Configuration of Asterisk</th><td width="20%" align="right"> <a accesskey="n" href="setting_up_dialplan.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="asterisk-CHP-4-SECT-2"></a>Working with Interface Configuration Files</h2></div></div></div><p>In this chapter,<a id="I_indexterm4_tt435" class="indexterm"></a><a id="I_indexterm4_tt436" class="indexterm"></a> we’re going to build an Asterisk configuration on the
    platform we have just installed. For the first few sections on FXO and FXS
    channels, we’ll assume that you have a Digium TDM11B kit (which comes with
    one FXO and one FXS interface). This will allow you to connect to an
    analog circuit (FXO) and to an analog telephone (FXS). Note that this
    hardware interface isn’t necessary; if you want to build an IP-only
    configuration, you can skip to the section on configuring SIP.</p><p>The configuration we do in this chapter won’t be particularly useful
    on its own, but it will be a kernel to build on. We’re going to touch on
    the following files:</p><div class="variablelist"><dl><dt><span class="term">
            <span class="emphasis"><em>zaptel.conf</em></span>
          </span></dt><dd><p>Here, we’ll do <a id="I_indexterm4_tt437" class="indexterm"></a>low-level configuration for the hardware interface.
          We’ll set up one FXO channel and one FXS channel. This configures
          the driver for the Linux kernel.</p></dd><dt><span class="term">
            <span class="emphasis"><em>zapata.conf</em></span>
          </span></dt><dd><p>In this file, <a id="I_indexterm4_tt438" class="indexterm"></a>we’ll configure Asterisk’s interface to the hardware.
          This file contains a slightly higher-level configuration of the
          hardware in the Asterisk user-level <span class="keep-together">process</span>.</p></dd><dt><span class="term">
            <span class="emphasis"><em>extensions.conf</em></span>
          </span></dt><dd><p>The dialplans <a id="I_indexterm4_tt439" class="indexterm"></a>we create will be extremely primitive, but they will
          prove that the system is working.</p></dd><dt><span class="term">
            <span class="emphasis"><em>sip.conf</em></span>
          </span></dt><dd><p>This is where <a id="I_indexterm4_tt440" class="indexterm"></a>we’ll configure the SIP protocol.</p></dd><dt><span class="term">
            <span class="emphasis"><em>iax.conf</em></span>
          </span></dt><dd><p>This is where <a id="I_indexterm4_tt441" class="indexterm"></a>we’ll configure incoming and outgoing IAX
          channels.</p></dd></dl></div><p>In the following sections, you will be editing several configuration
    files. You’ll have to reload these files for your changes to take effect.
    After you edit the <span class="emphasis"><em>zaptel.conf</em></span> file, you will need to
    reload the configuration for the hardware with <code class="literal">/sbin/ztcfg -vv</code> (you may omit the -<code class="literal">vv</code> if you don’t need verbose output). Changes
    made in <span class="emphasis"><em>zapata.conf</em></span> will require a <code class="literal">module
    reload</code> from the Asterisk console; however, changing signaling
    methods requires a <code class="literal">restart</code>. You will need to perform an
    <code class="literal">iax2 reload</code> and a <code class="literal">sip reload</code> after
    editing the <code class="filename">iax.conf</code> and <code class="filename">sip.conf</code> files, respectively.</p><p>In order to test the new devices we have defined, we must have a
    dialplan through which we can make connections. Even though we have not
    discussed the Asterisk dialplan (that’s coming up in the next chapter), we
    want you to create a basic <code class="filename">extensions.conf</code> file so that we can test our
    work in this chapter.</p><p>Make a backup copy of the sample
    <span class="emphasis"><em>extensions.conf</em></span> (try the bash command <code class="literal">mv extensions.conf extensions.conf.sample</code>), and
    then create a blank <span class="emphasis"><em>extensions.conf</em></span> file (using the
    bash command <code class="literal">touch extensions.conf</code>),
    and insert the following lines:</p><p>
        <a id="I_programlisting4_tt442"></a></p><pre class="programlisting">[globals]

[general]
autofallthrough=yes

[default]

[incoming_calls]

[internal]

[phones]
include =&gt; internal</pre><p>
      </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>In the <code class="literal">[general]</code> section, we
      have set <code class="literal">autofallthrough=yes</code>, which
      tells Asterisk to continue when an extension runs out of things to do.
      If you set this to <code class="literal">no</code>, then Asterisk
      will sit and wait for input after all priorities have executed. This is
      most prevalent if the <a id="I_indexterm4_tt443" class="indexterm"></a><code class="literal">Background()</code>
      application is the last application executed in an extension. If set to
      <code class="literal">yes</code> (which is now the default in 1.4), Asterisk will
      drop the call after <code class="literal">Background()</code>
      finishes executing (at the end of the prompt(s) supplied to it). In
      order to force Asterisk to wait for input after the <code class="literal">Background()</code> application finishes playing the
      voice prompts supplied to it, we use the<a id="I_indexterm4_tt444" class="indexterm"></a> <code class="literal">WaitExten()</code> <span class="keep-together">application</span>.</p><p>Do not be afraid if what we’ve just written doesn’t make a whole
      lot of sense, as we haven’t explored the dialplan, applications,
      priorities, or extensions yet (that is coming up in the next chapter).
      So for now, just set <code class="literal">autofallthrough=yes</code>. It is
      safest to use the <code class="literal">autofallthrough=yes</code>
      command as we don’t want Asterisk hanging around waiting for input
      unless we explicitly tell it to do so.</p></div><p>There is nothing else for now, but we’ll be using this file as we go
    through this chapter to build a test dialplan so we can ensure that all of
    our devices are working. Also, be sure to run the <code class="literal">dialplan reload</code> command<a id="I_indexterm4_tt445" class="indexterm"></a> from the Asterisk CLI to update to the latest changes.
    Verify your changes by running the CLI command <code class="literal">dialplan show</code>:</p><p>
        <a id="I_programlisting4_tt446"></a></p><pre class="programlisting">*CLI&gt; <strong class="userinput"><code>dialplan show</code></strong>
[ Context 'phones' created by 'pbx_config' ]
  Include =&gt;        'internal'                                    [pbx_config]

[ Context 'internal' created by 'pbx_config' ]

[ Context 'incoming_calls' created by 'pbx_config' ]

[ Context 'default' created by 'pbx_config' ]

[ Context 'parkedcalls' created by 'res_features' ]
  '700' =&gt;          1. Park((null))                               [res_features]

-= 1 extension (1 priority) in 5 contexts. =-
</pre><p>
      </p><p>
        </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>You will see the <code class="literal">parkedcalls</code>
        context because it is an internal context to Asterisk, specified in
        the <code class="filename">features.conf</code> file.</p></div><p>
      </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="asterisk-CHP-4-SECT-1.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="asterisk-CHP-4.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="setting_up_dialplan.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">What Do I Really Need? </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Setting Up the Dialplan for Some Test Calls</td></tr></table></div><div xmlns="" id="svn-footer"><hr /><p>You are reading <em>Asterisk: The Future of Telephony</em> (2nd Edition for Asterisk 1.4), by Jim van Meggelen, Jared Smith, and Leif Madsen.<br />
       This work is licensed under the <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-Noncommercial-No Derivative Works License v3.0</a>.<br />
       To submit comments, corrections, or other contributions to the text, please visit <a href="http://oreilly.com/catalog/9780596510480/">http://www.oreilly.com/</a>.</p></div></body></html>