Installing the Digium Asterisk GUI

Digium Asterisk GUI – web-management interface Asterisk.

Today I’ll sculpt it to Asterisk 11 on Ubuntu Server 14.04 LTS.
Switch directly to the root user:

sudo -i

Download it:

apt-get install subversion
mkdir -p ~/asterisk-gui
cd ~/asterisk-gui
svn checkout http://svn.digium.com/svn/asterisk-gui/branches/2.0/

We compile and install:

cd 2.0
./configure
make
make install

Just in case, we’ll make a copy of the Asterisk configuration files:

cp -r /etc/asterisk /etc/asterisk.original

Open the configuration file manager.conf for example in the editor nano (Ctrl+X to exit the editor, y/n to save or cancel changes):

nano /etc/asterisk/manager.conf

The main parameters that must be configured in the manager.conf configuration file are:

[general]
enabled = yes
webenabled = yes
bindaddr = 0.0.0.0
[USERNAME]
secret = PASSWORD
read = system,call,log,verbose,command,agent,user,config
write = system,call,log,verbose,command,agent,user,config

At the very end of the file, replace the symbol # with; otherwise you can not enter under the login and password specified above.

Now edit http.conf:

nano /etc/asterisk/http.conf

In it we will specify the following parameters of the web server:

enabled=yes
enablestatic=yes
bindaddr=0.0.0.0
prefix=asterisk

Let’s check the settings:

make checkconfig

Delete the empty folder and specify a link to the real one with the files of the web server:

rmdir /usr/share/asterisk/static-http/
ln -s /var/lib/asterisk/static-http/ /usr/share/asterisk/

Restarting Asterisk:

/etc/init.d/asterisk restart

Now Digium Asterisk GUI should open by link http://192.168.56.102:8088/asterisk/static/config/index.html, where 192.168.56.102 this is the IP or Server domain with Asterisk.

To log in, we’ll specify the username and password you wrote earlier in the manager.conf file

Done.

Asterisk Error Solution “Context ‘local’ tries to include nonexistent context ‘parkedcalls'”

I screwed the DAHDI board somehow and noticed the following error when I dialed the call from the analog line:

WARNING[7238]: pbx.c:12314 ast_context_verify_includes: Context ‘local’ tries to include nonexistent context ‘parkedcalls’

The error occurred because the res_parking module was not loaded to load it, open the asterisk console and execute the command:

sudo asterisk -vvr
module load res_parking

To automatically load it when starting Asterisk, in the file /etc/asterisk/modules.conf, in the [modules] block, add the line:

load => res_parking.so

Configuring FreeRADIUS DHCP for ABillS

Suppose you installed FreeRADIUS 2 as written in this article – Installation and configuration of the ABillS billing system
Now copy the dhcp.conf file into the FreeRADIUS configuration:

sudo cp /usr/abills/misc/freeradius/v2/dhcp.conf /usr/local/freeradius/etc/raddb/sites-enabled/

Continue reading “Configuring FreeRADIUS DHCP for ABillS”

The solution of the error “Unable to create channel of type ‘SIP’ (cause 20 – Subscriber absent)”

I noticed one time when I received a call from the Asterisk console:

dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 – Subscriber absent)

In the context of the dialplan, I make a call simultaneously to two phones:

exten => s,5,DIAL(SIP/204&SIP/203,19)

Sometimes one of the IP phones is turned off, which is why this error occurs, informing that there is no subscriber.
To solve it, you just need to turn on the IP phone.

You can see information about SIP in the Asterisk console:

asterisk -rvv
sip show peers
sip show peer NUMBER
quit

If the client’s IP address is null and expire is -1, the SIP client is not online:

Expire: -1
Addr->IP: (null)

Linux disk test for errors and broken sectors

Switch directly to the root user:

sudo -i

Let’s see the list of disks:

fdisk -l
df -h

You can see the information and model of the disk as follows:

hdparm -i /dev/sda

If SMART is supported, install the utilities and see the SMART statistics:

apt-get install smartmontools
smartctl -a /dev/sda
smartctl -a /dev/sda|grep -i reallocated

Run SMART tests and view information (smartctl -X to stop the long test):

smartctl -H /dev/sda
smartctl --test=long /dev/sda
smartctl -l selftest /dev/sda

Now we will perform a disk check on the broken sectors (-s will display information about scanning, -v more detailed mode):

badblocks -sv /dev/sda1

You can save the result to a file:

badblocks -sv /dev/sda1 > ~/badblocks.list

You may need to unmount the disk to check:

umount /dev/sda1

You can run the test using e2fsck like this:

e2fsck /dev/sda1

See also:
Description of SMART attributes
Diagnostics HDD using smartmontools

Installing and using iotop

iotop – a console program that displays statistics on the use of disk space.

You can install Debian, Ubuntu, Mint with the command:

sudo apt-get install iotop

In Red Hat, Fedora, CentOS:

yum install iotop

Normal startup:

iotop

Running with the option:

iotop OPTION

I’ll describe the possible startup options:
–version (view version)
-h (view help)
-o (display only active processes or threads that read or write, instead of displaying all)
-b (inclusion of non-interactive mode, convenient for example to output information to a file)
-t (display time in each line, for non-interactive mode -b)
-n NUMBER (the number of iterations after which the output will be executed, if not specified, then the output is not standardized)
-d NUMBER (the delay between iterations in seconds, you can specify not an integer, a standard value of 1)
-p PID (display statistics only for the specified processes / threads, standard for all)
-u USER (display statistics only for specified users, standard for all)
-P (display only processes)
-a (accumulation of statistics from the start of the launch of iotop)
-k (statistics in kilobytes)
-q (shortened view, some header lines are removed, when used with the -b option. There are more abbreviated, for example -qq without title names and -qqq without a general summary)