[Asterisk-Users] loading zaptel drivers automatically upon reboot

Carlos Alperin calperin at senecacom.net
Sat Jan 14 10:37:56 MST 2006


It looks like there is a timing issue between zaptel load, and asterisk
load.

If I stop both services.

[root at SIP2-MI ~]# service asterisk stop
Shutting down asterisk: Asterisk ended with exit status 0
Asterisk shutdown normally.
                                                           [  OK  ]

[root at SIP2-MI ~]# service zaptel stop
Unloading zaptel hardware drivers: wct1xxp.
Removing zaptel module:                                    [  OK  ]

Then I verify that all the modules are gone:

[root at SIP2-MI ~]# lsmod
Module                  Size  Used by
ipv6                  270753  10
autofs4                23621  2
crc_ccitt               6209  0
video                  20165  0
button                 10705  0
battery                13509  0
ac                      8901  0
uhci_hcd               36817  0
ehci_hcd               38733  0
shpchp                 97285  0
hw_random               9557  0
i2c_i801               13133  0
i2c_core               26177  1 i2c_i801
e1000                 107821  0
dm_snapshot            21741  0
dm_zero                 6081  0
dm_mirror              26389  0
ext3                  135241  2
jbd                    61909  1 ext3
dm_mod                 60893  6 dm_snapshot,dm_zero,dm_mirror
ata_piix               13509  0
libata                 51533  1 ata_piix
sd_mod                 22593  0
scsi_mod              139753  2 libata,sd_mod


After that I load zaptel again:

[root at SIP2-MI ~]# service zaptel start
Loading zaptel framework:                                  [  OK  ]
Waiting for zap to come online...OK
Loading zaptel hardware modules: wct1xxp wcusbRunning ztcfg[  OK  ]

This took at least 25 seconds,

[root at SIP2-MI ~]# lsmod
Module                  Size  Used by
wcusb                  24736  0
wct1xxp                21536  0
zaptel                193540  2 wcusb,wct1xxp
ipv6                  270753  10
autofs4                23621  2
crc_ccitt               6209  1 zaptel
video                  20165  0
button                 10705  0
battery                13509  0
ac                      8901  0
uhci_hcd               36817  0
ehci_hcd               38733  0
shpchp                 97285  0
hw_random               9557  0
i2c_i801               13133  0
i2c_core               26177  1 i2c_i801
e1000                 107821  0
dm_snapshot            21741  0
dm_zero                 6081  0
dm_mirror              26389  0
ext3                  135241  2
jbd                    61909  1 ext3
dm_mod                 60893  6 dm_snapshot,dm_zero,dm_mirror
ata_piix               13509  0
libata                 51533  1 ata_piix
sd_mod                 22593  0
scsi_mod              139753  2 libata,sd_mod

And finally,

[root at SIP2-MI ~]# service asterisk start
Starting asterisk:                                         [  OK  ]

[root at SIP2-MI ~]# ps -ax
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-.2.5/FAQ
  PID TTY      STAT   TIME COMMAND
    1 ?        S      0:00 init [3]
    2 ?        S      0:00 [migration/0]
    3 ?        SN     0:00 [ksoftirqd/0]
    4 ?        S<     0:00 [events/0]
    5 ?        S<     0:00 [khelper]
    6 ?        S<     0:00 [kthread]
    8 ?        S<     0:00 [kacpid]
   95 ?        S<     0:00 [kblockd/0]
   98 ?        S<     0:00 [khubd]
  147 ?        S      0:00 [pdflush]
  148 ?        S      0:00 [pdflush]
  150 ?        S<     0:00 [aio/0]
  149 ?        S      0:00 [kswapd0]
  237 ?        S<     0:00 [kseriod]
  351 ?        S<     0:00 [ata/0]
  356 ?        S<     0:00 [scsi_eh_0]
  357 ?        S<     0:00 [scsi_eh_1]
  374 ?        S<     0:00 [kmirrord]
  386 ?        S      0:00 [kjournald]
  845 ?        S<s    0:00 udevd
  930 ?        S      0:00 [shpchpd_event]
 1108 ?        S<     0:00 [kauditd]
 1198 ?        S      0:00 [kjournald]
 1506 ?        Ss     0:00 syslogd -m 0
 1508 ?        Ss     0:00 klogd -x
 1537 ?        S<sl   0:00 auditd
 1694 ?        Ss     0:00 /usr/sbin/automount --timeout=60 /misc file
/etc/auto.misc
 1707 ?        Ss     0:00 /usr/sbin/automount --timeout=60 /net program
/etc/auto.net
 1719 ?        Ss     0:00 /usr/sbin/acpid
 1730 ?        S      0:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -p
/var/run/snmpd -a
 1762 ?        Ss     0:00 /usr/sbin/sshd
 1770 ?        Ss     0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
 1777 ?        Ss     0:00 gpm -m /dev/input/mice -t imps2
 1784 ?        Ss     0:00 crond
 1797 ?        Ss     0:00 /usr/sbin/atd
 1804 ?        Ss     0:00 dbus-daemon --system
 1813 ?        Ss     0:00 hald --retain-privileges
 1818 ?        S      0:00 hald-addon-acpi
 1823 ?        S      0:00 hald-addon-storage
 1833 tty1     Ss+    0:00 /sbin/mingetty tty1
 1834 tty2     Ss+    0:00 /sbin/mingetty tty2
 1835 tty3     Ss+    0:00 /sbin/mingetty tty3
 1836 tty4     Ss+    0:00 /sbin/mingetty tty4
 1837 tty5     Ss+    0:00 /sbin/mingetty tty5
 1838 tty6     Ss+    0:00 /sbin/mingetty tty6
 1989 ?        Rs     0:00 sshd: root at pts/0
 1991 pts/0    Ss     0:00 -bash
 2990 pts/0    S      0:00 /bin/sh /usr/sbin/safe_asterisk
 3013 pts/0    Sl     0:00 /usr/sbin/asterisk -vvvg -c
 3033 pts/0    S      0:00 mpg123 -q -s --mono -r 8000 -b 2048 -f 4096
fpm-world-mix.mp3 fpm-calm-river.mp3 fpm-sunshine.mp3
 3034 pts/0    S      0:00 mpg123 -q -s --mono -r 8000 -b 2048 -f 4096
fpm-world-mix.mp3 fpm-calm-river.mp3 fpm-sunshine.mp3
 3050 pts/0    R+     0:00 ps -ax

As you can see, everything goes fine. If I run this at boot, the problem
that I can see on /var/log/asterisk/messages is that the module wct1xxp and
wcusb are not loaded when asterisk is already loaded, then it dies with code
1, and so on 

Asterisk is not waiting (or not gave zaptel or wct1xxp) to the previous
module to finish loading. And that it looks that makes impossible wct1xxp to
load, just zaptel loads but not wct1xxp nor wcusb.

There is any prevention in order to make asterisk load after zaptel finish?

Thanks,

Carlos Alperin







More information about the asterisk-users mailing list