To allow SIP connection in IPTables, add rules (the first for connections, the second for voice traffic):
Continue reading “IPTables rules for Asterisk”Category Archives: Linux
Packet capturing with tcpdump
tcpdump – A utility that allows you to intercept and analyze network traffic.
Continue reading “Packet capturing with tcpdump”Adding SIP clients to Asterisk
SIP clients in Asterisk are specified in the sip.conf file, so open it for example in the nano text editor (Ctrl+X to exit the editor, y or n to save or discard changes):
Continue reading “Adding SIP clients to Asterisk”Adding a SIP client to FreePBX
To add a SIP client to FreePBX, open the menu “Applications” – “Extensions“, choose for example “Generic CHAN SIP Device” and we indicate the main parameters:
User Extension: 6000 (SIP number)
Display Name: Operator (any name to display)
Secret: PASSWORD
and click “Submit“.
Done, SIP is added, it can already be registered at the specified number and password.
How to add SIP in the configuration file I described in this article – Adding SIP clients to Asterisk
Solving the error “insserv: warning: script ‘script’ missing LSB tags and overrides”
I noticed once the following error:
insserv: warning: script ‘MyScript.sh’ missing LSB tags and overrides
It appears because someone wrote the /etc/init.d/MyScript.sh script before writing the LSB tags first.
To fix this, I opened the script code in a text editor (in the editor nano Ctrl+X to exit, y/n to save or cancel changes):
sudo nano /etc/init.d/MyScript.sh
And added in the beginning:
### BEGIN INIT INFO # Provides: MyScript # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 1 0 6 # Short-Description: ... # Description: ... ### END INIT INFO
See also:
Run application at startup in Ubuntu
Installing Asterisk + FreePBX
Today I will install Asterisk on Ubuntu Server 14.04 LTS and FreePBX 12 as a management interface.
Continue reading “Installing Asterisk + FreePBX”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.
Solution to the Asterisk problem – no sound when calling via NAT
I noticed recently that there is no sound when calling from IP-phone to another IP-phone which were both behind the same NAT (router).
Continue reading “Solution to the Asterisk problem – no sound when calling via NAT”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 Asterisk CDR and Asterisk CDR Viewer
CDR (Call Data Record), allows you to keep statistics on call activity in the MySQL database.
Continue reading “Configuring Asterisk CDR and Asterisk CDR Viewer”