Install Openser on EC2 Image

yum install unixODBC mysql mysql-server mysql-devel gcc bison flex
chkconfig mysqld on
service mysqld start
mysqladmin -u root password 'pass'

#to log into mysql server
mysql -u root -p
drop database test;

yum install mysql-connector-odbc
tar xvfz kamailio-1.5.1-tls_src.tar.gz
cd kamailio-1.5.1
edit Makefile and uncomment Tls=1 to compile with tls
make sure openssl, openssl-devel are installed (ec2 already are)
To enable the server_name (aka SNI) TLS extension an openssl version with TLS extension support must be installed, e.g. openssl 0.9.9 or openssl 0.9.8h. When compiling OpenSSL, run "./configure --enable-tlsext".

1.4.1. Dependencies of external libraries

Kamailio TLS support requires OpenSSL from For FreeBSD, you can either use the system OpenSSL or OpenSSL from the ports system. In Linux, it's distributed in the following packages:

  • openssl or libssl >= 0.9.6

  • openssl-dev or libssl-dev
make all include_modules="db_mysql"
make install include_modules="db_mysql"

nano /user/local/etc/kamailio/kamctlrc
uncomment SIP_DOMAIN=kamailio.local
uncomment DBHOST=localhost

/usr/local/sbin/kamdbctl create
This will create a database named 'openser' and will add a Mysql user 'openser' with full access to it. The default password is 'openserrw', do change it before (by editing /usr/local/etc/kamctlrc) or immediately after you create the database.

nano /etc/kamailio/kamailio.cfg and uncomment the following lines set to your domain (kamailio.local):
loadmodule ""

loadmodule ""
loadmodule ""

modparam("usrloc", "db_mode", 2)
modparam("usrloc", "db_url", "mysql://openser:openserrw@localhost/openser")

modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url", "mysql://openser:openserrw@localhost/openser")
modparam("auth_db", "load_credentials", "")

if (!www_authorize("", "subscriber"))
www_challenge("", "0");

if (!check_to())
sl_send_reply("403","Forbidden auth ID");

In the file /etc/odbcinst.ini  you must add:

# Driver from the MyODBC package
# Setup from the unixODBC package
Description     = ODBC for MySQL
Driver          = /usr/lib/
Setup           = /usr/lib/
FileUsage = 1

kamctl start

cd /usr/local/src
tar -xf rtpproxy-1.2.0.tar.gz
cd rtpproxy-1.2.0
make install

adduser rtpproxy -d /home/rtpproxy -s /bin/false

to start where is the ip of the server
rtpproxy -l -s udp:localhost:7722 -u rtpproxy

to stop
pid= cat "/var/run/"  2>/dev/null
kill pid

Did you check if rtpproxy is running

if it is running try to use force_sock function as shown below
modparam("nathelper", "force_socket", "udp:localhost:8899")

another option to run ur RTP proxy is

rtpproxy -F -l your-public-ip  -s udp:localhost:port-no
rtpproxy -F -l  -s udp:

if u use the above command to start rtp proxy. then change ur cfg file like
modparam("nathelper", "rtpproxy_sock", "udp:")
modparam("nathelper", "force_socket", "udp:localhost:port-no")

yum install ngrep
ngrep -d any port 5060


Post a Comment