Compiling Asterisk 1.4 with TDM400 and H323
As a point of reference, we imagine you’re going to build your new Asterisk on a machine preinstalled with TrixBox; this means your machine is very easy to reinstall from scratch if anything goes wrong. This also means that you can start playing with Asterisk 1.4 in a virtual machine, so you have no risk. The first thing you have to do is to create a working directory for Asterisk (say /src/asterisk14) and use it as a base directory It will also be necessary to erase the existing Asterisk system - see Removing Asterisk. Make sure neither Asterisk nor its required libs and drivers (eg Zaptel) are running before attempting the installations. You’ll also need a bit more software:
- The C++ developement environment
- The Iksemel library, in order to test the Google Talk integration (we sure want that!)
- The Gnu TLS package, as needed by Iksemel
- Kernel development headers
yum install gcc-g++
yum install gnutls-devel
yum install kernel-devel
wget http://iksemel.googlecode.com/files/iksemel-1.2.tar.gz
tar zxvf iksemel-1.2.tar.gz
cd iksemel-1.2
./configure
make
make install
cd ..
[root@aleph asterisk]# make -v
GNU Make 3.81
cp /usr/bin/make /usr/bin/make_OLD
wget http://ftp.gnu.org/pub/gnu/make/make-3.81.tar.gz
tar zxvf make-3.81.tar.gz
cd make-3.81
./configure
make
make install
cd ..
which make
make -v
wget http://downloads.sourceforge.net/openh323/pwlib-v1_10_3-src-tar.gz
tar zxvf pwlib-v1_10_3-src-tar.gz
cd pwlib_v1_10_3/
./configure
make
export PWLIBDIR=/src/asterisk-1.4/pwlib_v1_10_3
cp $PWLIBDIR/lib/libpt_linux_x86_r.so.1.10.3 /usr/lib
cd ..
wget http://downloads.sourceforge.net/openh323/openh323-v1_18_0-src-tar.gz
tar zxvf openh323-v1_18_0-src-tar.gz
cd openh323_v1_18_0/
./configure
make opt
export OPENH323DIR=/src/asterisk-1.4/openh323_v1_18_0
cp $OPENH323DIR/lib/libh323_linux_x86_r.so.1.18.0 /usr/lib
cd ..
wget ftp://ftp.digium.com/pub/zaptel/zaptel-1.4.4.tar.gz
wget ftp://ftp.digium.com/pub/libpri/libpri-1.4.1.tar.gz
wget ftp://ftp.digium.com/pub/asterisk/asterisk-1.4.8.tar.gz
tar zxvf zaptel-1.4.4.tar.gz
cd zaptel-1.4.4
./configure
make menuselect
make
make install
cd ..
tar zxvf libpri-1.4.1.tar.gz
make
make install
cd ..
tar zxvf asterisk-1.4.8.tar.gz
./configure
make menuselect
make
make
make install
make samples
cd ..
loadzone = it
defaultzone=it
fxoks=1
fxsks=4
/etc/asterisk/zapata.conf
[#CODE:]
[channels]
language=en
;
; FXS - telefono analogico
;
signalling=fxo_ks
context=interni_analogici
group=1
callwaiting=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
channel => 1
;
; FXO - linea
;
busydetect=yes
busycount=5
signalling=fxs_ks
context=rete_pubblica
group=2
channel => 4
modprobe zaptel
modprobe wctdm
Oct 15 07:58:58 beth-pbx kernel: Zapata Telephony Interface Registered on major 196
Oct 15 07:59:09 beth-pbx kernel: PCI: Found IRQ 9 for device 01:01.0
Oct 15 07:59:09 beth-pbx kernel: Freshmaker version: 73
Oct 15 07:59:09 beth-pbx kernel: Freshmaker passed register test
Oct 15 07:59:09 beth-pbx kernel: Module 0: Installed -- AUTO FXS/DPO
Oct 15 07:59:09 beth-pbx kernel: Module 1: Not installed
Oct 15 07:59:09 beth-pbx kernel: Module 2: Not installed
Oct 15 07:59:09 beth-pbx kernel: Module 3: Installed -- AUTO FXO (FCC mode)
Oct 15 07:59:09 beth-pbx kernel: Found a Wildcard TDM: Wildcard TDM400P REV I (2 modules)
Oct 15 07:59:09 beth-pbx kernel: Registered tone zone 0 (United States / North America)
ztcfg -v
asterisk -vvvvvvvvvvvvvvvvvvvvvvvvvvc
gatekeeper = DISCOVER
context=h323
exten => 21,1,Dial(h323/21)
Installing QueueMetrics beta through RPM
The official QueueMetrics repository contains only production-quelity versions of QueueMetrics. Still, sometimes a beta version is released in RPM format, so we need to install it manually. Make sure QueueMetrics is installed through yum We want everything to be working before installing a beta, so we do the following steps to install the latest working version:
wget https://yum.loway.ch/loway.repo -O /etc/yum.repos.d/loway.repo
yum install queuemetrics
wget http://queuemetrics.com/download/rpm-beta/queuemetrics-1.4.0b1-20.noarch.rpm
yum localupdate queuemetrics-1.4.0b1-20.noarch.rpm
yum remove queuemetrics
yum install queuemetrics
vicidial
Qui parliamo di vicidial - scrivi qui il tuo testo. aqui hablamos de Vicidial Here is the onfo about Vicidial Continue Reading...
QueueMetrics user tracking
To track your users loggin on and off of QueueMetrics, have a look at localhost-xxxx.txt under tomcat/logs, you should find something that looks like the following examples. The value in square brackets (that we edited for brevity) is the session-id, it stays the same throughout the session. All entries havinbg the same session-id are for the same user from the same browser. This is for a log-on:
[EFDC....] Inizio classe it.loway.app.queuemetrics.validazione.logon
[EFDC....] Fine classe it.loway.app.queuemetrics.validazione.logon
[EFDC....] Utente 'demoadmin' in classe '3'
[EFDC....] Utente 'demoadmin' ha chiavi 'USER QUEUE_AN ...'
[EFDC....] Inizio classe it.loway.app.queuemetrics.autenticazione.caricaDatiIniziali
[EFDC....] Fine classe it.loway.app.queuemetrics.autenticazione.caricaDatiIniziali
[EFDC....] Inizio classe it.loway.app.queuemetrics.oq.caricaCodeOutbound
[EFDC....] Fine classe it.loway.app.queuemetrics.oq.caricaCodeOutbound
[EFDC....] Tempo totale esecuzione verbo 'qm_autentica': 91 ms
[EFDC....] Utente sconnesso.
[EFDC....] Tempo totale esecuzione verbo 'qm_logoff': 14 ms
Detecting missing Queue exit events
On some version of Asterisk, there are conditions when an unanswered call would exit the queue without leaving a trace of its exiting in the queue_log, therefore generating incomplete call processing events that lead reporting software like QueueMetrics to produduce inaccurate results. You will notice this if you encounter pieces of the queue_log that look like the following example:
1167421685|1169421668.34679|qname|NONE|ENTERQUEUE||5555551234
1167099900|1169099887.31480|qname|NONE|ENTERQUEUE||5555551234
1168222540|1168222529.5949|qname|NONE|ENTERQUEUE||5555551234
exten => s,1,queue(myqueue)
exten => s,2,System( echo "${EPOCH}|${UNIQUEID}|myqueue|NONE|EXITCODE|${QUEUESTATUS}" >> /var/log/asterisk/queue_log )
exten => h,1,System( echo "${EPOCH}|${UNIQUEID}|myqueue|NONE|EXITHANGUP|${QUEUESTATUS}" >> /var/log/asterisk/queue_log )
QueueMetrics logs
QueueMetrics does not have its own logging facilities, but uses the logging facilities provided by the servlet container it’s running into (that’s in most cases Apache Tomcat). In a standard QueueMetrics installation, they are located in /usr/local/queuemetrics/tomcat/logs and look a bit like the following example:
[root@qm ~]# cd /usr/local/queuemetrics/tomcat/logs/
[root@qm logs]# ll
total 184
-rw-r--r-- 1 root root 53897 Feb 21 21:56 catalina.out
-rw-r--r-- 1 root root 5411 Nov 28 16:54 localhost_log.2006-11-28.txt
-rw-r--r-- 1 root root 4210 Dec 2 23:46 localhost_log.2006-12-02.txt
-rw-r--r-- 1 root root 4207 Dec 8 14:26 localhost_log.2006-12-08.txt
-rw-r--r-- 1 root root 11278 Dec 14 19:01 localhost_log.2006-12-14.txt
-rw-r--r-- 1 root root 7940 Dec 20 13:02 localhost_log.2006-12-20.txt
-rw-r--r-- 1 root root 43429 Jan 18 22:15 localhost_log.2007-01-18.txt
-rw-r--r-- 1 root root 7263 Jan 20 17:52 localhost_log.2007-01-20.txt
-rw-r--r-- 1 root root 25099 Feb 21 21:56 localhost_log.2007-02-21.txt
Changing DTMF tone frequency in Asterisk
When Asterisk is handling a call and needs to listen to that call, e.g. to monitor it for DTMF transfer tones, Asterisk will detect and rebuild all DTMF tones on that call. If you use Asterisk as a bridge to connect appliaces that communicate by exchanging DTMF tones (e.g. remote alarms trasmitting their alarm-ID, or other remote industrial appliances that were designed before the IP age), Asterisk will consistently intercept, buffer and regenate all DTMF tones it detects. This may be a problem, as some of those appliances use distinct DTMF-silence cadences, and by regenerating those tones they are output with Asterisk’s signal-silence cadences. In order to avoid this behaviour in Asterisk, what you can do is to modify the frequency of the DTMF tones Asterisk expects, so that the true DTMF tones are not recognized and therefore let alone by the DSP module. A bit of theory Any DTMF digit is built out of two distinct signals, chosen so that their harmonics do not overlap and are therefore easy to detect and hard to misinterpret. The basic DTMF system uses a telephone-keyboard style matrix of four columns by four rows, in exactly the same configuration that can be found in telephones all around the world (ordinary consumer telephones do not have the fourth column, but you get the idea)
+--------+---------+---------+---------+---------+
| | 1209 Hz | 1336 Hz | 1477 Hz | 1633 Hz |
+--------+---------+---------+---------+---------+
| 697 Hz | 1 | 2 | 3 | A |
| 770 Hz | 4 | 5 | 6 | B |
| 852 Hz | 7 | 8 | 9 | C |
| 941 Hz | * | 0 | # | D |
+--------+---------+---------+---------+---------+
static float dtmf_row[] =
{
697.0, 770.0, 852.0, 941.0
};
static float dtmf_col[] =
{
1209.0, 1336.0, 1477.0, 1633.0
};
static float dtmf_row[] =
{
732.0, 809.0, 894.0, 988.0
/* 697.0, 770.0, 852.0, 941.0 */
};
static float dtmf_col[] =
{
1270.0, 1404.0, 1551.0, 1715.0
/* 1209.0, 1336.0, 1477.0, 1633.0 */
};
- Stopping Asterisk
- Go to your Asterisk source directory
- Enter make clean
- Enter make
- Enter make install
VoiceBlue with Asterisk IP PBX - How to
The present document is a step-by-step guide for configuring the 2N VoiceBlue gateway and Asterisk software IP PBX. It includes essential steps for interconnecting the two products rather than a detailed configuration analysis of the two units. For more information on the 2N VoiceBlue gateway configuration refer to the manual placed at http://www.2n.cz/products/gsm_gateways/voip/voiceblue.html. What is 2N VoiceBlue? The 2N VoiceBlue GSM gateway is an ideal complementary product to any SIP-based IP PBX. It’s suitable for small and medium companies with IP infrastructure and for companies with international affiliates. With VoiceBlue you gain significant savings on outgoing and incoming calls from IP to GSM networks and backwards. Thanks to the efficient and powerful Least Cost Router (LCR), the VoiceBlue GSM gateway always chooses the cheapest possible way to route the call (according to GSM prefixes, free minutes on SIM cards etc.).Using the VoiceBlue gateway you achieve complete independence when connecting to GSM networks and maintain 100% control of your GSM call costs. With the help of voice prompts and efficient Dynamic Clip Routing, VoiceBlue routes incoming GSM calls to the right IP phones. What is Asterisk? Asterisk is a software PBX originally developed by Mark Spencer. This software PBX is designed as an open source, which means that it can be downloaded from the Internet, namely from: http://www.asterisk.org/index.php?menu=download, installed and used without any limitations. The fact that the Asterisk is a software PBX indicates that VoIP is the native environment for this PBX. Asterisk supports VoIP using three protocols, which means that its users can use a wide range of VoIP telephones, both software ones and hardphones. Together with the above mentioned VoIP services, Asterisk supports connection of TDM equipment by means of PCI cards supporting both digital (ISDN PRI/BRI) and analog trunks. Since the PCI bus on the PC is not unlimited, Asterisk users employ as much VoIP equipment as possible in order to save the TDM interface for other services, such as PSTN connection, or use of analog telephones. This is why most Asterisk users use the Ateus VoiceBlue VoIP GSM gateway for their GSM calls. You find below how to interconnect these two types of equipment. For more information on the Asterisk software solution see www.asterisk.org. Main scenario Suppose we have an IP network to which an Asterisk IP PBX, several SIP telephones and an 2N VoiceBlue VoIP-GSM gateway are connected. This typical configuration is shown in the figure below. Furthermore, suppose that the network is addressed as shown in the figure and GSM numbers are all numbers starting with 6,7,8 and containing 9 digits. For configuration simplicity, use SIM cards from one GSM provider. Now say that all incoming calls are answered by the gateway, which replays the invitation message and waits for 10s for another DTMF dialling. After this timeout, the gateway dials extension 111, which is a dial-in to the operator. 2N VoiceBlue Gateway Configuration Step-by-step configuration…ready in 5 minutes:-) System Parameters Set information on the IP interface only …address, mask, default gateway Ethernet Parameters SIP proxy (GSM->IP) instructs the gateway where to send the invite packet during a GSM-VoIP incoming call …the Asterisk address in our case SIP proxy (IP->GSM) instructs the gateway from which IP address the gateway may receive SIP packets …the Asterisk address in our case SIP registrar To enable incoming calls to Asterisk for some units, register the selected units as Friend types in the Asterisk system. Set the following parameters in VoiceBlue for registration: SIP registrar …equipment for which the gateway is to be registered (Asterisk) Username …username under which the gateway shall be registered Password …registration password Assignment to Groups Since SIM cards from one GSM provider are used, all you have to do is make sure that all GSM modules have been assigned to the first group. Network List Create a network list containing the prefix of your GSM destinations …remember to keep the default number of digits (9 in our case). LCR Table Finally, sum up all settings in a single LCR table defining that all called numbers that match the network list 1 shall be routed via GSM group 1. Incoming Calls As far as incoming calls are concerned, the 2N VoiceBlue gateway has a relatively wide choice of possibilities. Besides call ignoring and rejection, you can mainly receive incoming calls as follows: Receive a call and replay the DISA message A simply modifiable message is stored in the gateway and replayed whenever an incoming call is answered. During this message, the calling subscriber can dial in to the required extension. Receive a call with the second dialtone The same as with DISA; the only difference is that the user hears the second dialtone instead of the message. Receive a call and forward it to the operator immediately An incoming call can be forwarded to the operator either immediately or after a timeout. The following configuration can be used as an example: Asterisk IP PBX Configuration Now add a few lines in the IP PBX configuration for both proper routing of outgoing calls to the VoiceBlue GSM gateway and receiving calls coming from the GSM gateway to Asterisk. Outgoing Calls The core of Asterisk connection lies in the /etc/asterisk/extensions.conf file. Open this file in your favourite editor and add the following lines:
exten => _6XXXXXXXX,1,Dial(SIP/${EXTEN:0}@10.0.0.20,,r)
exten => _7XXXXXXXX,1,Dial(SIP/${EXTEN:0}@10.0.0.20,,r)
exten => _8XXXXXXXX,1,Dial(SIP/${EXTEN:0}@10.0.0.20,,r)
[voiceblue]
type=friend
disallow=all
allow=alaw
host=10.0.0.20
username=voiceblue
secret=password
permit=10.0.0.20/255.255.255.255
qualify=yes