Install Asterisk under Debian: Difference between revisions

From SaruWiki
Jump to navigation Jump to search
(Page started)
 
m (testing added)
Line 9: Line 9:
  echo '#include zapata-channels.conf' >>/etc/asterisk/zapata.conf
  echo '#include zapata-channels.conf' >>/etc/asterisk/zapata.conf
or by opening zapata.conf in your favourite [[vim | text editor]] and pasting the line "#include zapata-channels.conf" (including the hash sign) somewhere near the end of the file.
or by opening zapata.conf in your favourite [[vim | text editor]] and pasting the line "#include zapata-channels.conf" (including the hash sign) somewhere near the end of the file.
When you've rerun ''genzaptelconf'', Asterisk will have started at the end of the command. Your adaptation of ''zapata.conf'' is not yet noticed by Asterisk. Please reload or restart asterisk, e.g. by running
/etc/init.d/asterisk restart
=Configuring and testing Asterisk=
If you've done nothing more than the [[Installing and configuring Zaptel | previously described]] hardware installation and configuration, and the default Asterisk installation given above, then you can already do one very simple test: plug a standard analogue telephone in one of your FXS-ports, and see if you get a dialtone. (Ofcourse, if you've only got FXO-ports or no hardware at all, then this won't help you.)<br>
Furthermore, you could just look at the back of your Linux machine; the small LEDs next to all ports should be lit green (not including those ports for which you haven't installed a module, ofcourse). A port with a module installed, but without a burning LED, signifies no driver loaded.<br>
Other tests and status reports can be obtained from the following commands:
* ''lszaptel'' should show your hardware, with all installed ports (all denoted "in use"); non-installed ports may be shown as FXO-ports. Note: be aware of the neverending confusion surrounding the port name (e.g. FXS) and what signalling it runs (e.g. FXO); remember that those two are always opposed: FXO-ports run FXS signaling, FXS-ports run FXO-signaling. Thus, a non-installed port is shown as running FXS-signaling.
* ''ztcfg -vv'' should show a channel map, with for each hardware channel the channel number and the signaling protocol.
* ''asterisk -r'' should give you an Asterisk console (if Asterisk is in fact running).
If the above tests succeed, then it's time for our initial Asterisk configuration.

Revision as of 22:25, 5 October 2008

Installing Asterisk

Once the hardware configuration part is completed, we can start the installation of Asterisk itself. Using aptitude or apt-get, install package asterisk. On Debian 5.0 "Lenny", it should be Asterisk 1.4.21.2. With apt-get, the command is simply

apt-get install asterisk

Note: many, many dependencies bring a lot of extra packages to your server when you install Asterisk. On a test machine, I counted 24 extra packages (for a total of 11.4MB to be downloaded).

If you have telephony hardware, you've likely already configured it in the preceding sections. However, when Asterisk itself is installed, you can run the genzaptelconf command again, and it will not only re-configure your zaptel.conf, but also it will generate /etc/asterisk/zapata-channels.conf

genzaptelconf -svdM -c nl

Now, as the command suggests, include the zapata-channels.conf file in /etc/asterisk/zapata.conf, either by running

echo '#include zapata-channels.conf' >>/etc/asterisk/zapata.conf

or by opening zapata.conf in your favourite text editor and pasting the line "#include zapata-channels.conf" (including the hash sign) somewhere near the end of the file.

When you've rerun genzaptelconf, Asterisk will have started at the end of the command. Your adaptation of zapata.conf is not yet noticed by Asterisk. Please reload or restart asterisk, e.g. by running

/etc/init.d/asterisk restart

Configuring and testing Asterisk

If you've done nothing more than the previously described hardware installation and configuration, and the default Asterisk installation given above, then you can already do one very simple test: plug a standard analogue telephone in one of your FXS-ports, and see if you get a dialtone. (Ofcourse, if you've only got FXO-ports or no hardware at all, then this won't help you.)
Furthermore, you could just look at the back of your Linux machine; the small LEDs next to all ports should be lit green (not including those ports for which you haven't installed a module, ofcourse). A port with a module installed, but without a burning LED, signifies no driver loaded.
Other tests and status reports can be obtained from the following commands:

  • lszaptel should show your hardware, with all installed ports (all denoted "in use"); non-installed ports may be shown as FXO-ports. Note: be aware of the neverending confusion surrounding the port name (e.g. FXS) and what signalling it runs (e.g. FXO); remember that those two are always opposed: FXO-ports run FXS signaling, FXS-ports run FXO-signaling. Thus, a non-installed port is shown as running FXS-signaling.
  • ztcfg -vv should show a channel map, with for each hardware channel the channel number and the signaling protocol.
  • asterisk -r should give you an Asterisk console (if Asterisk is in fact running).

If the above tests succeed, then it's time for our initial Asterisk configuration.