Fosdem2012 sayer-sems-sbc


Published on

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

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Fosdem2012 sayer-sems-sbc

  1. SEMS SBCStefan SayerCEO, FRAFOS GmbHFOSDEM 2012, 05.02.2012
  2. Contents● SEMS project● The flexible, open SBC● SBC programmability 2
  3. The SIP Express Media Server● Media, application server from● Only 1 year younger than SER (*2002)● Widely used by carriers, ITSPs, OEMs, Universities, hobbyists 3
  4. SEMS use cases 4
  5. SEMS: The VAS platform● C++, Python APIs● DSM: State charts scripting engine 5
  6. SBCs – what? “SBCs are SIP application servers with focus on security and isolation” 6
  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 7
  8. SBCs – the special case● On signaling and media plane● Call stateful – high requirements for availability and scalability● Interworking with all “SIP dialects” 8
  9. The SEMS SBC● Widely deployed SIP technology● Broad range of media capabilities● Configurable transparency● Policy programmability – “SBC platform” 9
  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 10
  11. Media features● RTP anchoring / media steering● Physical network separation● NAT traversal, symmetric RTP (comedia style)● Codec filter● SDP normalization 11
  12. Flexible profile based control sbc.conf iptelecho.sbcprofile.conf load_profiles=iptelecho active_profile=iptelecho From=<> ... To=<> ... SEMS SBC# #U -> U -> SIP/2.0 INVITE SIP/2.0From: “John” <>;tag=12 From: <>;tag=3213To: “Clara” <> To: <>Call-ID: 3cde5d1a960a-dez6oz34llo4 Call-ID: y76IIPf4UD68bb... ... ● define SBC behaviour in profiles 12
  13. Set RURI, From, To, Call-ID ... set_fromto.sbcprofile.conf URI=$ From=<$> known To=<sip:$> SER Call-ID=$ci_leg2 pseudo-variables ... SEMS SBC# #U -> U -> SIP/2.0 INVITE SIP/2.0From: “John” <>;tag=12 From: <>;tag=3213To: “Clara” <> To: <>Call-ID: 3cde5d1a960a-dez6oz34llo4 Call-ID: 3cde5d1a960a-dez6oz34llo4_leg2... ... 13
  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)) 14
  15. Control SBC from proxy dynamic_rtprelay_sst.sbcprofile.conf ... enable_rtprelay=$H(P-Enable-RTPRrelay) enable_session_timer=$H(P-Enable-SST) ... SEMS SBC# #U -> U -> SIP/2.0 INVITE SIP/2.0From: “John” <>;tag=12 From: <>;tag=3213To: “Clara” <> To: <>Call-ID: 3cde5d1a960a-dez6oz34llo4 Call-ID: 3cde5d1a960a-dez6oz34llo4_leg2P-Enable-RTPRelay: no Session-Expires: 300P-Enable-SST: yes ...... 15
  16. Profile selection● Static ● active_profile=static_config● Pseudo-var ipmap.conf ● active_profile=$rU ^10.0..*=>internal1 ^10.1..*=>internal2● Mapping urimap.conf>iptel ● active_profile=$M(val=>map)>fliptel● Select first matched ● active_profile=$M($si=>ipmap), $M($ru=>urimap),$H(P-SBCProfile),refuse 16
  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 17
  18. Processing modelUDP other receiver/msg parser event sources threadsSession Container RTP processing session pool event queues event processing● Signaling: Async, one thread per call or thread pool● Media: Sync, Thread pool 18
  19. SEMS B2BUA architecture DIALOG DIALOG SIP message event SIP message● Two complete, separate instances of dialog handling: Locally SIP correct 19
  20. E.g.: Session Timers SST: refresh! Re-INVITE SDP changed? 200 Re-INVITE event: session changed 200● Use UPDATE or re-INVITE for refresh● SST and timer values per leg● Try to have e2e refresh 20
  21. SBC programmability● Pluggable Call Control modules for custom SBC application scenario● e.g. policing with external data source Call control Call control Call control SBC SEMS core 21
  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 22
  23. Programmability example (1)● Call Forward settings via Web App● Destination queried via REST interface 23
  24. Minimal Play! Web app 24
  25. ...with CRUD module 25
  26. REST call control module● Using libcurl for http request● Result expected as JSON or TEXT (key=valuen) 26
  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 ● ... 27
  28. Programmability example (3)FRAFOS:SBC withProvisioning andOAM GUI 28
  29. FRAFOS: SBC high availability● Replication of call state to hot standby● Transparent fail-over 29
  30. SBC performance 30
  31. Thank You.