Asterisk warning “leave_voicemail: No more messages possible”

I noticed the following error on one of the servers:

WARNING[21992][C-00000b27]: app_voicemail.c:6559 leave_voicemail: No more messages possible

It turned out that the mailbox was full of voice messages and they ceased to exist, in response the caller was informed “The subscriber’s voice box is full”.

To solve this problem there are several options:

1) Delete the messages in the voice mailbox by calling the voice mail number.

2) Increase the value of maxmsg in the voicemail.conf file, thereby increasing the maximum number of messages in the mailbox, but again it may be full. After the changes in the voicemail.conf file, you need to apply them:

sudo asterisk -rvv
voicemail reload
quit

3) In the context of the voice mailbox, add delete=yes, for example:

[voicemailcontext]
207 => 1111,Username,test@example.com,,attach=yes|tz=ua|delete=yes

In this case, voice messages will be sent to e-mail, and they will be immediately deleted from the server, that is, they can not be listened to by calling to the voice mail number and accordingly the mailbox will never be full. I consider this option the best.

See also:
Setting up voicemail in Asterisk

IPTables rules for FTP server

To open access to the FTP server in IPTables, you need to add rules:

sudo iptables -A INPUT -p tcp --dport 21 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 20 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 1024:1030 -j ACCEPT

To only allow access to a particular network, for example 192.168.1.0/24:

sudo iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 21 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 20 -j ACCEPT
sudo iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 1024:1030 -j ACCEPT

To remove a rule, we’ll specify the same command, replacing -A with -D, for example:

sudo iptables -D INPUT -p tcp --dport 21 -j ACCEPT
sudo iptables -D OUTPUT -p tcp --sport 20 -j ACCEPT
sudo iptables -D INPUT -p tcp --dport 1024:1030 -j ACCEPT

To view the list of rules, use the command:

sudo iptables -nvL

1024-1030 – example ports for passive mode are specified in the FTP server configuration, for example for ProFTPd are specified in the /etc/proftpd/proftpd.conf file as follows:

PassivePorts 1024 1030

See also my articles:
Configuring IPTables
Active and passive FTP mode
Installing and Configuring Pure-FTPd in Ubuntu
Installing and Configuring ProFTPd in Ubuntu

How to format UDF Volume in Ubuntu

I recently wanted to format the USB flash drive in the Ubuntu operating system, but since it was in UDF format, formatting was refused and many programs did not see it as a flash drive.

To begin with, let’s look at the discs:

sudo fdisk -lu

Then the solution was to execute the following command:

sudo shred -vzn 0 /dev/sdc

After that, the flash drive can be formatted by any program.

Install and configure lm-sensors

Run the command to install the utility in Ubuntu / Debian:

sudo apt-get install lm-sensors sensord

We introduce the sensor detection command:

sudo sensors-detect

Information about detected sensors will be recorded in the file /etc/modules

Let’s review the sensor data:

sensors

I’ll describe some of the start keys sensors:
-c, –config-file (specifying the configuration file)
-h, –help (display help)
-s, –set (execution of `set ‘messages (only from root)
-f, –fahrenheit (temperature display in fahrenheit)
-A, –no-adapter (do not show the adapter for each chip)
–bus-list (generating bus messages for sensors.conf
-u (raw conclusion)
-v, –version (display version of the program)

Installing and Configuring SNMPD + MRTG

MRTG (Multi Router Traffic Grapher) – a tool for displaying various data in graphs.

The installation command in Ubuntu/Debian:

sudo apt-get install mrtg snmp snmpd

In CentOS:

yum install mrtg net-snmp net-snmp-utils

The command below can tell you which additional modules are in the repository:

apt-cache search mrtg

Open the configuration file /etc/snmp/snmpd.conf

sudo nano /etc/snmp/snmpd.conf

Comment on the line:

com2sec paranoid default public

And uncomment the line:

com2sec readonly default public

Restart snmpd so that changes to the configuration file take effect:

sudo /etc/init.d/snmpd restart

You can check snmp by commands:

netstat -nlp | grep snmpd
snmpwalk -v2с -c public localhost

Beginners can generate a simple configuration file with the command:

sudo cfgmaker public@localhost >> /etc/mrtg.cfg

where public is the name of the community (the password is in other words), and localhost is the host address or ip.

Example of starting the configuration file /etc/mrtg.cfg:

WorkDir: /var/www/mrtg
Options[_]: growright, bits, nobanner
Background[_]: #B0C4DE
EnableIPv6: no
Language: russian
EnableSnmpV3: no
Interval: 10
Refresh: 600
Include: /etc/mrtg/server1.cfg
Include: /etc/mrtg/server2.cfg

Create the working directory:

sudo mkdir /var/www/mrtg

Then you must write or generate the index.html file with the command:

sudo indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html

We look at the log /var/log/mrtg.log so that there are no errors.

Here is an example of setting up SNMP on D-Link switches:

private CommunityView Read Write
public CommunityView Read Only

Example of a manual start script (mrtg.sh):

#!/bin/bash
#run mrtg
LANG=C
export $LANG
/usr/bin/mrtg /etc/mrtg.cfg --logging /var/log/mrtg.log

IPTables rules for Samba

To open access to Samba in IPTables, you must add four rules at once:

sudo iptables -A INPUT -p udp -m udp --dport 137 -j ACCEPT
sudo iptables -A INPUT -p udp -m udp --dport 138 -j ACCEPT
sudo iptables -A INPUT -p tcp -m tcp --dport 139 -j ACCEPT
sudo iptables -A INPUT -p tcp -m tcp --dport 445 -j ACCEPT

To only allow access to a particular network, for example 192.168.1.0/24:

sudo iptables -A INPUT -s 192.168.1.0/24 -p udp -m udp --dport 137 -j ACCEPT
sudo iptables -A INPUT -s 192.168.1.0/24 -p udp -m udp --dport 138 -j ACCEPT
sudo iptables -A INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 139 -j ACCEPT
sudo iptables -A INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 445 -j ACCEPT

To remove a rule, we’ll specify the same command, replacing -A with -D, for example:

sudo iptables -D INPUT -s 192.168.1.0/24 -p udp -m udp --dport 137 -j ACCEPT
sudo iptables -D INPUT -s 192.168.1.0/24 -p udp -m udp --dport 138 -j ACCEPT
sudo iptables -D INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 139 -j ACCEPT
sudo iptables -D INPUT -s 192.168.1.0/24 -p tcp -m tcp --dport 445 -j ACCEPT

To view the list of rules, use the command:

sudo iptables -nvL

See also my articles:
Configuring IPTables
Installing and Configuring Samba on Linux

Installing and Configuring PostgreSQL in Ubuntu

The installation command in Ubuntu:

sudo apt-get install postgresql postgresql-client postgresql-contrib

You can install a graphical client for easy management:

sudo apt-get install pgadmin3

or

sudo apt-get install phppgadmin

To access from outside, open the configuration file (Ctrl + X to exit):

sudo nano /etc/postgresql/9.3/main/postgresql.conf

And uncomment the line:

listen_addresses = 'localhost'

In the pg_hba.conf file, we specify which addresses are allowed access:

host all all 192.168.0.1/32 md5

Restart PostgreSQL so that the changes to the configuration files take effect:

sudo service postgresql restart

Here is the password for the postgres user:

sudo -u postgres psql
ALTER USER postgres with encrypted password 'PASSWORD';
CTRL+Z

An example of testing a connection from a remote computer:

psql -h СЕРВЕР -U postgres -W

If PostgreSQL is to be used with Apache2, then we’ll install the other components:

sudo apt-get install apache2 libapache2-mod-php5 php5 php5-common php5-gd php5-pgsql

Solution of the error “Using unique option prefix pass instead of password is deprecated …”

I noticed some errors coming to the root mail with the subject and the text:

Cron /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.

The problem lies in the file ~ / .my.cnf, that is /root/.my.cnf in my case.

In which the parameter “pass” is obsolete and must be changed to a new “password”.

For example, that’s how it was when the error occurred:

[client]
user=root
pass=password

Changed to password and the error disappeared:

[client]
user=root
password=password

See also:
Connecting to MySQL from localhost without entering a password