VoIP Asterisk&OpenSIPS Architecture
VoIP Asterisk&OpenSIPS Architecture
VoIP Asterisk&OpenSIPS Architecture
SDP codecs
Network IP
• Server types
– Redirect Server
– Proxy Server
– Registrar Server
– Location Server
• Gateways
SIP Methods
• INVITE Requests a session
REGISTER: sip:[email protected]
401 - Unauthorized
“Calls”
INVITE: sip:18.18.2.4
18.18.2.4
200 - OK Answers
ACK
Hangs up BYE
200 - OK
SIP Servers
● Registrar Sever
● takes registration requests from UA's, and maintains information
as to their location.
● Location Sever
● This server replaces the user's AoR (Address of Record) with the
contact address registered by user.
SIP Servers
● Proxy Server
● A SIP proxy receives SIP messages (both requests and
responses), that are generated by UA's, and forwards them on
(either to the destination UA, or the next SIP Server in the route,
as specified in the SIP message itself).
● Redirect Server
● This conceptual SIP network entity receives requests from a proxy
or UA, and responds with a specific SIP response method, telling
the originator of the request that the user is not available at that
location, and indicates where the request should be sent in order
to try again.
SIP Servers
● Application Sever
● This is the place were different features are implemented, adding
value to the VoIP platform. Among common features you can find
advanced call control applications like call blocking or call baring,
prepaid system, interactive call routing.
● Media Servers
● In order to have an active control of what happens during a call, a
device has to be 'in the media stream', as it is often called...
SIP SERVERs(decisions)
SIP Servers have a wide array of possible ways to
handle incoming messages
● Where to route the request
● Proxy/Redirect/Reject
● Stateful/Stateless forwarding
● Record-routing
● Forking—parallel/sequential/none
● Authentication
● Loop detection
SIP SERVERs(decision factors)
These decisions can be made based on many
factors, such as:
● Message destination address (Request-URI)
● Type of request (method)
● Other message fields: From, To, Date, Priority
● Response to a Request
Proxy Servers
The SIP standard defines SIP proxies as
“elements that route SIP requests to user agent
servers (UAS) and SIP responses to user agent
clients (UAC).
● Stateful proxy
● Stateless proxy
Stateful Proxy(TM)
When stateful, the proxy processes transactions
rather than individual messages
A stateful proxy is aware of the state of transactions and message
history, and can therefore perform better-informed processing on
incoming messages
● Memory consumption
● Throughput
● Implementation complexity
● Underlying SIP Stack complexity
STATELESS PROXY
A stateless proxy is a “simple message forwarder”
● A stateless proxy cannot associate responses
● A stateless proxy cannot associate retransmissions
● If the message is lost, the proxy will not retransmit it.
O
Inbound- service LB
Incoming Yate /
calls
Asterisk /
Freeswitch
OpenSIPS boxes
Load Balancer
O
Inbound- Call Center
Incoming
calls Business
operator
OpenSIPS
Load Balancer
Advanced
operator
O
May 4-5 OpenSIPS – clustering and balancing media servers , Amoocon 2009 Rostock,Germany
OpenSER
OpenSER
- a SIP proxy
OpenSER is:
- a SIP proxy
- a SIP registrar
OpenSER is:
- a SIP proxy
- a SIP registrar
- a SIP router
OpenSER is:
- a SIP proxy
- a SIP registrar
- a SIP router
- a SIP redirect server
OpenSER is:
- a SIP proxy
- a SIP registrar
- a SIP router
- a SIP redirect server
- a SIP application server
OpenSER is not:
OpenSER is not:
• parsers (SIP/SDP/conf)
OpenSER architecture:
• parsers (SIP/SDP/conf)
• memory system
OpenSER architecture:
• parsers (SIP/SDP/conf)
• memory system
• transport layer
OpenSER architecture:
• parsers (SIP/SDP/conf)
• memory system
• transport layer
• database interface
OpenSER architecture:
• parsers (SIP/SDP/conf)
• memory system
• transport layer
• database interface
• synch/lock mechanism
OpenSER architecture:
• parsers (SIP/SDP/conf)
• memory system
• transport layer
• database interface
• synch/lock mechanism
• management interface
OpenSER architecture:
• parsers (SIP/SDP/conf)
• memory system
• transport layer
• database interface
• synch/lock mechanism
• management interface
• script variables
OpenSER architecture:
module 1
module 2
core
module n
OpenSER configuration:
OpenSER configuration:
openser.cfg
OpenSER configuration:
global options
OpenSER configuration:
global options
modules:
loading and parameters
OpenSER configuration:
global options
modules:
loading and parameters
routing
OpenSER configuration:
global options
OpenSER configuration:
global options
- listen interfaces
OpenSER configuration:
global options
- listen interfaces
# UDP support
listen=udp:10.10.10.10:5060
OpenSER configuration:
global options
- listen interfaces
# TCP support
listen=tcp:10.10.10.10:5070
OpenSER configuration:
global options
- listen interfaces
global options
- listen interfaces
- logging
OpenSER configuration:
global options
- listen interfaces
- logging
# logging level
debug=3
OpenSER configuration:
global options
- listen interfaces
- logging
# syslog enabled
log_stderr=no
OpenSER configuration:
global options
- listen interfaces
- logging
# syslog enabled
log_stderr=no
log_facility=LOG_LOCAL3
OpenSER configuration:
global options
- listen interfaces
- logging
# syslog enabled
log_stderr=no
log_facility=LOG_LOCAL3
log_name=”oser”
OpenSER configuration:
global options
- listen interfaces
- logging
- number of processes
OpenSER configuration:
global options
- listen interfaces
- logging
- number of processes
fork=yes
OpenSER configuration:
global options
- listen interfaces
- logging
- number of processes
fork=yes
children=6 # UDP listeners
OpenSER configuration:
global options
- listen interfaces
- logging
- number of processes
fork=yes
children=6 # UDP listeners
tcp_children=5 #TCP listeners
OpenSER configuration:
global options
- listen interfaces
- logging
- number of processes
- protocol control
OpenSER configuration:
global options
- listen interfaces
- logging
- number of processes
- protocol control
disable_tcp=yes
OpenSER configuration:
global options
- listen interfaces
- logging
- number of processes
- protocol control
disable_tcp=yes
disable_tls=yes
OpenSER configuration:
global options
debug=3
log_stderror=no
log_facility=LOG_LOCAL0
fork=yes
children=4
disable_tcp=yes
listen=udp:192.168.1.2:5060
OpenSER configuration:
- path location
OpenSER configuration:
- path location
mpath=”/usr/lib/openser/modules”
OpenSER configuration:
- path location
- module loading
OpenSER configuration:
- path location
- module loading
mpath=”/usr/lib/openser/modules”
loadmodule “tm.so”
OpenSER configuration:
- path location
- module loading
loadmodule “/usr/lib/openser/modules/tm.so”
OpenSER configuration:
- path location
- module loading
- module parameters
OpenSER configuration:
- path location
- module loading
- module parameters
modparam(“tm”,“T1_timer”,700)
OpenSER configuration:
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
OpenSER configuration:
routing
OpenSER configuration:
routing
routing
routing
routing
routing
routing
####### Routing Logic ########
route{
if (loose_route()) { # mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
t_relay();
exit;;
};
if (!uri==myself) { # mark routing logic in request
append_hf("P-hint: outbound\r\n");
t_relay();
exit;
};
if (uri==myself && is_method("INVITE")) {
lookup(“location”);
t_relay();
exit;
};
}
OpenSER configuration:
Read from the network
Message parsing
route on_reply_route/failure_route
Send to network
SIP message call flow
OpenSER/asterisk integration
asterisk
asterisk
OpenSER
asterisk
location db
OpenSER/asterisk integration
asterisk
high # of channels
OpenSER carrier 2
asterisk high cps rate
asterisk
low # of channels
low cps rate carrier 3
OpenSER/asterisk integration
carrier 1
international
asterisk
OpenSER carrier 2
asterisk national
asterisk
carrier 3
911