LABORATORIUM 1 Setup and basic configuration of Asterisk BPX on Linux 1. VM setup Please download Asterisk Virtual Machine from http://kt.agh.edu.pl/~rzym/lectures/ti- SSiZ/VMAsterisk.zip and extract archive. Then, please start VM with default properties (after the question about VM relocation please select I ve copied it and skip installation of VMWare-Tools). 2. Setup the Asterisk BPX on Debian 7 To install Asterisk on Debian 7 please follow the sequence of commands as root user: $su #apt-get update #apt-get install linux-headers-`uname -r` libxml2-dev ncurses-dev libsqlite3-dev sqlite3 build-essential automake autoconf bison flex libtool libncurses5-dev libssl-dev subversion svn-buildpackage uuiddev Next, please unpack archives containing DAHDI and Asterisk sources (placed in /home/student directory) using following commands: #tar xf dahdi* #tar xf asterisk* After that please compile and install DAHDI and Asterisk software following the sequence: #cd dahdi* #make #make install #make config #/etc/init.d/dahdi start #cd../aster* #./configure #make menuconfig Please select app_meetme from applications menu! To exit press the q and save file. #make #make install #make samples #make config Now, you should have properly installed Asterisk software. Please start Asterisk daemon by using the command: #/etc/init.d/asterisk start 1
a) What is DAHDI? b) What does the command make menuconfig during Asterisk installation? What changes are possible? c) What is app_meetme application? 3. Asterisk CLI Please type the following to connect to the asterisk server: #asterisk vvvvvvr After running the above command you ll see (or something similar): Connected to Asterisk 11.5.1 currently running on pbx (pid = 1799) CLI> Congratulations! You have a running PBX. Please list available commands. a) What does the vvvvvvr parameter of Asterisk command? b) What happens when you change the number of repetitions of the letter v in the Asterisk command? What is the minimum and maximum number of repetitions of letter v? c) What commands list the number of peers and users configured in the PBX? Please place the results of proper commands. d) What is a different between peer and user? e) How the BPX can be restarted from CLI? 4. Basic configuration All Asterisk s configuration files are located in /etc/asterisk directory. Each change of configuration requires Asterisk s daemon restart, e.g. with command: #/etc/init.d/asterisk restart Please refer to the stucture of sip.conf and extensions.conf file. To make calls the numbers of users, their passwords and dialplan have to be configured. Please try to find relevant lines of configuration files. 2
5. Example configuration Please create backup of sip.conf and extensions.conf file e.g., running: #mv /etc/asterisk/sip.conf /etc/asterisk/sip.conf.bak #mv /etc/asterisk/sip.conf /etc/asterisk/sip.conf.bak Then, please create new sip.conf file with the following content: [general] context = default bindport = 5060 bindaddr = 0.0.0.0 tcpbindaddr = 0.0.0.0 tcpenable = yes [group1] type = peer context = group1 secret = 1234 insecure = invite host = dynamic canreinvite = no dtmfmode = rfc2833 disallow = all allow = ulaw transport = udp [1001](group1) callerid = OneOne <1001> [1002](group1) callerid = OneTwo <1002> [1003](group1) callerid = OneThree <1003> This configuration contains three users with numbers: 1001, 1002, 1003. Each of them belongs to the group1 group. Please pay attention to the group settings important to configure your softphone (especially the password = secret). 3
Next, you should create new extensions.conf file in order to allow to make calls, e.g.: [general] static=yes writeprotect=no [default] [group1] exten => 1001,1,Answer() same=> n,dial(sip/1001,20,tr) same=> n,hangup After that please restart asterisk service: #/etc/init.d/asterisk restart 6. Installation and configuration of Windows softphone (X-Lite) To make call you have to install software that supports SIP protocol. The recommended program will be installed on Windows. Please download http://www.kt.agh.edu.pl/~rzym/lectures/ssam/x-lite_win32_4.7.1_74247.exe and install it (don create desktop shortcut and uncheck the automatic start of application with the operating system). Sample configuration for X-lite softphone is shown in the picture below: 4
Important note: Domain IP is IP address of VM with Asterisk preinstalled. User name and password are placed in Asterisk s configuration file (sip.conf). More info in next point. 7. Traffic and signaling observation Traffic should be observed by using Wireshark on Windows or tcpdump on Linux. Please try to make call with asterisk CLI enabled: #asterisk vvvvvvr and follow the steps indicated by the Asterisk CLI. Please briefly describe each step of call establishment process using proper lines from Asterisk CLI and Wireshark. 5