31
SEMS SBC Stefan Sayer CEO, FRAFOS GmbH FOSDEM 2012, 05.02.2012

Fosdem2012 sayer-sems-sbc

Embed Size (px)

DESCRIPTION

SEMS, the SIP Express Media Server, is the media and application server counterpart to SIP Express Router aka Kamailio/OpenSER, the leading open source SIP Signalling server from iptel.org. Since 2004 SEMS has been used to implement classical value added services in VoIP networks like announcements, conferencing, voicemail and RBT, and converged services as web conferencing and voice message broadcasting.More recently, its integrated Back-to-Back User Agent has been extended and improved for flexibility and high performance, making it one of the few open source solutions for high volume session border control. But there's more to it: Thanks to its flexibility, it can also be used as core call routing element, and be a useful tool in various situations for the VoIP platform engineer.The talk will present the SEMS SBC functionality and typical performance numbers, and then show how developers can use the internal call control API to create custom call routing in the SBC with two examples: Using a RESTful interface, a web app server implemented with the Play! framework is used for user controlled call routing, and by accessing a blacklist database in REDIS, SEMS' SBC can be used to block SPIT.

Citation preview

Page 1: Fosdem2012 sayer-sems-sbc

SEMS SBC

Stefan SayerCEO, FRAFOS GmbH

FOSDEM 2012, 05.02.2012

Page 2: Fosdem2012 sayer-sems-sbc

2

Contents

● SEMS project

● The flexible, open SBC

● SBC programmability

Page 3: Fosdem2012 sayer-sems-sbc

3

The SIP Express Media Server

● Media, application server from iptel.org

● Only 1 year younger than SER (*2002)

● Widely used by carriers, ITSPs, OEMs, Universities, hobbyists

Page 4: Fosdem2012 sayer-sems-sbc

4

SEMS use cases

Page 5: Fosdem2012 sayer-sems-sbc

5

SEMS: The VAS platform

● C++, Python APIs● DSM: State charts scripting engine

Page 6: Fosdem2012 sayer-sems-sbc

6

SBCs – what?

“SBCs are SIP application

servers with focus on

security and isolation”

Page 7: Fosdem2012 sayer-sems-sbc

7

SBCs – the need

● Security requirements are rising

→ Policy enforcement and control at UNI/NNI● Topology hiding is necessary

→ NAT and security● Core call controls become big and slow

→ Routing and service management at NNI● SIP implementations are buggy

“→ SIP normalization”, translation

Page 8: Fosdem2012 sayer-sems-sbc

8

SBCs – the special case

● On signaling and media plane

● Call stateful – high requirements for availability and scalability

● Interworking with all “SIP dialects”

Page 9: Fosdem2012 sayer-sems-sbc

9

The SEMS SBC

● Widely deployed SIP technology

● Broad range of media capabilities

● Configurable transparency

● Policy programmability – “SBC platform”

Page 10: Fosdem2012 sayer-sems-sbc

10

Signaling Features

● Topology hiding● From, To, RURI, Contact, Call-ID manipulation● Header and message filter● Adding headers● Reply code translation● SIP authentication● SIP Session Timer, Call Timer● Prepaid accounting

Page 11: Fosdem2012 sayer-sems-sbc

11

Media features

● RTP anchoring / media steering● Physical network separation● NAT traversal, symmetric RTP (comedia

style)● Codec filter● SDP normalization

Page 12: Fosdem2012 sayer-sems-sbc

12

Flexible profile based control

● define SBC behaviour in profiles

SEMS SBC

#U 210.13.3.122:5080 -> 210.13.3.100:5060INVITE sip:[email protected] SIP/2.0From: “John” <sip:[email protected]>;tag=12To: “Clara” <[email protected]>Call-ID: 3cde5d1a960a-dez6oz34llo4...

#U 210.13.3.100:5060 -> 213.192.59.75:5060INVITE sip:[email protected] SIP/2.0From: <[email protected]>;tag=3213To: <sip:[email protected]>Call-ID: y76IIPf4UD68bb...

load_profiles=iptelechoactive_profile=iptelecho...

sbc.conf

URI=sip:[email protected]=<[email protected]>To=<sip:[email protected]>...

iptelecho.sbcprofile.conf

Page 13: Fosdem2012 sayer-sems-sbc

13

Set RURI, From, To, Call-ID ...

SEMS SBC

#U 210.13.3.122:5080 -> 210.13.3.100:5060INVITE sip:[email protected] SIP/2.0From: “John” <sip:[email protected]>;tag=12To: “Clara” <[email protected]>Call-ID: 3cde5d1a960a-dez6oz34llo4...

#U 210.13.3.100:5060 -> 213.192.59.75:5060INVITE sip:[email protected] SIP/2.0From: <[email protected]>;tag=3213To: <sip:[email protected]>Call-ID: 3cde5d1a960a-dez6oz34llo4_leg2...

[email protected]=<[email protected]>To=<sip:[email protected]>Call-ID=$ci_leg2...

set_fromto.sbcprofile.conf

knownSERpseudo-variables

Page 14: Fosdem2012 sayer-sems-sbc

14

Replacement patterns

● RURI, From, To, PAI, PPI ($r, $f, $t, $a, $p)

● Call-ID ($ci)

● src, dst IP address/port ($si, $pi, $Ri, $Rp)

● P-App-Param hdr parameter ($P(myparam))

● Header value ($H(P-My-Header))

● Map any value via regexp ($M(val=>map))

Page 15: Fosdem2012 sayer-sems-sbc

15

Control SBC from proxy

SEMS SBC

#U 210.13.3.122:5080 -> 210.13.3.100:5060INVITE sip:[email protected] SIP/2.0From: “John” <sip:[email protected]>;tag=12To: “Clara” <[email protected]>Call-ID: 3cde5d1a960a-dez6oz34llo4P-Enable-RTPRelay: noP-Enable-SST: yes...

#U 210.13.3.100:5060 -> 213.192.59.75:5060INVITE sip:[email protected] SIP/2.0From: <[email protected]>;tag=3213To: <sip:[email protected]>Call-ID: 3cde5d1a960a-dez6oz34llo4_leg2Session-Expires: 300...

...enable_rtprelay=$H(P-Enable-RTPRrelay)enable_session_timer=$H(P-Enable-SST)...

dynamic_rtprelay_sst.sbcprofile.conf

Page 16: Fosdem2012 sayer-sems-sbc

16

Profile selection

● Static● active_profile=static_config

● Pseudo-var● active_profile=$rU

● Mapping● active_profile=$M(val=>map)

● Select first matched● active_profile=$M($si=>ipmap),

$M($ru=>urimap),$H(P-SBCProfile),refuse

^10\.0\..*=>internal1^10\.1\..*=>internal2

ipmap.conf

iptel.org=>iptelfliptel.com=>fliptel

urimap.conf

Page 17: Fosdem2012 sayer-sems-sbc

17

Manage SBC

● sems-sbc-* tools● get and set active profile● load and reload profiles● load and reload mappings

● Track profile versions with MD5 hash

● Get statistics from monitoring

Page 18: Fosdem2012 sayer-sems-sbc

18

Processing model

● Signaling: Async, one thread per call or thread pool

● Media: Sync, Thread pool

UDP

receiver/msg parserthreads

Session Container

event processing

sessioneventqueues

otherevent sources

RTP processing pool

Page 19: Fosdem2012 sayer-sems-sbc

19

SEMS B2BUA architecture

● Two complete, separate instances of dialog handling: Locally SIP correct

DIALOG DIALOG

SIP message SIP messageevent

Page 20: Fosdem2012 sayer-sems-sbc

20

E.g.: Session Timers

● Use UPDATE or re-INVITE for refresh● SST and timer values per leg● Try to have e2e refresh

SST: refresh!Re-INVITE

SDP changed?

event:sessionchanged

200

Re-INVITE

200

Page 21: Fosdem2012 sayer-sems-sbc

21

SBC programmability

● Pluggable Call Control modules for custom SBC application scenario

● e.g. policing with external data source

SEMS core

SBC

Call control Call control Call control

Page 22: Fosdem2012 sayer-sems-sbc

22

Call control SBC-API

● V1: connect(...), start(...), end(...)

● Control SBC through call profile object

● Pattern replacements (provisioning) in both input and output

● Modules: CDR generation, call timer, prepaid, parallel calls limit, REST/http, REDIS blacklist

Page 23: Fosdem2012 sayer-sems-sbc

23

Programmability example (1)

● Call Forward settings via Web App● Destination queried via REST interface

Page 24: Fosdem2012 sayer-sems-sbc

24

Minimal Play! Web app

Page 25: Fosdem2012 sayer-sems-sbc

25

...with CRUD module

Page 26: Fosdem2012 sayer-sems-sbc

26

REST call control module

● Using libcurl for http request

● Result expected as JSON or TEXT (key=value\n)

Page 27: Fosdem2012 sayer-sems-sbc

27

Programmability example (2)

● In-memory Blacklist DB: REDIS● Connection pool● Configurable command

● SMEMBER blacklist $fU● rate limiting with ZRANGE● More complex logic in lua● ...

Page 28: Fosdem2012 sayer-sems-sbc

28

Programmability example (3)

FRAFOS:

SBC with Provisioning and OAM GUI

Page 29: Fosdem2012 sayer-sems-sbc

29

FRAFOS: SBC high availability

● Replication of call state to hot standby

● Transparent fail-over

Page 30: Fosdem2012 sayer-sems-sbc

30

SBC performance

Page 31: Fosdem2012 sayer-sems-sbc

Thank You.

http://iptel.org/sems