分类目录

Howto: RTPproxy Installation Guide

The Sippy RTPproxy is a high-performance software proxy server for RTP streams that can work together with SIP Express Router (SER), OpenSIPS, Kamailio, Sippy B2BUA or reSIProcate B2BUA.

The main purpose of RTPproxy originally had been to make the communication between SIP user agents behind NAT(s) (Network Address Translator) possible.

Homepage: http://www.rtpproxy.org/

1. Installation
Download the package

# cd ~
# wget http://b2bua.org/chrome/site/rtpproxy-1.2.1.tar.gz
# tar zxvf rtpproxy-1.2.1.tar.gz
# cd rtpproxy-1.2.1

Make and install

# ./configure
# make
# make install

2. Running with Kamailio

# rtpproxy -l xxx.xxx.xxx.xxx -s udp:localhost 7722 -u ftp

Howto: Kamailio (OpenSER) Installation Guide

Kamailio (former OpenSER) is an Open Source SIP Server released under GPL, able to handle thousands of call setups per second.

Homepage: http://www.kamailio.org

1. Installation
Download the source package

# cd ~
# wget http://www.kamailio.org/pub/kamailio/latest/src/kamailio-3.1.3_src.tar.gz
# tar zxvf kamailio-3.1.3_src.tar.gz
# cd kamailio-3.1.3
# make FLAVOUR=kamailio cfg

Modify “modules.lst”, Remove db_mysql from the variable exclude_modules.

# make all
# make install

The Kamailio was installed in “/usr/local/sbin”, the configuration file was installed in “/usr/local/etc/kaimailio”

kamailio - Kamailio (OpenSER) server
kamdbctl - script to create and manage the Databases
kamctl - script to manage and control Kamailio (OpenSER) server
sercmd - CLI - command line tool to interface with Kamailio (OpenSER) server

2. Configuration
Config the enviroment variables

# cat /usr/local/etc/kamailio/kamctlrc
# $Id$
#
# The Kamailio configuration file for the control tools.
#
# Here you can set variables used in the kamctl and kamdbctl setup
# scripts. Per default all variables here are commented out, the control tools
# will use their internal default values.

## your SIP domain
# SIP_DOMAIN=kamailio.org
SIP_DOMAIN=hzserver1

## chrooted directory
# $CHROOT_DIR="/path/to/chrooted/directory"

## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, or DBTEXT, by default none is loaded
# If you want to setup a database with kamdbctl, you must at least specify
# this parameter.
# DBENGINE=MYSQL
DBENGINE=MYSQL

## database host
# DBHOST=localhost
DBHOST=localhost

## database name (for ORACLE this is TNS name)
# DBNAME=openser
DBNAME=openser

# database path used by dbtext or db_berkeley
# DB_PATH="/usr/local/etc/kamailio/dbtext"

## database read/write user
# DBRWUSER=openser
DBRWUSER=openser

## password for database read/write user
# DBRWPW="openserrw"
DBRWPW="openserrw"

## database read only user
# DBROUSER=openserro
DBROUSER=openserro

## password for database read only user
# DBROPW=openserro
DBROPW=openserro

## database super user (for ORACLE this is 'scheme-creator' user)
# DBROOTUSER="root"
DBROOTUSER="root"

# user name column
# USERCOL="username"
USERCOL="username"

# SQL definitions
# If you change this definitions here, then you must change them
# in db/schema/entities.xml too.
# FIXME

# FOREVER="2020-05-28 21:32:15"
# DEFAULT_ALIASES_EXPIRES=$FOREVER
# DEFAULT_Q="1.0"
# DEFAULT_CALLID="Default-Call-ID"
# DEFAULT_CSEQ="13"
# DEFAULT_LOCATION_EXPIRES=$FOREVER

# Program to calculate a message-digest fingerprint
# MD5="md5sum"

# awk tool
# AWK="awk"

# If you use a system with a grep and egrep that is not 100% gnu grep compatible,
# e.g. solaris, install the gnu grep (ggrep) and specify this below.
#
# grep tool
# GREP="grep"

# egrep tool
# EGREP="egrep"

# sed tool
# SED="sed"

# tail tool
# LAST_LINE="tail -n 1"

# expr tool
# EXPR="expr"

# Describe what additional tables to install. Valid values for the variables
# below are yes/no/ask. With ask (default) it will interactively ask the user
# for an answer, while yes/no allow for automated, unassisted installs.
#

# If to install tables for the modules in the EXTRA_MODULES variable.
# INSTALL_EXTRA_TABLES=ask

# If to install presence related tables.
# INSTALL_PRESENCE_TABLES=ask

# Define what module tables should be installed.
# If you use the postgres database and want to change the installed tables, then you
# must also adjust the STANDARD_TABLES or EXTRA_TABLES variable accordingly in the
# kamdbctl.base script.

# Kamailio standard modules
# STANDARD_MODULES="standard acc lcr domain group permissions registrar usrloc msilo
# alias_db uri_db speeddial avpops auth_db pdt dialog dispatcher
# dialplan"

# Kamailio extra modules
# EXTRA_MODULES="imc cpl siptrace domainpolicy carrierroute userblacklist htable purple"

## type of aliases used: DB - database aliases; UL - usrloc aliases
## - default: none
# ALIASES_TYPE="DB"

## control engine: FIFO or UNIXSOCK
## - default FIFO
# CTLENGINE="FIFO"

## path to FIFO file
# OSER_FIFO="FIFO"

## check ACL names; default on (1); off (0)
# VERIFY_ACL=1

## ACL names - if VERIFY_ACL is set, only the ACL names from below list
## are accepted
# ACL_GROUPS="local ld int voicemail free-pstn"

## verbose - debug purposes - default '0'
# VERBOSE=1
VERBOSE=1

## do (1) or don't (0) store plaintext passwords
## in the subscriber table - default '1'
# STORE_PLAINTEXT_PW=0

## OPENSER START Options
## PID file path - default is: /var/run/kamailio.pid
# PID_FILE=/var/run/kamailio.pid
PID_FILE=/var/run/kamailio.pid

## Extra start options - default is: not set
# example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64"
# STARTOPTIONS=
STARTOPTIONS="-u ftp"

Add the following lines in the config file.

# cat /usr/local/etc/kamailio/kamailio.cfg
......
#!define WITH_MYSQL
#!define WITH_AUTH
#!define WITH_USRLOCDB
#!define WITH_NAT
......

Create MySQL database (Do change the passwords for these two users immediately after the database is created)

# /usr/local/sbin/kamdbctl create

3. Start the Kamailio

# /usr/local/sbin/kamailio

4. Monitor the Kamailio

# /usr/local/sbin/kamctl moni

5. Add user

# kamctl add 80001 80001

Refer to:
http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.1.x-from-git

Howto: FFmpeg build in Windows & Linux

FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec – the leading audio/video codec library.

Homepage: http://ffmpeg.org/

1. Linux
Test release: http://ffmpeg.org/releases/ffmpeg-0.6.2.tar.gz

# cd ~/ffmpeg
# wget http://ffmpeg.org/releases/ffmpeg-0.6.2.tar.gz
# tar zxvf ffmpeg-0.6.2.tar.gz
# cd ffmpeg-0.6.2
# ./configure
# make

Example code: ~/ffmpeg/ffmpeg-0.6.2/libavcodec/api-example.c

# cd ~/ffmpeg/ffmpeg-0.6.2
# cp ./lib*/*.a .
# cp ./libavcodec/api-example.c .
# touch Makefile.test

Test Makefile:

CC=gcc
CFLAGS=-I. -L. -L/usr/lib -lm -lz -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswscale -lavutil

OBJECTS = api-example.o

all: api-example

api-example: $(OBJECTS)
$(CC) -o api-example $(OBJECTS) $(CFLAGS)

api-example.o: api-example.c
$(CC) -c api-example.c $(CFLAGS)

 

.PHONY: clean
clean:
-rm -rf $(OBJECTS) api-example

Note: we should modify the directory of the include files!

2. Windows
Windows builds: http://hawkeye.arrozcru.org/
Test release: http://hawkeye.arrozcru.org/builds/32-bit/dev/ffmpeg-git-8b8bf89-32-bit-dev.7z

Example code:
unzip ffmpeg-git-8b8bf89-32-bit-dev.7z into the following directory.

c:\project\ffmpeg\test.win> dir
api-example.c
Makefile.win
doc
include
lib

Note: include the “include” & “lib” in the project, modify the directory of the include files!