Loading Zaptel Modules Without Scripts

In this section, we’ll take a quick look at how to load the zaptel and ztdummy modules without the CentOS initialization script. The zaptel module does not require any configuration if it’s being used only for the ztdummy module. If you plan on loading the ztdummy module as your timing source (and thus, you will not be running any PCI hardware in your system), now is a good time to load both drivers.

Systems Running udevd

In the early days of Linux, the system’s /dev/ directory was populated with a list of devices with which the system could potentially interact. At the time, nearly 18,000 devices were listed. That all changed when devfs was released, allowing dynamic creation of devices that are active within the system. Some of the recently released distributions have incorporated the udev daemon into their systems to dynamically populate /dev/ with device nodes.

To allow Zaptel and other device drivers to access the PCI hardware installed in your system, you must add some rules. Using your favorite text editor, open up your udevd rules file. On CentOS, for example, this file is located at /etc/udev/rules.d/50-udev.rules. Add the following lines to the end of your rules file:

# Section for zaptel 
 
device
   KERNEL="zapctl",     NAME="zap/ctl"
   KERNEL="zaptimer",   NAME="zap/timer"
   KERNEL="zapchannel", NAME="zap/channel"
   KERNEL="zappseudo",  NAME="zap/pseudo"
   KERNEL="zap[0-9]*",  NAME="zap/%n"

Save the file and reboot your system for the settings to take effect.

Note

You may not have to actually edit anything in your system, as the Zaptel installation script will try to install the rules for you; however, we have left this here as a reference for those systems that are not automatically configured.

Loading Zaptel

The zaptel module must be loaded before any of the other modules are loaded and used. Note that if you will be using the zaptel module with PCI hardware, you must configure /etc/zaptel.conf before you load it. (We will discuss how to configure zaptel.conf for use with hardware in Chapter 4, Initial Configuration of Asterisk.) If you are using zaptel only to access ztdummy, you can load it with the modprobe command, as follows:

# modprobe zaptel   

If all goes well, you shouldn’t see any output. To verify that the zaptel module loaded successfully, use the lsmod command. You should be returned a line showing the zaptel module and the amount of memory it is using, as in the following:

# lsmod | grep zaptel
zaptel                201988  0

Loading ztdummy

The ztdummy module is an interface to a device that provides timing, which in turn allows Asterisk to provide timing to various applications and functions that require it. Use the modprobe command to load the ztdummy module after zaptel has been loaded:

# modprobe ztdummy      

If ztdummy loads successfully, no output will be displayed. To verify that ztdummy is loaded and is being used by zaptel, use the lsmod command. The following output is from a computer running the 2.6 kernel:

# lsmod | grep ztdummy
    Module                  Size  Used by
    ztdummy                 3796  0
    zaptel                201988  1 ztdummy

If you happen to be running a 2.4 kernel-based computer, your output from lsmod will show that ztdummy is using the usb-uhci module:

 # lsmod | grep ztdummy
    Module                  Size  Used by
    ztdummy                 3796  0
    zaptel                201988  0 ztdummy
    usb-uhci               24524  0 ztdummy