Asterisk и IP-телефония

Just Stuff: Installing Asterisk 12 on Ubuntu 12.04 with pjproject and SRTP

Материал перенесён из старой базы знаний ATC-IP и оформлен в едином стиле нового сайта.

Just Stuff
A blog by a nerd with problems for nerds with the same problems
Wednesday, April 9, 2014
Installing Asterisk 12 on Ubuntu 12.04 with pjproject and SRTP
Today I had to install an Asterisk that could deal with WebRTC. I read
on the Asterisk wiki
that in order for it to work, it needs to be installed with pjproject and SRTP. Until today, I always used menuselect to choose what to install, but these two buddies are kind of different... they aren't selectable unless you install them before Asterisk.
As I couldn't find a guide with the steps to follow (took bits of information from different sources and figured some things by myself) here's what worked for me. I took a lot from
Asterisk 12 on a Raspberry Pi | MatthewJordan.net
so thanks to Matthew ;) I also enjoyed how he shows what he's doing, so I'm copying that from there too.
Install the Asterisk dependencies and more stuff we're going to need (I'm also installing libbfd-dev b/c want to use BETTER_BACKTRACES)
10
gmc@blog:~$
sudo
apt-get
install
build-essential libsqlite3-dev libxml2-dev libncurses5-dev libncursesw5-dev libiksemel-dev libssl-dev libeditline-dev libedit-dev curl libcurl4-gnutls-dev libjansson4 libjansson-dev libuuid1 uuid-dev libxslt1-dev liburiparser-dev liburiparser1 git autoconf libbfd-dev -y
Reading package lists... Done
...
Processing triggers
for
libc-bin ...
ldconfig deferred processing now taking place
gmc@blog:~$
Install libsrtp
We first donwload and uncompress the files (thanks to Alexander Traud for pointing me out that libsrtp moved to github)
10
11
gmc@blog:~$
cd
gmc@blog:~$ git clone https:
//github
.com
/cisco/libsrtp
.git
Cloning into
'libsrtp'
...
remote: Reusing existing pack: 2037,
done
remote: Total 2037 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2037
/2037
), 3.17 MiB | 1.30 MiB
/s
done
Resolving deltas: 100% (1249
/1249
),
done
Checking connectivity...
done
gmc@blog:~$
Then configure and make it!... I figured out the flags for ./configure by trial and error (at one point, Asterisk complained about the -fPIC flag, so I just added it)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
gmc@blog:~$
cd
libsrtp/
gmc@blog:~
/libsrtp
$ autoconf
gmc@blog:~
/libsrtp
$ .
/configure
CFLAGS=-fPIC --prefix=
/usr
checking
for
ranlib... ranlib
checking
for
gcc... gcc
checking whether the C compiler works...
yes
...
config.status: creating doc
/Makefile
config.status: creating crypto
/include/config
.h
gmc@blog:~
/libsrtp
make
gcc -DHAVE_CONFIG_H -Icrypto
/include
-I.
/include
-I.
/crypto/include
-fPIC -c srtp
/srtp
.c -o srtp
/srtp
.o
gcc -DHAVE_CONFIG_H -Icrypto
/include
-I.
/include
-I.
/crypto/include
-fPIC -c crypto
/cipher/cipher
.c -o crypto
/cipher/cipher
.o
gcc -DHAVE_CONFIG_H -Icrypto
Позвонить +7 (343) 382-33-16