Está en la página 1de 25

1.

- Instala las dependencias necesarias de los módulos que pretendas usar, en este
caso solo habilitaré el módulo “db_mysql” por lo que necesitamos las librerías
devel de MySQL, ¡aha! uElastix ya las trae instaladas. Pero aún así necesitamos unas
cuantas(estoy instalando paquetes de más para su uso futuro) :

# yum install -y git bison flex perl-Frontier-RPC radiusclient-ng-devel lynx lib


confuse libconfuse-devel pcre-devel librabbitmq-devel expat-devel json-c-devel
xmlrpc-c-devel mongodb-devel libmicrohttpd-devel GeoIP-devel perl-ExtUtils-Embed
python-devel

2.- Una vez que haya terminado la instalación vamos a crear el directorio para bajar
las fuentes de OpenSIPS:

# cd /usr/src/
# mkdir opensips
# cd opensips/

3.- Descargamos las fuentes de OpenSIPS desde el repositorio de GIT. Uso GIT
porque hubo un problema con las fuentes originales y la arquitectura ARM,
después de reportar el problema los desarrolladores de OpenSIPS amablemente lo
corrigieron y actualizaron las fuentes en GIT.

# git clone https://github.com/OpenSIPS/opensips.git -b 1.10 opensips_1_10


# cd opensips_1_10/

4.- A continuación compilamos OpenSIPS con el módulo db_mysql(puedes irte a


jugar una partida de FIFA en el XBOX, un café o algo el proceso va a tardar):

# make include_modules="db_mysql" modules


# make include_modules="db_mysql" install
# make install

5.- Después de que haya terminado vamos a crear el directorio en /etc que
contedrá los archivos de configuración:

# mkdir /etc/opensips
6.- Ahora crearemos el archivo de configuración para crear la base de datos de
OpenSIPS:

# nano /etc/opensips/opensipsctlrc

Con el siguiente contenido, recuerda cambiar DBNAME por el nombre de la base


de datos que desees, DBRWUSER por usuario de la base que desees y DBRWPW
por el password que desees que use la base:

# $Id$
#
# The OpenSIPS configuration file for the control tools.
#
# Here you can set variables used in the opensipsctl and opensipsdbctl setup
# scripts. Per default all variables here are commented out, the control tools
# will use their internal default values.

## your SIP domain


# SIP_DOMAIN=opensips.org

## 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 opensipsdbctl, you must at least specify
# this parameter.
DBENGINE=MYSQL

## database host
DBHOST=localhost

## database name (for ORACLE this is TNS name)


DBNAME=opensips
# database path used by dbtext or db_berkeley
# DB_PATH="/usr/local/etc/opensips/dbtext"
## database read/write user
DBRWUSER=opensips

## password for database read/write user


DBRWPW="opensipsrw"

## database super user (for ORACLE this is 'scheme-creator' user)


DBROOTUSER="root"

# user name column


# 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"

# grep tool
# GREP="grep"

# sed tool
# SED="sed"

# 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 opensipsdbctl.base script.

# opensips standard modules


# STANDARD_MODULES="standard acc domain group permissions registrar usrloc
# msilo alias_db uri_db speeddial avpops auth_db pdt dialog
# dispatcher dialplan drouting nathelper load_balancer"

# opensips extra modules


# EXTRA_MODULES="imc cpl siptrace domainpolicy carrierroute userblacklist b2b re
gistrant"

## type of aliases used: DB - database aliases; UL - usrloc aliases


## - default: none
# ALIASES_TYPE="DB"
## control engine: FIFO or UNIXSOCK
## - default FIFO
# CTLENGINE=xmlrpc

## path to FIFO file


# OSIPS_FIFO="/tmp/opensips_fifo"

## MI_CONNECTOR control engine: FIFO, UNIXSOCK, UDP, XMLRPC


# MI_CONNECTOR=FIFO:/tmp/opensips_fifo
# MI_CONNECTOR=UNIXSOCK:/tmp/opensips.sock
# MI_CONNECTOR=UDP:192.168.2.133:8000
# MI_CONNECTOR=XMLRPC:192.168.2.133:8000

## 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

## do (1) or don't (0) store plaintext passwords


## in the subscriber table - default '1'
# STORE_PLAINTEXT_PW=0

## do not display the output highlighted


# NOHLPRINT=1

## OPENSIPS START Options


## PID file path - default is: /var/run/opensips.pid
# PID_FILE=/var/run/opensips.pid
## Extra start options - default is: not set
# example: start opensips with 64MB share memory: STARTOPTIONS="-m 64"
# STARTOPTIONS=

7.- A continuación vamos a instalar la base de datos, para ello cambiamos al


directrio “scripts” y ejecutamos el programa “opensipsdbctl” mas la instrucción
“create” más el nombre de la base de datos que definimos en el archivo anterior:

# cd scripts/
# opensipsdbctl create opensips

Nos preguntará por la contraseña de root de MySQL, por defecto en uElastix es


“palosanto”. Después nos preguntará si queremos instalar las tablas extras, eso ya
es su decisión:

MySQL password for root: <----palosanto


INFO: test server charset
INFO: creating database opensisps ...
INFO: Core OpenSIPS tables succesfully created.
Install presence related tables? (y/n): y
INFO: creating presence tables into opensips ...
INFO: Presence tables succesfully created.
Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist regi
strant? (y/n): y
INFO: creating extra tables into opensips ...
INFO: Extra tables succesfully created.

8.- Ahora hay que crear el archivo de configuración de OpenSIPS, el que cargará los
módulos y contendrá las reglas del proxy, balanceo de carga etc. Esto se puede
hacer utilizando el programa “osipsconfig” y escoger crear script para balanceo de
cargas.
Como en este ejemplo la idea es que OpenSIPS reciba las llamadas de un
proveedor SIP y las redireccione a los nodos con menor carga para su
procesamiento necesitamos de 3 módulos principalmente:

a) Módulo “load_balancer.so“, el cuál se encargará de balancear la carga de


llamadas.
b) Módulo “uac_registrant.so“, el cuál se encargara de hacer el registro de las
lineas SIP a recibir
c) Módulo “uac_auth.so“, el cuál es necesario para que el módulo anterior funcione
correctamente.

Para configurar el módulo “load_balancer.so” escribimos(para más información


sobre la
configuración: http://www.opensips.org/html/docs/modules/1.10.x/load_bala
ncer.html):

#### LOAD BALANCER module


loadmodule "load_balancer.so"
modparam("load_balancer", "db_url","mysql://opensips:opensipsrw@localhost/opensi
ps")
modparam("load_balancer", "probing_interval", 30)
modparam("load_balancer", "probing_method", "OPTIONS")
modparam("load_balancer", "probing_from", "sip:ospinger@10.0.1.120")
modparam("load_balancer", "probing_reply_codes", "501, 403,200")

Para configurar el módulo “uac_registrant.so” escribimos(para más información


sobre la
configuración: http://www.opensips.org/html/docs/modules/1.10.x/uac_regist
rant.html ):

#### UAC MODULE


loadmodule "uac_auth.so"
loadmodule "uac_registrant.so"
modparam("uac_registrant", "hash_size", 1)
modparam("uac_registrant", "timer_interval", 120)
modparam("uac_registrant", "db_url", "mysql://opensips:opensipsrw@localhost/open
sips")
modparam("uac_registrant", "table_name", "registrant")
modparam("uac_registrant", "registrar_column", "registrar")
modparam("uac_registrant", "proxy_column", "proxy")
modparam("uac_registrant", "aor_column", "aor")
modparam("uac_registrant", "third_party_registrant_column", "third_party_registr
ant")
modparam("uac_registrant", "username_column", "username")
modparam("uac_registrant", "password_column", "password")
modparam("uac_registrant", "binding_URI_column", "binding_URI")
modparam("uac_registrant", "binding_params_column", "binding_params")
modparam("uac_registrant", "expiry_column", "expiry")
modparam("uac_registrant", "forced_socket_column", "forced_socket")

Ya que nuestro hardware es limitado tenemos que cambiar el tamaño del hash a
solo 128, esto dentro del módulo dialog, debe quedar así:

#### DIALOG module


loadmodule "dialog.so"
modparam("dialog", "dlg_match_mode", 1)
modparam("dialog", "hash_size", 128)
modparam("dialog", "default_timeout", 21600) # 6 hours timeout
modparam("dialog", "db_mode", 2)
modparam("dialog", "db_url","mysql://opensips:opensipsrw@localhost/opensips")

Si queremos habilitar el log tenemos que añadir esto:

debug=6
log_stderror=no
log_facility=LOG_LOCAL0
log_name="opensip_LB_5260"

La primera línea implica el verbose que veremos.


La segunda línea si escribiremos al stderr.
La tercera línea hacia donde vamos a escribir el log, por default escribimos al
syslog del sistema.
La cuarta línea es el nombre que saldrá en el log, en mi caso indico que es:
opensips como load balancer en el puerto 5260.
También tenemos que decirle en que IP y puerto vamos a escuchar las peticiones
SIP:

listen=udp:10.0.1.120:5260

Como ya tenemos el Asterisk escuchando en el puerto 5060 yo he elegido el


puerto 5260 para OpenSIPS.

Algo muy importante es indicar la ruta de los módulos, en este caso los modulos se
encuentran en: “/usr/lib/opensips/modules/”:

mpath="/usr/lib/opensips/modules/"

Acerca de la lógica del balanceo de carga podemos usar el ejemplo que trae por
default, en mi caso lo estoy utilizando de esta manera:

if(load_balance("1","pstn")){
xlog("sending call to $du\n");
t_relay();
exit;
}else{
send_reply("500","No Destination available");
exit;
}

La sintaxis de la función load_balance


es: load_balance(grp,resource[,alg]) donde(más información:
http://www.opensips.org/html/docs/modules/1.10.x/load_balancer.html#id250102):

grp: Es el ID del cluster de los nodos, en mi caso el grupo es “1”.

resource: Una cadena o lista de cadenas separadas por punto y coma que indican
los recursos a usar, en mi caso “pstn”.

alg: Es el algoritmo a usar para definir la carga en uso, puede ser 0 o 1. 0 es para
usar un algoritmo absoluto y 1 para un algoritmo relativo.

A continuación dejo el archivo que estoy usando:


#
# $Id$
#
# OpenSIPS loadbalancer script
# by OpenSIPS Solutions <team@opensips-solutions.com>
#
# This script was generated via "make menuconfig", from
# the "Load Balancer" scenario.
# You can enable / disable more features / functionalities by
# re-generating the scenario with different options.
#
# Please refer to the Core CookBook at:
# http://www.opensips.org/Resources/DocsCookbooks
# for a explanation of possible statements, functions and parameters.
#

####### Global Parameters #########


debug=6
log_stderror=no
log_facility=LOG_LOCAL0
log_name="opensip_LB_5260"

fork=yes
children=4

/* uncomment the following lines to enable debugging */


#debug=6
#fork=no
#log_stderror=yes

/* uncomment the next line to enable the auto temporary blacklisting of


not available destinations (default disabled) */
#disable_dns_blacklist=no
/* uncomment the next line to enable IPv6 lookup after IPv4 dns
lookup failures (default disabled) */
#dns_try_ipv6=yes

/* comment the next line to enable the auto discovery of local aliases
based on revers DNS on IPs */
auto_aliases=no

listen=udp:10.0.1.120:5260 # CUSTOMIZE ME

####### Modules Section ########


#set module path
mpath="/usr/lib/opensips/modules/"

#### SIGNALING module


loadmodule "signaling.so"

#### StateLess module


loadmodule "sl.so"

#### Transaction Module


loadmodule "tm.so"
modparam("tm", "fr_timer", 5)
modparam("tm", "fr_inv_timer", 30)
modparam("tm", "restart_fr_on_each_reply", 0)
modparam("tm", "onreply_avp_mode", 1)

#### Record Route Module


loadmodule "rr.so"
/* do not append from tag to the RR (no need for this script) */
modparam("rr", "append_fromtag", 0)
#### MAX ForWarD module
loadmodule "maxfwd.so"

#### SIP MSG OPerationS module


loadmodule "sipmsgops.so"

#### FIFO Management Interface


loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("mi_fifo", "fifo_mode", 0666)

#### URI module


loadmodule "uri.so"
modparam("uri", "use_uri_table", 0)

#### MYSQL module


loadmodule "db_mysql.so"

#### AVPOPS module


loadmodule "avpops.so"

#### ACCounting module


loadmodule "acc.so"
/* what special events should be accounted ? */
modparam("acc", "early_media", 0)
modparam("acc", "report_cancels", 0)
/* by default we do not adjust the direct of the sequential requests.
if you enable this parameter, be sure the enable "append_fromtag"
in "rr" module */
modparam("acc", "detect_direction", 0)
modparam("acc", "failed_transaction_flag", "ACC_FAILED")
/* account triggers (flags) */
modparam("acc", "log_flag", "ACC_DO")
modparam("acc", "log_missed_flag", "ACC_MISSED")

#### DIALOG module


loadmodule "dialog.so"
modparam("dialog", "dlg_match_mode", 1)
modparam("dialog", "hash_size", 128)
modparam("dialog", "default_timeout", 21600) # 6 hours timeout
modparam("dialog", "db_mode", 2)
modparam("dialog", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME

#### LOAD BALANCER module


loadmodule "load_balancer.so"
modparam("load_balancer", "db_url","mysql://opensips:opensipsrw@localhost/opensi
ps") # CUSTOMIZE ME
modparam("load_balancer", "probing_interval", 30)
modparam("load_balancer", "probing_method", "OPTIONS")
modparam("load_balancer", "probing_from", "sip:ospinger@10.0.1.102")
modparam("load_balancer", "probing_reply_codes", "501, 403,200")

#### UAC MODULE


loadmodule "uac_auth.so"
loadmodule "uac_registrant.so"
modparam("uac_registrant", "hash_size", 1)
modparam("uac_registrant", "timer_interval", 120)
modparam("uac_registrant", "db_url", "mysql://opensips:opensipsrw@localhost/open
sips")
modparam("uac_registrant", "table_name", "registrant")
modparam("uac_registrant", "registrar_column", "registrar")
modparam("uac_registrant", "proxy_column", "proxy")
modparam("uac_registrant", "aor_column", "aor")
modparam("uac_registrant", "third_party_registrant_column", "third_party_registr
ant")
modparam("uac_registrant", "username_column", "username")
modparam("uac_registrant", "password_column", "password")
modparam("uac_registrant", "binding_URI_column", "binding_URI")
modparam("uac_registrant", "binding_params_column", "binding_params")
modparam("uac_registrant", "expiry_column", "expiry")
modparam("uac_registrant", "forced_socket_column", "forced_socket")

####### Routing Logic ########

# main request routing logic

route{

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {

# validate the sequential request against dialog


if ( $DLG_status!=NULL && !validate_dialog() ) {
xlog("In-Dialog $rm from $si (callid=$ci) is not valid according to dialog\n");
## exit;
}

if (is_method("BYE")) {
setflag(ACC_DO); # do accounting ...
setflag(ACC_FAILED); # ... even if the transaction fails
} else if (is_method("INVITE")) {
# even if in most of the cases is useless, do RR for
# re-INVITEs alos, as some buggy clients do change route set
# during the dialog.
record_route();
}

# route it out to whatever destination was set by loose_route()


# in $du (destination URI).
route(RELAY);
} else {
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# non loose-route, but stateful ACK; must be an ACK after
# a 487 or e.g. 404 from upstream server
t_relay();
exit;
} else {
# ACK without matching transaction ->
# ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}

#### INITIAL REQUESTS

# CANCEL processing
if (is_method("CANCEL")) {
if (t_check_trans())
t_relay();
exit;
} else if (!is_method("INVITE")) {
send_reply("405","Method Not Allowed");
exit;
}

if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}

t_check_trans();

# preloaded route checking


if (loose_route()) {
xlog("L_ERR",
"Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");
if (!is_method("ACK"))
sl_send_reply("403","Preload Route denied");
exit;
}

# record routing

record_route();

setflag(ACC_DO); # do accounting

if(load_balance("1","pstn")){
xlog("sending call to $du\n");
t_relay();
exit;
}else{
send_reply("500","No Destination available");
exit;
}

t_on_failure("GW_FAILOVER");
route(RELAY);
}

route[RELAY] {
if (!t_relay()) {
sl_reply_error();
};
exit;
}

failure_route[GW_FAILOVER] {
if (t_was_cancelled()) {
exit;
}

# failure detection with redirect to next available trunk


if (t_check_status("(408)|([56][0-9][0-9])")) {
xlog("Failed trunk $rd/$du detected \n");

if ( load_balance("1","channel") ) {
t_on_failure("GW_FAILOVER");
t_relay();
exit;
}
send_reply("500","All GW are down");
}
}

local_route {
if (is_method("BYE") && $DLG_dir=="UPSTREAM") {
acc_log_request("200 Dialog Timeout");
}
}

9.- Ahora hay que crear el script de inicio:

# nano /etc/init.d/opensips

Con el siguiente contenido:

#!/bin/bash

#
# Startup script for OpenSIPS
#
# chkconfig: - 85 15
# description: OpenSIPS is a fast SIP Server.
#
# processname: opensips
# pidfile: /var/run/opensips.pid
# config: /etc/opensips/opensips.cfg
#
### BEGIN INIT INFO
# Provides: opensips
# Required-Start: $local_fs $network $named
# Should-Start: mysqld postgresql
# Short-Description: start, stop OpenSIPS
# Description: OpenSIPS is a very fast and flexible SIP (RFC3261) server.
### END INIT INFO

# Source function library.


. /etc/rc.d/init.d/functions
prog=opensips
oser=/usr/sbin/$prog
pidfile="/var/run/$prog.pid"
lockfile="/var/lock/subsys/$prog"
configfile="/etc/$prog/$prog.cfg"
m4configfile="/etc/$prog/$prog.m4"
m4archivedir="/etc/$prog/archive"
OPTIONS=""
RETVAL=0

[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog


start() {
echo -n $"Starting $prog: "

# check whether OpenSIPs was already started


if status -p $pidfile $prog > /dev/null 2>&1 ; then
echo -n "already running" && warning && echo
return 0
fi

# Generate config from M4


if [ -f $m4configfile ]; then
m4 -Q $m4configfile >$configfile.tmp
if [ $? != 0 ]; then
log "cannot process m4 macro"
rm "$configfile.tmp"
return 1
fi

[ -e $configfile ] || touch $configfile

# compare configs
if [ `md5sum $configfile|awk '{print $1}'` != `md5sum $configfil
e.tmp|awk '{print $1}'` ]; then
mkdir -p "$m4archivedir"
mv "$configfile" "$m4archivedir/$prog.cfg-`date +%Y%m%d_
%H%M%S`"
fi

mv "$configfile.tmp" "$configfile"
chown root:root $configfile
chmod 640 $configfile
fi

# there is something at end of this output which is needed to


# report proper [ OK ] status in Fedora scripts
daemon $oser -u root -g root -P $pidfile -f $configfile $OPTIONS 2>/dev/
null | tail -1
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $lockfile
return $RETVAL
}

stop() {
echo -n $"Stopping $prog: "
# check whether OpenSIPs is running
if ! status -p $pidfile $prog > /dev/null 2>&1 ; then
echo -n "not running" && warning && echo
return 0
fi

killproc $prog 2> /dev/null


RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f $lockfile $pidfile
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p $pidfile $prog
RETVAL=$?
;;
restart|reload)
stop
start
;;
condrestart|try-restart)
if [ -f $pidfile ] ; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|reload|restart|condrestart|statu
s|help}"
RETVAL=2
esac

exit $RETVAL

10.- Ya falta poco, ahora hay que añadir los valores a nuestra base de datos antes
de iniciar el servicio de OpenSIPS. Entramos al cli de MySQL y añadimos los nodos
que vamos a usar para balancear las llamadas(recuerda la contraseña de MySQL es:
palosanto):

# mysql -p opensips

mysql> INSERT INTO load_balancer(group_id,dst_uri,resources,probe_mode,descript


ion) VALUES('1','sip:10.0.1.103:5060','pstn=1','1','Asterisk1-onRPi');

mysql> INSERT INTO load_balancer(group_id,dst_uri,resources,probe_mode,descript


ion) VALUES('1','sip:10.0.1.102:5060','pstn=1','1','Asterisk2-onShaka');

mysql> INSERT INTO load_balancer(group_id,dst_uri,resources,probe_mode,descript


ion) VALUES('1','sip:10.0.1.120:5060','pstn=1','1','Asterisk3-onAsiri');

mysql> SELECT * FROM load_balancer;

+----+----------+---------------------+-----------+------------+----------------
-------+
| id | group_id | dst_uri | resources | probe_mode | descriptio
n |
+----+----------+---------------------+-----------+------------+----------------
-------+
| 1 | 1 | sip:10.0.1.103:5060 | pstn=1 | 1 | Asterisk1-onRPi
|
| 2 | 1 | sip:10.0.1.102:5060 | pstn=1 | 1 | Asterisk2-onSha
ka |
| 3 | 1 | sip:10.0.1.120:5060 | pstn=1 | 1 | Asterisk3-onAsi
ri |
+----+----------+---------------------+-----------+------------+----------------
-------+

Se añadieron 3 servidores al grupo “1”, cada uno con un recurso llamado “pstn” el
cuál tiene un máximo de 1 llamada, para ambientes reales sustituir con las llamadas
que se desean.

11.- Ahora vamos a añadir los valores de la cuenta sip que vamos a registrar:

mysql> INSERT INTO registrant(registrar,aor,username,password,binding_URI,expiry


,) VALUES('sip:my.provider.host','sip:myusername@my.provider.host','myusername',
'mysuperpassword','sip:myDID@myAsiriIP','3600');
12.- Salimos de MySQL e intentamos iniciar el servicio de OpenSIPS, si todo va bien
veremos una salida parecida a esta:

Oct 31 17:02:20 AsiriShaka opensips: INFO:core:init_tcp: using epoll_lt as the T


CP io watch method (auto detected)
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: NOTICE:core:main: version: ope
nsips 1.10.0-notls (armv5tejl/linux)
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: INFO:core:main: using 32 Mb sh
ared memory
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: INFO:core:main: using 2 Mb pri
vate memory per process
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: INFO:core:evi_publish_event: R
egistered event <E_CORE_THRESHOLD(0)>
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: INFO:core:evi_publish_event: R
egistered event <E_CORE_SHM_THRESHOLD(1)>
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: INFO:core:evi_publish_event: R
egistered event <E_CORE_PKG_THRESHOLD(2)>
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: NOTICE:signaling:mod_init: ini
tializing module ...
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: INFO:sl:mod_init: Initializing
StateLess engine
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: INFO:tm:mod_init: TM - initial
izing...
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: CRITICAL:tm:lock_set_init: sem
get (..., 251, 0700) failed: Invalid argument
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: INFO:tm:lock_initialize: semap
hore arrays of size 250 allocated
Oct 31 17:02:21 AsiriShaka opensip_LB_5260[3836]: INFO:rr:mod_init: rr - initial
izing
Oct 31 17:02:22 AsiriShaka opensip_LB_5260[3836]: INFO:maxfwd:mod_init: initiali
zing...
Oct 31 17:02:22 AsiriShaka opensip_LB_5260[3836]: INFO:sipmsgops:mod_init: initi
alizing...
Oct 31 17:02:22 AsiriShaka opensip_LB_5260[3836]: INFO:core:evi_publish_event: R
egistered event <E_MYSQL_CONNECTION(3)>
Oct 31 17:02:22 AsiriShaka opensip_LB_5260[3836]: INFO:avpops:avpops_init: initi
alizing...
Oct 31 17:02:22 AsiriShaka opensip_LB_5260[3836]: INFO:acc:mod_init: initializin
g...
Oct 31 17:02:22 AsiriShaka opensip_LB_5260[3836]: INFO:core:evi_publish_event: R
egistered event <E_ACC_EVENT(4)>
Oct 31 17:02:22 AsiriShaka opensip_LB_5260[3836]: INFO:core:evi_publish_event: R
egistered event <E_ACC_CDR(5)>
Oct 31 17:02:22 AsiriShaka opensip_LB_5260[3836]: INFO:core:evi_publish_event: R
egistered event <E_ACC_MISSED_EVENT(6)>
Oct 31 17:02:22 AsiriShaka opensip_LB_5260[3836]: INFO:dialog:mod_init: Dialog m
odule - initializing
Oct 31 17:02:23 AsiriShaka opensip_LB_5260[3836]: INFO:load_balancer:mod_init: L
oad-Balancer module - initializing
Oct 31 17:02:23 AsiriShaka rsyslogd-2177: imuxsock begins to drop messages from
pid 3836 due to rate-limiting
Oct 31 17:02:25 AsiriShaka opensips: INFO:core:daemonize: pre-daemon process exi
ting with 0

13.- Para saber el estado del cluster de servidores usaremos el comando:

# opensipsctl fifo lb_list

Y veremos una salida similar a:

Destination:: sip:10.0.1.120:5060 id=1 group=1 enabled=yes auto-re=on


Resource:: pstn max=1 load=0
Destination:: sip:10.0.1.103:5060 id=2 group=1 enabled=yes auto-re=on
Resource:: pstn max=1 load=0
Destination:: sip:10.0.1.105:5060 id=3 group=1 enabled=yes auto-re=on
Resource:: pstn max=1 load=0

Como podemos ver este comando es muy útil para saber cuántos nodos hay, cuál
es su capacidad máxima y por último cuántas llamadas/carga tiene actualmente.

14.- Para saber el estado del registro de la línea SIP usaremos el comando:

# opensipsctl fifo reg_list

Y veremos un salida similar a:

AOR:: sip:myuser@mysip.provider:5060 expires=3600


state:: REGISTERED_STATE
last_register_sent:: Mon Nov 4 10:39:20 2013
registration_t_out:: Mon Nov 4 11:37:21 2013
registrar:: sip:mysip.provider:5060
binding:: sip:mydid@10.0.1.120:5261
dst_IP:: IPv4 ip=mysipprovider

También podría gustarte