HOWTO: Asterisk Installation [27.05.2005] by Thomas May, www.asteriskfreaks.com + Hardware enviroment: Standard PC with Intel Pentium CPU or similar ... ! there are problems with via mainboards, please look into the forum 1xS0 (onebri) ISDN Card with HFC-Chip from conrad electronic for example 4xS0 (quadbri) ISDN Card with HFC-Chip ! if you have a fritzcard pci card use the chan_capi driver instead, but remember only the hfc-chip isdn cards can can switch between nt and te modus by software ! + Software enviroment: newest bristuff driver from junghanns.net + Install Fedora Core2 or Core 3 Linux from cdrom install Redhat Fedora Core 2 or 3 Linux on your pc choose the installation type custom ! later, please deselect all install packages, so that you get a small system + Install some nice Tools for Linux install midnight commander if you are afraid from using vi, use mc -a for the correct view download the rpm from http://fedora.redhat.com/ for fedora core 2 use this link: http://download.fedora.redhat.com/pub/fedora/linux/core/2/i386/os/Fedora/RPMS/ # rpm -uvh mc-4.6.0-15.i386.rpm you can set an alias with # alias midc ='mc -a' + the following rpm packages are needed on your pc. copy them into /var/rpms. you can get them from your install cds or from the redhat.fedora.com download server. you need for fedora core 2: 1. RPMS for asterisk cvs-1.11.15-2.i386.rpm cpp-3.3.3-7.i386 bison-1.875-7.1.i386.rpm e2fsprogs-devel-1.3.3-1.i386.rpm krb5-devel-2.3.3-27.i386.rpm glibc-kernheaders-2.4-8.44.i386.rpm glibc-headers-2.3.3-1.i386.rpm glibc-devel-2.3.3-27.i386.rpm gcc-3.3.3-7.i386.rpm zlib-devel-1.2.1.1-2.1.i386.rpm openssl-devel-0.9.7a-35.i386.rpm binutils-2.15.90.0.3-5.i386.rpm m4-1.41.15.i386.rpm 2. RPMS for MySQL mysql-3.23.58-9.i386.rpm mysql-server-3.23.58-9.i386.rpm mysql-developer MySQL-shared-3.23.54a-1.i386.rpm perl-DBD-MySQL-2.9003-4.i386.rpm perl-DBI-1.40-4.i386.rpm 3. RPMS for Apache/PHP apr-0.9.4-11.i386.rpm apr-util-0.9.4-14.i386.rpm curl-7.12.1-1.i386.rpm httpd-2.0.49-4.i386.rpm php-4.3.9-3.i386.rpm php-mysql php-pear-4.3.9.3.i386.rpm you need for fedora core 3: 1. RPMS for asterisk cvs-1.11.17-3.i386.rpm cpp-3.4.2-6.fc3.i386.rpm libidn-devel-0.5.6.1.i386.rpm bison-1.875c-2.i386.rpm e2fsprogs-devel-1.35-11.2.i386.rpm krb5-devel-1.3.4-7.i386.rpm glibc-kernheaders-2.4-9.1.87.i386.rpm glibc-headers-2.3.3-74.i386.rpm glibc-devel-2.3.3-74.i386.rpm gcc-3.4.2-6.fc3.i386.rpm zlib-devel-1.2.1.2-1.i386.rpm openssl-devel-0.9.7a-40.i386.rpm 2. RPMS for MySQL mysql- mysql-server- mysql-developer MySQL-shared- perl-DBD-MySQL- perl-DBI- 3. RPMS for Apache/PHP + Download and Install Asterisk i will explain you three ways of installing asterisk (1) install the latest stable release with cvs download the latest sourcecode from digium. # cd /usr/src # export CVSROOT=:pserver:anoncvs@cvs.digium.com:/usr/cvsroot # cvs login (the password is anoncvs) # cvs co -r v1-0-7 asterisk zaptel libpri compile the source code in the following order 1. zaptel 2. libpri 3. asterisk 4. asterisk-addons change to that directories and # make # make install (2) install the development (HEAD) version of asterisk download the latest sourcecode from digium. # cd /usr/src # export CVSROOT=:pserver:anoncvs@cvs.digium.com:/usr/cvsroot # cvs login (the password is anoncvs) # cvs checkout zaptel libpri asterisk asterisk-sounds asterisk-addons (can use checkout or the short version co) compile and install the source code in the following order 1. zaptel 2. libpri 3. asterisk 4. asterisk-addons # cd zaptel # make clean; make install # cd ../libpri # make clean; make install # cd ../asterisk # make clean; make install (3) install asterisk with euro isdn card support (bristuff for cards mit hfc-chipset) download and extract the newest bristuff version from junghanns.net and put it into /usr/src/asterisk set a symbolic into /usr/src # ln -s /lib/modules/2.6.5...(your version)/build linux-2.6 change into that directory and execute # ./install.sh now the newest version of asterisk,zaptel,libri will be downloaded automatically + Install sample asterisk .conf files change to the asterisk directory and # make samples to get the default asterisk .conf files into /etc/asterisk + Install mpg123 to have music on hold an mp3 file support change to the /usr/src/astersik/asterisk1.x folder start compiling and installation with # make mpg123 # make install + Upgrading Asterisk Use cvs to update your Asterisk source code. check the new version with CLI command SHOW VERSION. # cd /usr/src/asterisk # make update + install and config asterisk-addons --------------------------------------------------------------------------------------------------------- + if you have a 1S0 (onebri) HFC-PCI card in your computer edit the zaphfc/zapata.conf file and copy it to /etc/asterisk copy the zaphfc/zaptel.conf file to /etc Loading the drivers manual(zaphfc): # cd zaphfc # make load (for TE mode) or # make loadNT (for NT mode) + if you have a 4S0 (quadBRI) card, edit the qozap/zapata.conf file and copy it to /etc/asterisk copy the qozap/zaptel.conf file to /etc Loading the drivers manual(quadBRI): # cd qozap # modprobe zaptel # insmod qozap.o (for kernel 2.4) or # insmod qozap.ko (for kernel 2.6) # ztcfg check the configuration # ztcfg -vv --------------------------------------------------------------------------------------------------------- + Start Asterisk at bootime copy the file /usr/src/asterisk/asterisk-1.0.2/redhat/asterisk to /etc/init.d put the lines for starting the isdn cards from above in this asterisk bootfile after the line RETVAL=0 shows all programms starting at boottime # chkconfig --list turn it on or off at boottime # chkconfig asterisk on/off start/stop it manually # service asterisk on/off + Settings to have sendmail outgoing mails work change the /etc/hosts file. thats all. you need a domain with a mx record, and email account on the mailserver. # vi /etc/hosts 127.0.0.1 x9media.com localhost.localdomain localhost asterisk + Install apache webserver with php support on fedora core linux your directory is /root # cd /root go to download ftp.fedora.redhat.com # ftp download.fedora.redhat.com enter username: anonymous and as passwort: willi@web.de change directory ftp> cd /pub/fedora/linux/core/2/i386/os/Fedora/RPMS download and install needed rpms in this sort ftp> get httpd-2.0.49-4.i386.rpm ftp> get php-4.3.4-11.i386.rpm # rpm -Uvh httpd-2.0.49-4.i386.rpm # rpm -Uvh php-4.3.4-11.i386.rpm config apache for autostart at boottime # chkconfig httpd start apache manually now # /etc/init.d/httpd start set a symbolic link from the root # ln -s /var/www/html /www change the config files for apache and php if you want # vi /etc/httpd/conf/httpd.conf # vi /etc/php.ini remember: php.ini is only as sample file on the server, rename it to php.ini, if you want to use it, restart apache + Install mysql server your directory is /root # cd /root go to download ftp.fedora.redhat.com # ftp download.fedora.redhat.com enter username: anonymous and as passwort: willi@web.de change directory ftp> cd /pub/fedora/linux/core/2/i386/os/Fedora/RPMS download and install needed rpms in this sort ftp> get perl-DBI-1.40-4.i386.rpm ftp> get perl-DBD-MySQL-2.9003-4.i386.rpm ftp> get mysql-3.23.58-9.i386.rpm MySQL-shared-3.23.54a-1.i386.rpm / search over google, download to local disk, and upload with winscp to the asterisk server into /root dir # rpm -Uvh perl-DBI-1.40-4.i386.rpm # rpm -Uvh MySQL-shared-3.23.54a-1.i386.rpm # rpm -Uvh perl-DBD-MySQL-2.9003-4.i386.rpm # rpm -Uvh mysql-3.23.58-9.i386.rpm config mysql for autostart at boottime # chkconfig mysqld start mysql manually now # /etc/init.d/mysqld start + Install asterisk with cdr backend mysql download an independent odbc driver from www.unixodbc.org # ./configure --disable-gui # make # make install you now have installed the following files, change them for oyur need /usr/lib/libmyodbc.so /etc/odbcinst.ini /etc/odbc.ini + the directroy structure from asterisk /etc/asterisk location of the main config files /var/log/asterisk statistics /var/lib/asterisk soundfiles /usr/lib/asterisk /usr/lib/asterisk/modules /usr/include/asterisk + cli commands for asterisk console # asterik -vvvvc start asterisk with console # asterik -r connect to a asterisk console CLI> reload reload configuration CLI> show dialplan CLI> sip show users CLI> sip show channels CLI> stop gracefully end asterisk after all calls are finished CLI> stop now end asterisk + fedora core linux updaten # yum update + yum update with fc3 # key import # rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora # yum update + Agenda NT-Modus = Network Termination = you can connect isdn hardware like phones on it (internal S0) TE-Modus = Terminal Equipment = only for bri connect like the NTBA (external S0) + install german voicefiles download the file from http://www.stadt-pforzheim.de/asterisk/ just copy the whole diretory to /var/lib/asterisk/sounds for example with winscp with the application command setLanguage in the extensions.conf file you change the current language + some nice links testyourvoip.com + festival, the computer voice coming soon... + record in waveformat samplerate 44.1 Khz, mono, 16 Bit use: sox hello.wav -r 8000 -c 1 hello.gsm resample -ql + update grandstream bt phones with tftp desktop install tftp desktop on your pc, google for it get the latest firmware form grandstream, www.grandstream.com/BETATEST but them into the upload directory from tftp desktop on the grandstream config menu, enter the ip number of your pc if your restart your telefon, you can see on the tftp desktop windown, the upload process