login | register
Sun 12 of Oct, 2008 [08:40 UTC]

voip-info.org

Asterisk Linux SuSE

Created by: wylie,Last modification on Mon 11 of Aug, 2008 [19:45 UTC] by johnlange

Asterisk on SuSE Linux

http://www.suse.com
Part of UnitedLinux.

A couple of users reported problems getting Asterisk to work with SuSe 8.2 or 9.0 when zaptel hardware drivers are involved. Others reported success (for 8.2 at least). 9.2 Professional comes with pre-built RPMs for Asterisk as well the associated modules and configuration files.

Novell has changed their policy on kernel modules, so as of SuSE v10.x Asterisk is no longer supported. More details on this 'change of heart' here:
Novell bans proprietary Linux modules


openSUSE 10.2


More excellence. More improvements even over 10.1 (there are worthwhile improvements for this minor version). Asterisk seems fine.

One small thing we are interested in, are tinkering with, and want to know if any one else is tinkering with, or has got working is using AppArmor. Please see:
Securing Your Server With AppArmor
for what seems like a fairly straight-forward start to this goal. Please add your notes here & we will try to do same.

openSUSE 10.1


No reported issues that we are aware of here. Upgrade from previous SUSE version was painless. New OS is fantastic, really like the direction that things are headed, better mgmnt, better tools, more packages, better security, more universality (ext3 now and not reiserFS, and others more RHEL/CentOS -like). Fewer complaints, more complements all around. Some previous versions (few versions back) used to have SUSE-specific oddities that our RHEL guys would get thrown a curveball on, but there are few of those these days it seems. Others please elaborate on your opinion here. It is always a debate on what distro' to go with (will they still be in business, how great will support be, how big is community, will all RPM's just work, what is developing sw on it like, etc) and we only see good things on all fronts.

SuSe 10.x


SLES 10 (SUSE Linux Enterprise Server) works with Asterisk 1.4beta sources but installation can be tricky.

You need to install the kernel-source package (via yast). Yast will download the latest greatest kernel source wich will NOT be the same version you are running. This causes the zaptel build to fail so you need to take the following steps (compile and install a new kernel):

# cd /usr/src/linux
# make cloneconfig
# make
# make install

Yes, because of the version differences you must install after the compile of the kernel. At this point you should be able to just reboot into your new kernel. Once you reboot do:

# uname -r
2.6.16.21-0.15-smp

# ls -l /usr/src/linux
lrwxrwxrwx  1 root     root       20 2006-09-28 15:13 linux -> linux-2.6.16.21-0.15

As you can see, the running kernel must be the same as the version of the kernel you just compiled. e.g. /usr/src/linux -> linux-2.6.16.21-0.15.

If the version reported by uname -r does not match the what /usr/src/linux points at then you have a problem. The new kernel you compiled is not the one that booted. That probably means "make install" didn't adjust grub and other things correctly. Form some reason this seems to happen a lot with SUSE dating back to the 9.x release. There are a few steps to fix this. First, when you reboot the grub menu may show more than one "SUSE Linux Enterprise Server 10" entries. If you scroll down to the second one this might boot your new kernel but this will only be a temporary fix so its not recommended.

The proper thing to do is to look in the /boot directory. The symbolic links for /boot/vmlinz and /boot/initrd are probably wrong. Given the above example where the new kernel version should be "2.6.16.21-0.15-smp", then /boot should contain the following two entries:

initrd -> initrd-2.6.16.21-0.15-smp
vmlinuz -> vmlinuz-2.6.16.21-0.15-smp

If they don't, then they probably still point at the old kernel. Do the following (adjusted for your kernel version):

# rm vmlinuz
# rm initrd
# ln -s /boot/vmlinuz-2.6.16.21-0.15-smp /boot/vmlinuz
# ln -s /boot/initrd-2.6.16.21-0.15-smp /boot/initrd

# reboot

When your system comes back up check that uname -r is reporting the correct version. If it is then you should be all set!

SuSe 9.0

Compilation Error


termcap
Packages needed

 bison
 libtermcap
 libtermcap-devel
 newt
 newt-devel
 ncurses
 ncurses-devel

res_crypto.so
Packages needed

 openssl

 openssl-devel



SuSe 9.1 & ast_data

by Giovanni Powell

I have tried using ast_data-1.0.2. But it doesn't work. So i suggest using ast_data-1.0.1 and asterisk-1.0.1. http://svn.asteriskdocs.org/res_data/


-=Steps:=-
For ast_data to work correctly you have to edit the data_Makefile and the README.txt, as stated in their documentation.

1. edit the data_Makefile, go to line 25 and enter the location of your mysql folder.
Mine is set to, MYSQLDIR=/usr/lib/mysql and comment out the Postgres and ODBC stuff.

2. edit the README.txt
ASTSRC=/usr/src/asterisk-1.0.1

3. If asterisk is already installed then make the README.txt and it should say patch successfully installed or something like that.

4. make install for asterisk. then edit cdr_mysql.conf in your /etc/asterisk folder.


Note:
Use the square brackets...

{global}
hostname=localhost
dbname=asteriskDB
password=
user=root
port=3306
sock=/var/lib/mysql/mysql.sock
userfield=1

5. edit the data.conf file.

{Globals}
SIPFriends = mysql
IAXFriends = mysql
ExtensionsLookup = mysql
Voicemail = mysql

{mysql}
QType = Default
Hostname = localhost
DBName = asteriskDB
User = root
Password =
Port = 3306
Sock = /var/lib/mysql/mysql.sock

Note:
Using an application like phpMyAdmin manage the database makes life alot easier.

In phpMyAdmin create a Database called asteriskDB and browse for the extensions.sql, iax-friends.sql,sip-friends.sql,vmdb.sql to create the tables. Located in the /usr/src/asterisk-1.0.1/contrib/scripts folder.

After that insert the relevant data in the extensions table and also in the sipfriends table, and you should be good to go!!


See Also:



SuSe 9.2 Compilation


NCurses and Termcap


In order to compile on SuSe 9.2, and most likely previous versions, you are going to need to make NCurses visible to the configure script since SuSe likes to hide it. You could pass it in as an argument, but other applications may want it someday too. So I did this as root:

ln -s /lib/libncurses.so.5 /usr/lib/libncurses.so

and that seemed to work.

SSL

At the linking stages, ld complains that it can not find ssl

ld: cannot find -lssl

So you will need to install openssl-devel


SuSe 9.2 Zaptel Installation

by Peter Sutter

All the zaptel modules get already installed by a minimum installation of SuSE V9.2, simply because the modules are loadable modules and are therefore part of the kernel. The SuSE V9.2 installation procedure puts them into the directory /lib/modules/{kernelname-version}/extra. Some of these modules are quite old and failed to work here.

A make install of zaptel puts the modules into the directory /lib/modules/{kernelname-version}/misc, so we have now two versions of the modules on our system. And modprobe still uses the modules from the extra directory. To get it working with the compiled modules, you have to remove all zaptel modules that are in /lib/modules/{kernelname-version}/extra. The quickest way to do this is
for module in /lib/modules/{kernelname-version}/misc/*; do rm -i /lib/modules/{kernelname-version}/extra/$(basename $module); done
You will get a few error messages for modules that are in the misc directory but not in extra. Just ignore them.

Check now with
modprobe zaptel
that the modules are really gone. You should get an error Could not open '/lib/modules/{kernelname-version}/extra/zaptel.ko'

Now issue
depmod
This will create a new dependencies and map file

Add also to the end of /etc/udev/rules.d/50-udev.rules the following lines
  1. 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="zap0-9*", NAME="zap/%n"


modprobe zaptel
will now load your compiled modules, not the ones which came with the system.

Also the zaptel startup file as installed with make install (/etc/init.d/zaptel) does not work under SuSE V9.2. Use the original one from SuSE.





SuSe 11 Compilation


SuSe 11 does not have libtermcap or libtermcap-devel. I installed termcap from the packages manager, but was still getting configure errors.

To solve it, i ran: ./configure --with-termcap=/usr/lib/termcap

hopefully that saves someone some time.

note on above: if you install packages after the initial ./configure, you have to run "make distclean" and then re-run ./configure or it Asterisk won't see the new packages.

Comments

Comments Filter
222

333

by becos, Saturday 12 of August, 2006 [11:13:53 UTC]
222

333Zaptel init script for SuSE 10.1

by becos, Saturday 12 of August, 2006 [11:10:56 UTC]
Hello all,

I altered a bit the zaptel.init script from the * distribution so as to be more SuSE friendly (rc_status!!!).
The file is at http://users.otenet.gr/~becos/zaptel.init.txt . Copy it to /etc/init.d/zaptel (chmod +x) and make a sym link to /usr/sbin/rczaptel if you like SuSE rc scripts!!!

I also include my zaptel modules script from /etc/sysconfig/zaptel. For SuSE 10.1 I had a problem with module xpp for the astribank. The xpp is loaded by default with xpp_usb so when you try to stop zaptel the xpp_usb is not unloaded since xpp stays loaded by the kernel. I added module xpp on the list of modules. This is for SuSE 10.1.
The file is at http://users.otenet.gr/~becos/zaptel.sysconfig.txt .

./becos

222

333Problems upgrading from 9.1 to 10.0

by markstitson, Monday 27 of March, 2006 [08:57:22 UTC]
I upgraded from SuSE Linux 9.1 to 10.0 and most things worked except my TDM400 card with asterisk. I have an FXO and an FXS module on the card and with 9.1 everything worked fine.

Under 10.0 I can make SIP to PSTN calls and SIP to analogue handset calls without problems, when I try to make FXO to FXS calls everything gets horribly distorted and unuseable. When I make calls from the TDM400 card to voicemail the usual lady sounds like a bearded bloke, yet SIP to voicemail works fine.

Tried recompiling all the asterisk bits to no avail.

Finally found an entry on the web that mentioned that if a kernel is compiled for the wrong processor architecture some timers go wrong which affects the TDM400. I changed the processor type in the kernel config, recompiled ther kernel and things started working again.
222

333just upgraded to 10.0

by sjobeck, Monday 24 of October, 2005 [00:51:55 UTC]
I just upgraded two machines, one was 9.2, other was 9.3, to version 10.0. I used bitttorent to download the DVD, popped it in to my laptop running 9.3 & -HEAD & upgraded, and it went through beautifully, did a "make clean; make update; make; make install" for zaptel & asterisk & it started right up, nothing to it. I then did my home office server which was 9.2 and it did not go as smoothly. After it rebooted, I could not log-in, it was complaining about some missing "syslog.so", so I booted off the DVD one more time, did a repair, and sure enough it was missing a pretty decent number of required files, libraries, etc, so I let it do the whole repair process, then rebooted, was then back to where I was, everything looked correct & was starting, I then did the same 'make' string from above, and this time my 'asterisk-addons' didnt build since I was missing the MySql header files, so the CDR stuff was schoking when starting *, so I did the MySql thing, rebuild the addons, and was back to where I wanted to be. Do not yet entirely know what SuSe is doing with the change in release types here (ie: I used to use their 'Pro' release) and why and or how they could not include MySql headers, seems like a huge hole, but, oh well, got it done. Thank dog I had the sense to test this on the less important 'demo/remote' machine of my laptop & also had the sense to do this on a Sunday when the family could live without their phones for a couple hours.
222

333libtermcap & newt not needed for 1.0.7 on 9.2

by sjobeck, Monday 11 of April, 2005 [02:03:09 UTC]
I am not positive about all of the differences between the version of Asterisk at the time of this page's initial publishing and now or the differences between 9.0 & 9.2, however, I can install 1.0.7 on 9.2 without the following:

libtermcap
libtermcap-devel
newt
newt-devel

FYI.

Jason

222

333here is the SuSe 9.x startup script

by sjobeck, Sunday 27 of March, 2005 [05:40:43 UTC]
paste the following in to /etc/init.d/zaptel




  1. ! /bin/sh
  2. Copyright (c) 1995-2004 SUSE Linux AG, Nuernberg, Germany.
  3. All rights reserved.
  4. Author: Kurt Garloff
  5. Please send feedback to http://www.suse.de/feedback/
  6. /etc/init.d/zaptel
  7. and its symbolic link
  8. /(usr/)sbin/rczaptel
  9. System startup script for zaptel
  10. LSB compatible service control script; see http://www.linuxbase.org/spec/
  11. Note: This template uses functions rc_XXX defined in /etc/rc.status on
  12. UnitedLinux (UL) based Linux distributions. If you want to base your
  13. script on this template and ensure that it works on non UL based LSB
  14. compliant Linux distributions, you either have to provide the rc.status
  15. functions from UL or change the script to work without them.
      1. BEGIN INIT INFO
  16. Provides: Zaptel
  17. Required-Start: $local_fs
  18. Should-Start:
  19. Required-Stop: $local_fs
  20. Should-Stop:
  21. Default-Start: 1 2 3 5
  22. Default-Stop: 0 6
  23. Short-Description: Load and initialize Zaptel.
  24. Description: Load and initialize the zaptel telephony drivers
  25. which can be used buy the Asterisk PBX system.
      1. END INIT INFO
  26. Any extensions to the keywords given above should be preceeded by
  27. X-VendorTag- (X-UnitedLinux- X-SuSE- for us) according to LSB.
  28. Notes on Required-Start/Should-Start:
  29. * There are two different issues that are solved by Required-Start
  30. and Should-Start
  31. (a) Hard dependencies: This is used by the runlevel editor to determine
  32. which services absolutely need to be started to make the start of
  33. this service make sense. Example: nfsserver should have
  34. Required-Start: $portmap
  35. Also, required services are started before the dependent ones.
  36. The runlevel editor will warn about such missing hard dependencies
  37. and suggest enabling. During system startup, you may expect an error,
  38. if the dependency is not fulfilled.
  39. (b) Specifying the init script ordering, not real (hard) dependencies.
  40. This is needed by insserv to determine which service should be
  41. started first (and at a later stage what services can be started
  42. in parallel). The tag Should-Start: is used for this.
  43. It tells, that if a service is available, it should be started
  44. before. If not, never mind.
  45. * When specifying hard dependencies or ordering requirements, you can
  46. use names of services (contents of their Provides: section)
  47. or pseudo names starting with a $. The following ones are available
  48. according to LSB (1.1):
  49. $local_fs all local file systems are mounted
  50. (most services should need this!)
  51. $remote_fs all remote file systems are mounted
  52. (note that /usr may be remote, so
  53. many services should Require this!)
  54. $syslog system logging facility up
  55. $network low level networking (eth card, ...)
  56. $named hostname resolution available
  57. $netdaemons all network daemons are running
  58. The $netdaemons pseudo service has been removed in LSB 1.2.
  59. For now, we still offer it for backward compatibility.
  60. These are new (LSB 1.2):
  61. $time the system time has been set correctly
  62. $portmap SunRPC portmapping service available
  63. UnitedLinux extensions:
  64. $ALL indicates that a script should be inserted
  65. at the end
  66. * The services specified in the stop tags
  67. (Required-Stop/Should-Stop)
  68. specify which services need to be still running when this service
  69. is shut down. Often the entries there are just copies or a subset
  70. from the respective start tag.
  71. * Should-Start/Stop are now part of LSB as of 2.0,
  72. formerly SUSE/Unitedlinux used X-UnitedLinux-Should-Start/-Stop.
  73. insserv does support both variants.
  74. * X-UnitedLinux-Default-Enabled: yes/no is used at installation time
  75. (%fillup_and_insserv macro in %post of many RPMs) to specify whether
  76. a startup script should default to be enabled after installation.
  77. It's not used by insserv.
  78. Note on runlevels:
  79. 0 - halt/poweroff 6 - reboot
  80. 1 - single user 2 - multiuser without network exported
  81. 3 - multiuser w/ network (text mode) 5 - multiuser w/ network and X11 (xdm)
  82. Note on script names:
  83. http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/scrptnames.html
  84. A registry has been set up to manage the init script namespace.
  85. http://www.lanana.org/
  86. Please use the names already registered or register one or use a
  87. vendor prefix.


  1. Check for missing binaries (stale symlinks should not happen)
  2. Note: Special treatment of stop for LSB conformance
ZAPTEL_BIN=/sbin/ztcfg
test -x $ZAPTEL_BIN || { echo "$ZAPTEL_BIN not installed";
if "" = "stop" ; then exit 0;
else exit 5; fi; }

  1. Check for existence of needed config file and read it
ZAPTEL_CONFIG=/etc/sysconfig/zaptel
test -r $ZAPTEL_CONFIG || { echo "$ZAPTEL_CONFIG not existing";
if "" = "stop" ; then exit 0;
else exit 6; fi; }

  1. Read config
. $ZAPTEL_CONFIG

  1. Source LSB init functions
  2. providing start_daemon, killproc, pidofproc,
  3. log_success_msg, log_failure_msg and log_warning_msg.
  4. This is currently not used by UnitedLinux based distributions and
  5. not needed for init scripts for UnitedLinux only. If it is used,
  6. the functions from rc.status should not be sourced or used.
  7. . /lib/lsb/init-functions

  1. Shell functions sourced from /etc/rc.status:
  2. rc_check check and set local and overall rc status
  3. rc_status check and set local and overall rc status
  4. rc_status -v be verbose in local rc status and clear it afterwards
  5. rc_status -v -r ditto and clear both the local and overall rc status
  6. rc_status -s display "skipped" and exit with status 3
  7. rc_status -u display "unused" and exit with status 3
  8. rc_failed set local and overall rc status to failed
  9. rc_failed set local and overall rc status to
  10. rc_reset clear both the local and overall rc status
  11. rc_exit exit appropriate to overall rc status
  12. rc_active checks whether a service is activated by symlinks
  13. rc_splash arg sets the boot splash screen to arg (if active)
. /etc/rc.status

  1. Reset status of this service
rc_reset

  1. Return values acc. to LSB for all commands but status:
  2. 0 - success
  3. 1 - generic or unspecified error
  4. 2 - invalid or excess argument(s)
  5. 3 - unimplemented feature (e.g. "reload")
  6. 4 - user had insufficient privileges
  7. 5 - program is not installed
  8. 6 - program is not configured
  9. 7 - program is not running
  10. 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
  11. Note that starting an already running service, stopping
  12. or restarting a not-running service as well as the restart
  13. with force-reload (in case signaling is not supported) are
  14. considered a success.

case "$1" in
   start)
echo -n "Loading Zaptel drivers: "
if test -z "$ZAPTEL_MODULES"; then
rc_failed 6
else
for module in $ZAPTEL_MODULES; do
echo -n "$module "
modprobe $module
done
i=0
while test ! -e /dev/zap/ctl -a $i -lt 50; do
echo -n .
: $i++
usleep 200000
done
$ZAPTEL_BIN
fi

# Remember status and be verbose
rc_status -v
;;
   stop)
echo -n "Unloading Zaptel drivers "
if test -n "$ZAPTEL_MODULES" && grep -q zaptel /proc/devices
then
$ZAPTEL_BIN -s
modprobe -r $ZAPTEL_MODULES
fi

# Remember status and be verbose
rc_status -v
;;
   try-restart|condrestart)
## Do a restart only if the service was active before.
## Note: try-restart is now part of LSB (as of 1.9).
## RH has a similar command named condrestart.
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
   restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
rc_status
;;
   force-reload)

$0 try-restart
rc_status
;;
   reload)
rc_failed 3
rc_status -v
;;
   status)
echo -n "Checking for Zaptel "
grep -q zaptel /proc/devices || rc_failed 3
rc_status -v
;;
   probe)
;;
   *)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit

222

333Re: cant find SuSe 9.x startup script

by sjobeck, Saturday 26 of March, 2005 [08:18:45 UTC]
... still looking for this?


Bueller?

Bueller?


222

333upgrade kernel then reboot then make zaptel

by sjobeck, Saturday 26 of March, 2005 [08:18:16 UTC]
If I use YaST to upgrade the kernel, I cant 'make' Zaptel until after I ahve rebooted. It seems the reboot lets it see that the kernel and the kernel sources are same version, then I can make clean;make;make install in /usr/src/zaptel.

Must be a way to do this without rebooting but I dont know how (......yet).

Peace.

222

333Re: builds on 9.1 Pro

by sjobeck, Saturday 26 of March, 2005 [08:13:23 UTC]
Correction: built Asterisk just fine, but Zaptel didnt work first time.
222

333cant find SuSe 9.x startup script

by sjobeck, Sunday 30 of January, 2005 [09:53:05 UTC]
I am looking for a SuSe 9.2 startup script.

The URL on this page is bad. Has it moved?

Is the script being added to CVS? Can it be?

Thanks so much.