sems sbc - kamailio · 12 flexible profile based control define sbc behaviour in profiles sems sbc...

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

Upload: others

Post on 06-Aug-2020

26 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

SEMS SBC

Stefan SayerCEO, FRAFOS GmbH

FOSDEM 2012, 05.02.2012

Page 2: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

2

Contents

● SEMS project

● The flexible, open SBC

● SBC programmability

Page 3: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

4

SEMS use cases

Page 5: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

5

SEMS: The VAS platform

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

Page 6: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

6

SBCs – what?

“SBCs are SIP application

servers with focus on

security and isolation”

Page 7: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

9

The SEMS SBC

● Widely deployed SIP technology

● Broad range of media capabilities

● Configurable transparency

● Policy programmability – “SBC platform”

Page 10: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

11

Media features

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

style)● Codec filter● SDP normalization

Page 12: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

19

SEMS B2BUA architecture

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

DIALOG DIALOG

SIP message SIP messageevent

Page 20: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

23

Programmability example (1)

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

Page 24: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

24

Minimal Play! Web app

Page 25: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

25

...with CRUD module

Page 26: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

26

REST call control module

● Using libcurl for http request

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

Page 27: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

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: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

28

Programmability example (3)

FRAFOS:

SBC with Provisioning and OAM GUI

Page 29: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

29

FRAFOS: SBC high availability

● Replication of call state to hot standby

● Transparent fail-over

Page 30: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

30

SBC performance

Page 31: SEMS SBC - Kamailio · 12 Flexible profile based control define SBC behaviour in profiles SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net

Thank You.

http://iptel.org/sems