Archive for the ‘Uncategorized’ Category

How to define an Asterisk module by function name

Monday, September 16th, 2013

Asterisk has a nice function PITCH_SHIFT, which can modify caller’s/callee’s voice. Let’s imagine, we have a system without autoloaded modules, and we need to find which module provides this function.

1. Go to the astmoddir (I have a Debian system):

cd /usr/lib/asterisk/modules

2. Find.

root@voiprouter1:/usr/lib/asterisk/modules# grep PITCH *
Binary file func_pitchshift.so matches
root@voiprouter1:/usr/lib/asterisk/modules#

3. We can also find the dependencies:

root@voiprouter1:/usr/lib/asterisk/modules# ldd func_pitchshift.so
linux-gate.so.1 => (0xb776e000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xb7747000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb75e4000)
/lib/ld-linux.so.2 (0xb776f000)

4. That’s it! Thanks to meral.

OpenBSD pkg_add: flavours

Tuesday, August 20th, 2013

Use pkg_add -i to choose from package flavours.

Package description (pkg_info asterisk) tells us that it can be standard or have IMAP flavour:
Asterisk supports Voice over IP in many protocols, and can
interoperate with almost all standards-based telephony equipment
using relatively inexpensive hardware.

Flavours:

IMAP - use imap for voicemail storage instead of files.

Maintainer: Stuart Henderson

WWW: http://www.asterisk.org/

Installation:
# pkg_add -ivvv asterisk

Ambiguous: choose package for asterisk
a 0:
1: asterisk-10.12.1
2: asterisk-10.12.1-imap
Your choice: 2

Digium Certified Asterisk Administrator (dCAA)

Wednesday, July 10th, 2013

Now I am a Digium Certified Asterisk Administrator (dCAA).
dcaa

SalixOS, OpenVPN and iproute2

Tuesday, June 25th, 2013

I have an OpenVPN server through which its clients get some routes. One client with SalixOS had an error while connecting to the server:
Linux ip link set failed: could not execute external program
The reason is that OpenVPN client sets the routes with the ‘ip’ command. But Salix doesn’t install the iproute2 package by default. Install it and the connection will be finished.

Openvpn >= 2.1, Windows and *nix clients, topology subnet, client-to-client

Thursday, June 6th, 2013

If you have both Windows and *nix clients in your OpenVPN implementation and need them to be able to communicate with each other (‘client-to’client’ option in the server configuration file), you may face the problem on Windows, while using the stable version of OpenVPN GUI. It’s based on 2.0 OpenVPN, which doesn’t have the ability to handle client connection with /24 subnet mask, and we strongly need it.
In such a case use the development version of OpenVPN GUI. For this moment (June 6, 2013) it is OpenVPN 2.1_beta7 & OpenVPN GUI 1.0.3. The trick is that OpenVPN supports ‘topology xxx’ directive starting from the 2.1 version, and the development package (as for today) for Windows is based on it.
Your Windows client’s configuration file should be similar to this:

client
dev tun
proto udp
remote IP.ADD.RE.SS 1194
topology subnet
nobind
persist-key
persist-tun
;
ca "c:\\program files\\openvpn\\ca.crt"
cert "c:\\program files\\openvpn\\client5.crt"
key "c:\\program files\\openvpn\\client5.key"
;
comp-lzo
verb 3

UPDATE: as for now (January 30, 2018) Windows version is available from other location: https://openvpn.net/index.php/open-source/downloads.html
Howto: https://community.openvpn.net/openvpn/wiki/Easy_Windows_Guide

Asterisk 1.8, Debian package, no app_meetme.so

Thursday, May 30th, 2013

If you’ve installed Asterisk 1.8 from Debian repository and do not have app_meetme, install the asterisk-dahdi package.

Switching from analog telephony to IP

Friday, May 24th, 2013

Few days ago we successfully implemented the switching from analog to IP telephony in one company, the name of which we keep in secret due to the privacy policy.
The ‘uplink’ still remains analog, consisting of 15 PSTN lines (the client’s requirement). All 40 office phones now are SIP ones.
Eltex TAU-32M.IP VoIP gateway was used in conjunction with AsteriskNOW (client’s requirement, they wanted to have some web-interface at least to look for the system, what is happening inside) on the HP ProLiant DL160 Gen8 server.
tau32m_ip
SIP phones are Fanvil C56, Gigaset C610A IP and top Digium’s model – D70.

Asterisk: contactpermit and contactdeny

Thursday, May 23rd, 2013

We can control in the [general] section of the sip.conf from which IP-addresses the device can register against our Asterisk server. This could be achieved with the ‘contactpermit‘ and ‘contactdeny‘ parameters:

contactdeny=0.0.0.0/0.0.0.0
contactpermit=10.145.13.0/255.255.255.0
contactpermit=10.145.14.0/255.255.255.0

The example above denies to register from any IP address and allows registration for devices which have 10.145.13.x or 10.145.14.x address.

Note, that these are separate options, besides ‘deny=x.x.x.x/x.x.x.x’ and ‘permit=x.x.x.x/x.x.x.x’, which are set in your SIP peers sections.

Sarg on CentOS 6.3

Tuesday, April 30th, 2013

I never used CentOS before. That’s why this

note may be helpful for me in future.

Add the RepoForge repository to your CentOS system: http://repoforge.org/use/

Edit ‘/etc/yum.repos.d/rpmforge.repo‘ by changing ‘enabled = 0‘ to ‘enabled = 1‘ in second and third sections – in [rpmforge-extras] and [rpmforge-testing] respectively.

Update the yum repository cache.

Install sarg.

If you’ll get an error ‘SARG: (grepday) Fontname /usr/share/sarg/fonts/DejaVuSans.ttf not found‘ and there is no file DejaVuSans.ttf on your file system at all, download it and put somewhere, and add the according line in sarg.conf.
Without this error fixed, sarg will not generate the main index.html file, even if you commented out any options concernng graphs creating (‘graph_font /usr/share/fonts/DejaVuSans.ttf‘ and ‘graphs no‘). That is why it’s so important.

Asterisk & IPtables

Tuesday, January 22nd, 2013

A good starting place is a set of rules similar to this one:

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p udp --dport 5060 -j ACCEPT
iptables -A INPUT -p udp --dport 10000:20000 -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -P INPUT DROP