Difference between revisions of "Asterisk in container with Debian stable"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(how to compile asterisk inside CT)
m (Reverted edits by StevenCook (talk) to last revision by Kir)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Asterisk is free and open source code to create software PBX server. See [http://www.asterisk.org] for details.
+
Below is an example of how to install Asterisk into OpenVZ container based on Debian stable aka "Sarge".
This package perfectly runs in side OpenVZ container. Some users run up to 60 containers with Asterisk deployed for
 
production per single hardware node. Although the easiest way to install Asterisk into container is to use pre-build package
 
from Linux distribution, occasionally one may need to have a possibility to build it from source tarball available on developer's site.
 
 
 
In order to do it the following remarks are worth reading:
 
 
 
Asterisk PBX server itself is compiled out of the shelf in CT provided that develop application template is installed for this CT.
 
The functionality of the resulting executable is enough to support simple VoIP telephony.
 
 
 
Unfortunately, one particular module called MeetMe (conferencing tool) will be switched off from compilation. This happens due to external dependency on 'zaptel' package.
 
This package provides support for some hardware cards for FXO/FXS analog telephony marketed by Digium (the company behind Asterisk), and on top of that supplies so called ztdummy kernel module.  Ztdummy works like a simple metronome which is required  to synchronize multiple sound streams in case of conference call. Initially this module requires 1 kHz clock which is avail for example on all Digium cards.
 
 
 
If you do not have this card (or equivalent from other vendors) as in case if you do not plan to use analog telephone lines, nothing is lost. You just need to play a little trick with Asterisk make system and HN ovz kernel.
 
First one needs to download zaptel tarball from the same location as Asterisk itself, and copy it's header zaptel.h to location
 
/usr/include/zaptel/zaptel.h in the CT where you plan to build Asterisk. This tweaks MeetMe for installation. Then you need to build
 
ztdummy.ko in HN and make it auto-loaded.
 
 
 
Below is an example of how to install Asterisk into OpenVZ VE based on debian stable aka. "sarge":
 
  
 
<pre>
 
<pre>
Line 25: Line 7:
 
</pre>
 
</pre>
  
change:
+
Change:
 
<pre>
 
<pre>
 
RUNASTERISK=no -> yes
 
RUNASTERISK=no -> yes
Line 32: Line 14:
 
$ /etc/init.d/asterisk start
 
$ /etc/init.d/asterisk start
 
</pre>
 
</pre>
modify the config files for asterisk, and done!
+
Modify the config files for asterisk, and done!
  
if you need capi or/and zaptel/zaphfc:
+
If you need capi or/and zaptel/zaphfc:
  
* for capi: you need the /dev files on you hw-node and vps:
+
* for capi: you need the /dev files on you [[host system]] and in container:
 
<pre>
 
<pre>
 
crw-rw---- 1 root dialout 68, 0 Jan 3 2006 /dev/capi20
 
crw-rw---- 1 root dialout 68, 0 Jan 3 2006 /dev/capi20
Line 44: Line 26:
 
[...]
 
[...]
 
</pre>
 
</pre>
/* if the files doesn' exist use mknod for creating it*/
 
  
and in your vps config add for directly access:
+
''If the files doesn' exist use mknod for creating it.''
 +
 
 +
and in your container config add for directly access:
 
<pre>
 
<pre>
 
DEVICES="c:68:0:rw, c:68:1:rw, c:68:2:rw"
 
DEVICES="c:68:0:rw, c:68:1:rw, c:68:2:rw"
 
</pre>
 
</pre>
 +
 
* for zaptel/zaphfc:
 
* for zaptel/zaphfc:
 
<pre>
 
<pre>
Line 64: Line 48:
 
/* if the files doesn' exist use mknod for creating it*/
 
/* if the files doesn' exist use mknod for creating it*/
  
and in your vps config
+
and in your container config
 
<pre>
 
<pre>
 
DEVICES="c:196:0:rw, c:196:2:rw, c:196:1:rw, c:196:253:rw,c:196:254:rw,c:196:255:rw"
 
DEVICES="c:196:0:rw, c:196:2:rw, c:196:1:rw, c:196:253:rw,c:196:254:rw,c:196:255:rw"
 
</pre>
 
</pre>
  
if need both (capi and zaphfc)
+
* If need both (capi and zaphfc)
 
<pre>
 
<pre>
 
DEVICES="c:68:0:rw, c:68:1:rw, c:68:2:rw c:196:0:rw, c:196:2:rw, c:196:1:rw, c:196:253:rw,c:196:254:rw,c:196:255:rw"
 
DEVICES="c:68:0:rw, c:68:1:rw, c:68:2:rw c:196:0:rw, c:196:2:rw, c:196:1:rw, c:196:253:rw,c:196:254:rw,c:196:255:rw"
 
</pre>
 
</pre>
  
[[category:HOWTO]]
+
[[Category:HOWTO]]
 +
[[Category:Debian]]

Latest revision as of 20:46, 4 August 2012

Below is an example of how to install Asterisk into OpenVZ container based on Debian stable aka "Sarge".

$ apt-get install asterisk

$ nano /etc/defaults/asterisk

Change:

RUNASTERISK=no -> yes
AST_REALTIME=yes -> no (for realtime, you need

$ /etc/init.d/asterisk start

Modify the config files for asterisk, and done!

If you need capi or/and zaptel/zaphfc:

  • for capi: you need the /dev files on you host system and in container:
crw-rw---- 1 root dialout 68, 0 Jan 3 2006 /dev/capi20
crw-rw---- 1 root dialout 68, 1 Jan 3 2006 /dev/capi20.00
crw-rw---- 1 root dialout 68, 2 Jan 3 2006 /dev/capi20.01
crw-rw---- 1 root dialout 68, 3 Jan 3 2006 /dev/capi20.02
[...]

If the files doesn' exist use mknod for creating it.

and in your container config add for directly access:

DEVICES="c:68:0:rw, c:68:1:rw, c:68:2:rw"
  • for zaptel/zaphfc:
crw-rw---- 1 root dialout 196, 0 Jan 4 2006 ctl
crw-rw---- 1 root dialout 196, 1 Jan 4 2006 1
crw-rw---- 1 root dialout 196, 2 Jan 4 2006 2
crw-rw---- 1 root dialout 196, 3 Jan 4 2006 3
crw-rw---- 1 root dialout 196, 4 Jan 4 2006 4
[...]
crw-rw---- 1 root dialout 196, 253 Jan 4 2006 timer
crw-rw---- 1 root dialout 196, 255 Jan 4 2006 pseudo
crw-rw---- 1 root dialout 196, 254 Jan 4 2006 channel

/* if the files doesn' exist use mknod for creating it*/

and in your container config

DEVICES="c:196:0:rw, c:196:2:rw, c:196:1:rw, c:196:253:rw,c:196:254:rw,c:196:255:rw"
  • If need both (capi and zaphfc)
DEVICES="c:68:0:rw, c:68:1:rw, c:68:2:rw c:196:0:rw, c:196:2:rw, c:196:1:rw, c:196:253:rw,c:196:254:rw,c:196:255:rw"