SlideShare a Scribd company logo
1 of 48
Download to read offline
SIP Express Media Server
SEMS
Workshop
KamailioWorld 2014
Stefan Sayer
VoIP Services Consulting and Development
email/xmpp:stefan.sayer@gmail.com
stefan.sayer@frafos.com
2
Contents
● Intro: History, general info
● How to: install, use, provision, maintain
● Voice app programming
● SBC
3
Contents
● Intro: History, general info
● How to: install, use, provision, maintain
● Voice app programming
● SBC
4
History of SEMS
● Originates from the same team as SER
(Kamailio/Openser/...) as Fraunhofer FOKUS,
German public R&D institute
● Beginning: Answering machine add-on to SER
● Developed at various related companies
(iptelorg, IPTEGO, ...)
● Since 2010 mainly at FRAFOS
● Open Source community since 2003
5
FRAFOS, ABC SBC and SEMS
● FRAFOS Session Border Controller product
”ABC SBC” based on SEMS
● Much of FRAFOS' internal development being
contributed to FOSS SEMS
● Best-effort support on mailing lists
● Sadly lately not much SEMS advertising,
community efforts, website updates etc
6
Sipwise sip:provider and SEMS
● SEMS as central B2BUA in sip:provider
● Several Sipwise-sponsored features/apps
 e.g. PBX-type call flows, Mobile push app
● SPCE 100% open source
● sip:provider pro has closed source add-ons
 e.g. replication
7
F/OSS SEMS users
● Carriers
 Deutsche Telekom
 QSC
● VoIP service providers, telecoms services
 TelTech, Millenicom, Gammatelecom, XConnect, …
● Universities
 TU Berlin (D), FH Darmstadt (D), FELT (CZ), UPF
(ES), ...
● Many more from FOSS community
8
Focus
● Telecoms applications, carrier environment
 High volume prompts, voicemail, conferencing, …
 B2BUA / SBC
● Speed and reliability
● Only SIP, not multi-protocol (almost)
● Versatile and easy to use app server for SIP
networks
● Built for purpose
9
Classic use cases
10
SEMS Use Cases
● Endpoint apps
 Prompts; RBT, pre-call prompts etc
 Conference; meet-me, with web GUI, in/outbound
 Voicemail; voicemail2email, mailbox
● App development
 C++ apps
 DSM
● SBC / B2BUA
11
Practical / Technical
● Language: C++, C, some Python, DSM
● Sloccount: ~90k C++, 15k C
● Runs on Linux, Mac, BSD, ...
● Preferred OS: debian, RHEL/CentOS/EPEL
● Make files and CMake build system
● Links: http://iptel.org/sems, git.sip-router.org/sems
● Support/dev ML: http://lists.iptel.org
● Core / plugin architecture
● Docs: make doc ; or see doc/Readme.*
12
SEMS Versions
● SPCE uses 1.4
● 1.5 with lots more SBC features
● Git master (to be 1.6) pretty stable for a while,
recommended especially for SBC
 Performance, registrations, sub/not, features, call
control API etc
● EPEL/OBS still mostly at 1.4ish, use from
source recommended (as of Apr 2014)
13
Contents
● Intro: History, general info
● How to: install, use, provision, maintain
● Voice app programming
● SBC
14
Getting practical...Installation!
● On fresh debian wheezy (netinstall)
 su - ; apt-get install sudo; usermod -a G sudo semsadmin
 sudo apt-get install debhelper devscripts
 sudo apt-get install g++ make libspandsp-dev flite-dev libspeex-dev 
libssl-dev python-dev python-sip-dev openssl libev-dev 
libmysql++-dev libevent-dev libxml2-dev libcurl4-openssl-dev
 sudo apt-get install git
 git clone git://git.sip-router.org/sems
● Debian package creation
 cd sems ; ln -s pkg/debian . ; dch -b -v `git describe --always` "sems git
master" ; dpkg-buildpackage -rfakeroot -us -uc
● Install: dpkg -i ../sems_x.y.z.deb
● This is the VM image contents (+ small cfg chg)
15
Basic configuration
● /etc/sems/sems.conf
 Interfaces (default: first system interface)
 Loaded plugins: load_plugins=...
 App: application=...
● Example – default: webconference
 load_plugins=wav;isac;l16;speex;g722;gsm;ilbc;webconference
 application=webconference
● Application config files in /etc/sems/etc
 e.g. /etc/sems/etc/webconference.conf
16
App selection & provisioning
application= ...
# $(ruri.user) - user part of ruri is taken as application,
# e.g. sip:announcement@host
# $(ruri.param) - uri parameter "app", e.g.
# sip:joe@host.net;app=announcement
# $(apphdr) - the value of the P-App-Name header is used
#
# $(mapping) - regex=>application mapping is read from
# app_mapping.conf (see app_mapping.conf)
# <application name> - application name configured here, e.g.
# application=announcement
Provisioning through SIP
message:
 DB/profile access only
once, in the proxy
 Simpler system design
17
Applications
prompts announcement Prompt (lang, domain, ...)
announce_transfer Prompt and continue B2BUA
early_announce Ring Back Tones (183)
conference conference Simple meet-me conf
webconference Meet-me + GUI (XMLRPC)
echo echo test
voicemail voicemail Leave message; vm2email or mailbox
annrecorder Record prompt
msg_storage Store msg on FS
mailbox IMAP mailbox app
mwi Message waiting indication
click2dial click2dial Click 2 dial from webpage
di_dial Dial out (any app)
SBC sbc See next chapter
18
Components / interfacing
interfacing xmlrpc2di XMLRPC interface and control
jsonrpc Json-rpc (v2)
stats Status, interface (simple UDP commands)
diameter_client DIAMETER (base protocol) client
monitoring In-mem DB (KV-store), detailed calls status
auth uac_auth SIP client auth
registration registrar_client SIP client registration
reg_agent SIP registration, from config file
db_reg_agent SIP registration, from DB
sst session_timer SIP session timer
19
Monitoring, logging, tools
● sems-stats -c ”set_loglevel 3”
● sems-list-calls, sems-get-callproperties etc
● sems-logfile-callextract
20
Contents
● Intro: History, general info
● How to: install, use, provision, maintain
● Voice app programming
● SBC
21
Voice app programming
● C++ API
● Python API
● DSM
 Simple + ~intuitive script language
 Interpreter and environment in SEMS
 Use for
 Rapid Prototyping
 Complex apps
 Code structuring and re-use (modules)
22
Services: how to define
● State diagrams are
the “natural” way to
correctly define and
document service
logic
● Do actions and
process events,
while transitioning
from state to state
Play
waiting music
Play
waiting music
Play
greeting message
Play
greeting message
Recording
available?
no
yes
Play
recording
Play
recording
Play
“Thank you for
using broadcast”
Play
“Thank you for
using broadcast”
Recording
ends
fwd/back,
current pos.
key
Recording
unavailable
Recording
available
PausePause
Pause key,
call on hold
Pause key/
call pickup
Play help
message
Play help
message
Update play
position
Update play
position
help
key
Example:
23
DSM: State machine notation
NAME
action;
action;
condition;
condition;
action;
action;
NAME
action;
action;
enter actions
exit actions
transition actions
transition
conditions
state
transition
-- comment
import(mod_name);
[initial] state name
[ enter {
action;
action;
...
} ]
[ exit {
action;
action;
...
} ]
;
transition name s1 - [ { condition; condition; ... } ]
[/ { action; action; ...} ] -> s2;
DSM state diagram definition language:
24
DSM scripts
DSM service environment
audio / RTP
SIP
timers
system
RPC / DI API
other DSMs
state machine
processing
event
queue
control
events
chart
reader
compiled DSM
(re-) load
25
DSM: example
-- just a small demo
import(mod_mysql);
import(mod_utils);
initial state START
enter {
playFile(hello.wav);
mysql.connect(mysql://user:pwd@domain/db);
mysql.queryGetResult(select count(id) as new_messages from messages where userid=@user);
};
transition “we have some messages” START – test($new_messages != 0) -> PLAY_MESSAGES;
transition “no messages” - test($new_messages == 0) / playFile(no_messages.wav) -> PLAY_AND_BYE;
state PLAY_AND_BYE;
transition “BYE received” PLAY_AND_BYE – hangup / stop(false) -> end;
transition “files finished” PLAY_AND_BYE – noAudioTest() / stop(true) -> end;
state PLAY_MESSAGES
enter {
playFile(you_have.wav);
utils.playCountRight($new_messages);
playFile(messages.wav);
};
transition “key to listen to the messages” PLAY_MESSAGES – keyPress(1) –> PLAY_MSG;
transition “key to main menu” PLAY_MESSAGES – keyPress(2) –> MENU;
...
26
DSM language: Identifiers
● Variables: $var
 e.g. set($userid=”stefan”)
 test(len($pin)==5)
● Event Parameters: #param
 e.g. test(#key==1)
● “Selects”: @select
 e.g.playFile(@user); @callid, @local_tag
27
DSM: Control
● Event types
 invite, key, timer, noAudio, event (generic), ...
● Hierarchical DSMs
 jumpFSM(), callFSM(), returnFSM()
● repost()
 mark event as not processed (transitional states)
● stop()
● exceptions (exception transitions)
28
DSM: Functionality
● Core module: basic actions and conditions
 playFile, setPromptSet, playPrompt, recordFile, set,
append, log, setTimer, …
● Modules: more actions and conditions
 import(mod_name)
 mod.action();
29
Trying it out: IVR app
VM: /usr/lib/sems/dsm/connect_extension.dsm src: doc/dsm/examples/b2b_connect_extension
30
IVR app: connecting B2B
● Example connects to sip:000777xyz@iptel.org
31
DSM: Modules
Module Functionality
mod_sys System commands (sys.mkdir, ...)
mod_dlg Dialog related (dlg.bye, ...)
mod_uri URI processing and operations
mod_conference Conferencing functions (conference.join,...)
mod_utils Utilities (utils.getNewId, utils.spell, ...)
mod_monitoring Monitoring functions
mod_aws Amazon AWS functions
mod_mysql MySQL (mysq.query)
mod_py Python (py(print 'hello world'))
32
DSM: Writing modules
● Implement actions and conditions
● Simplified by macros
DEF_ACTION_1P(SCMkDirAction);
…
DEF_CMD("sys.mkdir", SCMkDirAction);
…
EXEC_ACTION_START(SCMkDirAction) {
string d = resolveVars(arg, sess, sc_sess, event_params);
DBG("mkdir '%s'n", d.c_str());
if (sys_mkdir(d.c_str())) {
sc_sess->SET_ERRNO(DSM_ERRNO_OK);
} else {
sc_sess->SET_ERRNO(DSM_ERRNO_FILE);
}
} EXEC_ACTION_END;
33
DSM benefits
● eases development
● enforces modularity, code reusability
● check service consistency (e.g. BYE handled)
● create service directly from specification
● reduce time to market
 adapt services on the fly
 speed up implementation/customization – test -
product cycle
34
Contents
● Intro: History, general info
● How to: install, use, provision, maintain
● Voice app programming
● SBC
35
SBC application
● B2BUA, completely transparent to fully opaque
● Network separation
● SIP and (optional) RTP
● Mediation (SIP message, codecs etc)
● Registration handling (reg caching) etc
● ”The Swiss Army Knife of call stateful SIP
processing”
36
Flexible profile based control
SEMS SBC
#
U 210.13.3.122:5080 -> 210.13.3.100:5060
INVITE sip:+49123@osbc1.mynet.net SIP/2.0
From: “John” <sip:+431556221@mynet.net>;tag=12
To: “Clara” <+49123@mynet.net>
Call-ID: 3cde5d1a960a-dez6oz34llo4
...
#
U 210.13.3.100:5060 -> 213.192.59.75:5060
INVITE sip:echo@iptel.org SIP/2.0
From: <anonymous@mynet.net>;tag=3213
To: <sip:echo@iptel.org>
Call-ID: y76IIPf4UD68bb
...
load_profiles=iptelecho
active_profile=iptelecho
...
sbc.conf
URI=sip:echo@iptel.org
From=<anonymous@mynet.net>
To=<sip:echo@iptel.org>
...
iptelecho.sbcprofile.conf
37
control SBC from proxy
SEMS SBC
#
U 210.13.3.122:5080 -> 210.13.3.100:5060
INVITE sip:+49123@osbc1.mynet.net SIP/2.0
From: “John” <sip:+431556221@mynet.net>;tag=12
To: “Clara” <+49123@mynet.net>
Call-ID: 3cde5d1a960a-dez6oz34llo4
...
#
U 210.13.3.100:5060 -> 213.192.59.75:5060
INVITE sip:+49123@sbc1.mypeer.net SIP/2.0
From: <+431556221@mynet.net>;tag=3213
To: <sip:+49123@mypeer.net>
Call-ID: 3cde5d1a960a-dez6oz34llo4_leg2
...
URI=$tU@sbc1.mypeer.net
From=<$fU@mynet.net>
To=<sip:$tU@mypeer.net>
Call-ID=$ci_leg2
...
set_fromto.sbcprofile.conf
known
SER
pseudo-variables
38
SBC example: auth_b2b
● Identity change
● SIP auth upstream
● Set e.g. In headers
 $P(name) selects
name from P-App-Param
RURI=sip:$rU@$P(d)
From=""$P(u)" <sip:$P(u)@$P(d)>"
To=""$rU" <sip:$rU@$P(d)>"
enable_auth=yes
auth_user=$P(u)
auth_pwd=$P(p)
auth_b2b.sbcprofile.conf
Test:
39
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=>iptel
fliptel.com=>fliptel
urimap.conf
40
Some profile options
RURI=$r
From=$f
To=$t
Contact=<sip:$Ri>
Call-ID=$ci_leg2
outbound_proxy=sip:192.168.5.106:5060
force_outbound_proxy=yes
next_hop=192.168.5.106:5060
outbound_interface=extern
enable_reg_caching=yes
min_reg_expires=3600
max_ua_expires=60
dlg_nat_handling=yes
enable_rtprelay=yes
rtprelay_force_symmetric_rtp=yes
aleg_rtprelay_interface=intern
rtprelay_interface=default
header_filter=blacklist
header_list=P-App-Param,P-App-Name
sdp_filter=whitelist
sdpfilter_list=g729,g723,ilbc,speex,gsm
append_headers="P-Src-IP: $sirn"
enable_session_timer=yes
session_expires=120
minimum_timer=90
enable_auth=yes
auth_user=$P(u)
auth_pwd=$P(p)
41
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
42
SBC modules
SBC sbc sbc application
uac_auth For SIP authentication
xmlrpc2di Control, e.g. Profile reload, regex maps reload
Call control cc_ctl Control settings from SIP msg headers
cc_rest Read settings from http API
cc_prepaid Prepaid, internal balances
cc_prepaid_xmlrpc Prepaid, balances external, queried via XMLRPC
cc_call_timer Max call duration timer
cc_pcalls Parallel call limit
cc_syslog_cdr CDR generation
cc_dsm SBC apps in DSM script
43
SBC programming
● Simple call_control API
 start(), connect(), end()
● Extended call_control API
 SIP Message events, like sipRequest, sipReply, ...
 B2B events: B2B.otherRequest, B2B.otherReply, …
 Disconnect and reconnect call legs (PBX style)
 Program with DSM script
44
SBC DSM example
45
SBC DSM example (cont)
46
SBC DSM example (cont)
47
Questions?
Thanks for your attention.
48
Links and References
● SEMS homepage: http://iptel.org/sems
● Code: sems repo at git.sip-router.org
● DSM documentation
http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sems;a=tree;f=doc/dsm
● FRAFOS website: www.frafos.com

More Related Content

What's hot

Scaling Asterisk with Kamailio
Scaling Asterisk with KamailioScaling Asterisk with Kamailio
Scaling Asterisk with KamailioFred Posner
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and KamailioGiacomo Vacca
 
SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)Fred Posner
 
SIPREC RTPEngine Media Forking
SIPREC RTPEngine Media ForkingSIPREC RTPEngine Media Forking
SIPREC RTPEngine Media ForkingHossein Yavari
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesPaolo Visintin
 
FreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8sFreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8sChien Cheng Wu
 
Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances Jöran Vinzens
 
BGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and DiscussionBGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and DiscussionAPNIC
 
Session Initiation Protocol
Session Initiation ProtocolSession Initiation Protocol
Session Initiation ProtocolMatt Bynum
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceEvan McGee
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker建澄 吳
 
Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)William Lee
 
FreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBCFreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBCMoises Silva
 
Sip Detailed , Call flows , Architecture descriptions , SIP services , sip se...
Sip Detailed , Call flows , Architecture descriptions , SIP services , sip se...Sip Detailed , Call flows , Architecture descriptions , SIP services , sip se...
Sip Detailed , Call flows , Architecture descriptions , SIP services , sip se...ALTANAI BISHT
 
Introduction to FreeSWITCH
Introduction to FreeSWITCHIntroduction to FreeSWITCH
Introduction to FreeSWITCHChien Cheng Wu
 
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH DeploymentThree Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH DeploymentFred Posner
 

What's hot (20)

Scaling Asterisk with Kamailio
Scaling Asterisk with KamailioScaling Asterisk with Kamailio
Scaling Asterisk with Kamailio
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and Kamailio
 
Kamailio - API Based SIP Routing
Kamailio - API Based SIP RoutingKamailio - API Based SIP Routing
Kamailio - API Based SIP Routing
 
SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)
 
SIPREC RTPEngine Media Forking
SIPREC RTPEngine Media ForkingSIPREC RTPEngine Media Forking
SIPREC RTPEngine Media Forking
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and Kubernetes
 
Kamailio on Docker
Kamailio on DockerKamailio on Docker
Kamailio on Docker
 
FreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8sFreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8s
 
Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances
 
Kamailio - SIP Routing in Lua
Kamailio - SIP Routing in LuaKamailio - SIP Routing in Lua
Kamailio - SIP Routing in Lua
 
BGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and DiscussionBGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and Discussion
 
Session Initiation Protocol
Session Initiation ProtocolSession Initiation Protocol
Session Initiation Protocol
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
 
Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)
 
FreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBCFreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBC
 
Sip Detailed , Call flows , Architecture descriptions , SIP services , sip se...
Sip Detailed , Call flows , Architecture descriptions , SIP services , sip se...Sip Detailed , Call flows , Architecture descriptions , SIP services , sip se...
Sip Detailed , Call flows , Architecture descriptions , SIP services , sip se...
 
Introduction to FreeSWITCH
Introduction to FreeSWITCHIntroduction to FreeSWITCH
Introduction to FreeSWITCH
 
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH DeploymentThree Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
 
Kamailio - Secure Communication
Kamailio - Secure CommunicationKamailio - Secure Communication
Kamailio - Secure Communication
 

Similar to Getting started with SIP Express Media Server SIP app server and SBC - workshop

Designing High Performance RTC Signaling Servers
Designing High Performance RTC Signaling ServersDesigning High Performance RTC Signaling Servers
Designing High Performance RTC Signaling ServersDaniel-Constantin Mierla
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Ata Rehman
 
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIMarcelo Gornstein
 
Leveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN PerformanceLeveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN Performancebrettallison
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration SeminarYoss Cohen
 
SquirrelMail for webmail
SquirrelMail for webmailSquirrelMail for webmail
SquirrelMail for webmailAryman Gautam
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick RethansBachkoutou Toutou
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayAnne Nicolas
 
Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop AutomationRui Lapa
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksGlen Ogilvie
 
Centralized Fog Server with OpenLDAP
Centralized Fog Server with OpenLDAP Centralized Fog Server with OpenLDAP
Centralized Fog Server with OpenLDAP tare
 
JmDNS : Service Discovery for the 21st Century
 JmDNS : Service Discovery for the 21st Century JmDNS : Service Discovery for the 21st Century
JmDNS : Service Discovery for the 21st CenturyGnu Alsonative
 
JmDNS : Service Discovery for the 21st Century
 JmDNS : Service Discovery for the 21st Century JmDNS : Service Discovery for the 21st Century
JmDNS : Service Discovery for the 21st CenturyGnu Alsonative
 
Session 2: Johann Deutinger (SBA, Lync)
Session 2: Johann Deutinger (SBA, Lync)Session 2: Johann Deutinger (SBA, Lync)
Session 2: Johann Deutinger (SBA, Lync)Joachim Farla
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 

Similar to Getting started with SIP Express Media Server SIP app server and SBC - workshop (20)

Designing High Performance RTC Signaling Servers
Designing High Performance RTC Signaling ServersDesigning High Performance RTC Signaling Servers
Designing High Performance RTC Signaling Servers
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
 
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
 
Leveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN PerformanceLeveraging Open Source to Manage SAN Performance
Leveraging Open Source to Manage SAN Performance
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
 
Ltsp talk
Ltsp talkLtsp talk
Ltsp talk
 
SquirrelMail for webmail
SquirrelMail for webmailSquirrelMail for webmail
SquirrelMail for webmail
 
Kscope presentation 2013
Kscope presentation 2013Kscope presentation 2013
Kscope presentation 2013
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops way
 
Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop Automation
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
Centralized Fog Server with OpenLDAP
Centralized Fog Server with OpenLDAP Centralized Fog Server with OpenLDAP
Centralized Fog Server with OpenLDAP
 
JmDNS : Service Discovery for the 21st Century
 JmDNS : Service Discovery for the 21st Century JmDNS : Service Discovery for the 21st Century
JmDNS : Service Discovery for the 21st Century
 
JmDNS : Service Discovery for the 21st Century
 JmDNS : Service Discovery for the 21st Century JmDNS : Service Discovery for the 21st Century
JmDNS : Service Discovery for the 21st Century
 
SIP Router Project
SIP Router ProjectSIP Router Project
SIP Router Project
 
Session 2: Johann Deutinger (SBA, Lync)
Session 2: Johann Deutinger (SBA, Lync)Session 2: Johann Deutinger (SBA, Lync)
Session 2: Johann Deutinger (SBA, Lync)
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 

More from stefansayer

The FRAFOS ABC SBC WebRTC gateway
The FRAFOS ABC SBC WebRTC gateway The FRAFOS ABC SBC WebRTC gateway
The FRAFOS ABC SBC WebRTC gateway stefansayer
 
WebRTC: Why and How?
WebRTC: Why and How?WebRTC: Why and How?
WebRTC: Why and How?stefansayer
 
SIP Express Media Server SBC application as powerful SBC and SIP toolbox
SIP Express Media Server SBC application as powerful SBC and SIP toolboxSIP Express Media Server SBC application as powerful SBC and SIP toolbox
SIP Express Media Server SBC application as powerful SBC and SIP toolboxstefansayer
 
FRAFOS ABC Session Border Controller
FRAFOS ABC Session Border ControllerFRAFOS ABC Session Border Controller
FRAFOS ABC Session Border Controllerstefansayer
 
Understanding Session Border Controllers
Understanding Session Border ControllersUnderstanding Session Border Controllers
Understanding Session Border Controllersstefansayer
 
Frafos ABC SBC - Secure peering
Frafos ABC SBC - Secure peeringFrafos ABC SBC - Secure peering
Frafos ABC SBC - Secure peeringstefansayer
 
FRAFOS Secure Session Border Control
FRAFOS Secure Session Border ControlFRAFOS Secure Session Border Control
FRAFOS Secure Session Border Controlstefansayer
 
12 vladimir.broz-sems-sbc
12 vladimir.broz-sems-sbc12 vladimir.broz-sems-sbc
12 vladimir.broz-sems-sbcstefansayer
 
Fosdem2012 sayer-sems-sbc
Fosdem2012 sayer-sems-sbcFosdem2012 sayer-sems-sbc
Fosdem2012 sayer-sems-sbcstefansayer
 

More from stefansayer (9)

The FRAFOS ABC SBC WebRTC gateway
The FRAFOS ABC SBC WebRTC gateway The FRAFOS ABC SBC WebRTC gateway
The FRAFOS ABC SBC WebRTC gateway
 
WebRTC: Why and How?
WebRTC: Why and How?WebRTC: Why and How?
WebRTC: Why and How?
 
SIP Express Media Server SBC application as powerful SBC and SIP toolbox
SIP Express Media Server SBC application as powerful SBC and SIP toolboxSIP Express Media Server SBC application as powerful SBC and SIP toolbox
SIP Express Media Server SBC application as powerful SBC and SIP toolbox
 
FRAFOS ABC Session Border Controller
FRAFOS ABC Session Border ControllerFRAFOS ABC Session Border Controller
FRAFOS ABC Session Border Controller
 
Understanding Session Border Controllers
Understanding Session Border ControllersUnderstanding Session Border Controllers
Understanding Session Border Controllers
 
Frafos ABC SBC - Secure peering
Frafos ABC SBC - Secure peeringFrafos ABC SBC - Secure peering
Frafos ABC SBC - Secure peering
 
FRAFOS Secure Session Border Control
FRAFOS Secure Session Border ControlFRAFOS Secure Session Border Control
FRAFOS Secure Session Border Control
 
12 vladimir.broz-sems-sbc
12 vladimir.broz-sems-sbc12 vladimir.broz-sems-sbc
12 vladimir.broz-sems-sbc
 
Fosdem2012 sayer-sems-sbc
Fosdem2012 sayer-sems-sbcFosdem2012 sayer-sems-sbc
Fosdem2012 sayer-sems-sbc
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Getting started with SIP Express Media Server SIP app server and SBC - workshop

  • 1. SIP Express Media Server SEMS Workshop KamailioWorld 2014 Stefan Sayer VoIP Services Consulting and Development email/xmpp:stefan.sayer@gmail.com stefan.sayer@frafos.com
  • 2. 2 Contents ● Intro: History, general info ● How to: install, use, provision, maintain ● Voice app programming ● SBC
  • 3. 3 Contents ● Intro: History, general info ● How to: install, use, provision, maintain ● Voice app programming ● SBC
  • 4. 4 History of SEMS ● Originates from the same team as SER (Kamailio/Openser/...) as Fraunhofer FOKUS, German public R&D institute ● Beginning: Answering machine add-on to SER ● Developed at various related companies (iptelorg, IPTEGO, ...) ● Since 2010 mainly at FRAFOS ● Open Source community since 2003
  • 5. 5 FRAFOS, ABC SBC and SEMS ● FRAFOS Session Border Controller product ”ABC SBC” based on SEMS ● Much of FRAFOS' internal development being contributed to FOSS SEMS ● Best-effort support on mailing lists ● Sadly lately not much SEMS advertising, community efforts, website updates etc
  • 6. 6 Sipwise sip:provider and SEMS ● SEMS as central B2BUA in sip:provider ● Several Sipwise-sponsored features/apps  e.g. PBX-type call flows, Mobile push app ● SPCE 100% open source ● sip:provider pro has closed source add-ons  e.g. replication
  • 7. 7 F/OSS SEMS users ● Carriers  Deutsche Telekom  QSC ● VoIP service providers, telecoms services  TelTech, Millenicom, Gammatelecom, XConnect, … ● Universities  TU Berlin (D), FH Darmstadt (D), FELT (CZ), UPF (ES), ... ● Many more from FOSS community
  • 8. 8 Focus ● Telecoms applications, carrier environment  High volume prompts, voicemail, conferencing, …  B2BUA / SBC ● Speed and reliability ● Only SIP, not multi-protocol (almost) ● Versatile and easy to use app server for SIP networks ● Built for purpose
  • 10. 10 SEMS Use Cases ● Endpoint apps  Prompts; RBT, pre-call prompts etc  Conference; meet-me, with web GUI, in/outbound  Voicemail; voicemail2email, mailbox ● App development  C++ apps  DSM ● SBC / B2BUA
  • 11. 11 Practical / Technical ● Language: C++, C, some Python, DSM ● Sloccount: ~90k C++, 15k C ● Runs on Linux, Mac, BSD, ... ● Preferred OS: debian, RHEL/CentOS/EPEL ● Make files and CMake build system ● Links: http://iptel.org/sems, git.sip-router.org/sems ● Support/dev ML: http://lists.iptel.org ● Core / plugin architecture ● Docs: make doc ; or see doc/Readme.*
  • 12. 12 SEMS Versions ● SPCE uses 1.4 ● 1.5 with lots more SBC features ● Git master (to be 1.6) pretty stable for a while, recommended especially for SBC  Performance, registrations, sub/not, features, call control API etc ● EPEL/OBS still mostly at 1.4ish, use from source recommended (as of Apr 2014)
  • 13. 13 Contents ● Intro: History, general info ● How to: install, use, provision, maintain ● Voice app programming ● SBC
  • 14. 14 Getting practical...Installation! ● On fresh debian wheezy (netinstall)  su - ; apt-get install sudo; usermod -a G sudo semsadmin  sudo apt-get install debhelper devscripts  sudo apt-get install g++ make libspandsp-dev flite-dev libspeex-dev libssl-dev python-dev python-sip-dev openssl libev-dev libmysql++-dev libevent-dev libxml2-dev libcurl4-openssl-dev  sudo apt-get install git  git clone git://git.sip-router.org/sems ● Debian package creation  cd sems ; ln -s pkg/debian . ; dch -b -v `git describe --always` "sems git master" ; dpkg-buildpackage -rfakeroot -us -uc ● Install: dpkg -i ../sems_x.y.z.deb ● This is the VM image contents (+ small cfg chg)
  • 15. 15 Basic configuration ● /etc/sems/sems.conf  Interfaces (default: first system interface)  Loaded plugins: load_plugins=...  App: application=... ● Example – default: webconference  load_plugins=wav;isac;l16;speex;g722;gsm;ilbc;webconference  application=webconference ● Application config files in /etc/sems/etc  e.g. /etc/sems/etc/webconference.conf
  • 16. 16 App selection & provisioning application= ... # $(ruri.user) - user part of ruri is taken as application, # e.g. sip:announcement@host # $(ruri.param) - uri parameter "app", e.g. # sip:joe@host.net;app=announcement # $(apphdr) - the value of the P-App-Name header is used # # $(mapping) - regex=>application mapping is read from # app_mapping.conf (see app_mapping.conf) # <application name> - application name configured here, e.g. # application=announcement Provisioning through SIP message:  DB/profile access only once, in the proxy  Simpler system design
  • 17. 17 Applications prompts announcement Prompt (lang, domain, ...) announce_transfer Prompt and continue B2BUA early_announce Ring Back Tones (183) conference conference Simple meet-me conf webconference Meet-me + GUI (XMLRPC) echo echo test voicemail voicemail Leave message; vm2email or mailbox annrecorder Record prompt msg_storage Store msg on FS mailbox IMAP mailbox app mwi Message waiting indication click2dial click2dial Click 2 dial from webpage di_dial Dial out (any app) SBC sbc See next chapter
  • 18. 18 Components / interfacing interfacing xmlrpc2di XMLRPC interface and control jsonrpc Json-rpc (v2) stats Status, interface (simple UDP commands) diameter_client DIAMETER (base protocol) client monitoring In-mem DB (KV-store), detailed calls status auth uac_auth SIP client auth registration registrar_client SIP client registration reg_agent SIP registration, from config file db_reg_agent SIP registration, from DB sst session_timer SIP session timer
  • 19. 19 Monitoring, logging, tools ● sems-stats -c ”set_loglevel 3” ● sems-list-calls, sems-get-callproperties etc ● sems-logfile-callextract
  • 20. 20 Contents ● Intro: History, general info ● How to: install, use, provision, maintain ● Voice app programming ● SBC
  • 21. 21 Voice app programming ● C++ API ● Python API ● DSM  Simple + ~intuitive script language  Interpreter and environment in SEMS  Use for  Rapid Prototyping  Complex apps  Code structuring and re-use (modules)
  • 22. 22 Services: how to define ● State diagrams are the “natural” way to correctly define and document service logic ● Do actions and process events, while transitioning from state to state Play waiting music Play waiting music Play greeting message Play greeting message Recording available? no yes Play recording Play recording Play “Thank you for using broadcast” Play “Thank you for using broadcast” Recording ends fwd/back, current pos. key Recording unavailable Recording available PausePause Pause key, call on hold Pause key/ call pickup Play help message Play help message Update play position Update play position help key Example:
  • 23. 23 DSM: State machine notation NAME action; action; condition; condition; action; action; NAME action; action; enter actions exit actions transition actions transition conditions state transition -- comment import(mod_name); [initial] state name [ enter { action; action; ... } ] [ exit { action; action; ... } ] ; transition name s1 - [ { condition; condition; ... } ] [/ { action; action; ...} ] -> s2; DSM state diagram definition language:
  • 24. 24 DSM scripts DSM service environment audio / RTP SIP timers system RPC / DI API other DSMs state machine processing event queue control events chart reader compiled DSM (re-) load
  • 25. 25 DSM: example -- just a small demo import(mod_mysql); import(mod_utils); initial state START enter { playFile(hello.wav); mysql.connect(mysql://user:pwd@domain/db); mysql.queryGetResult(select count(id) as new_messages from messages where userid=@user); }; transition “we have some messages” START – test($new_messages != 0) -> PLAY_MESSAGES; transition “no messages” - test($new_messages == 0) / playFile(no_messages.wav) -> PLAY_AND_BYE; state PLAY_AND_BYE; transition “BYE received” PLAY_AND_BYE – hangup / stop(false) -> end; transition “files finished” PLAY_AND_BYE – noAudioTest() / stop(true) -> end; state PLAY_MESSAGES enter { playFile(you_have.wav); utils.playCountRight($new_messages); playFile(messages.wav); }; transition “key to listen to the messages” PLAY_MESSAGES – keyPress(1) –> PLAY_MSG; transition “key to main menu” PLAY_MESSAGES – keyPress(2) –> MENU; ...
  • 26. 26 DSM language: Identifiers ● Variables: $var  e.g. set($userid=”stefan”)  test(len($pin)==5) ● Event Parameters: #param  e.g. test(#key==1) ● “Selects”: @select  e.g.playFile(@user); @callid, @local_tag
  • 27. 27 DSM: Control ● Event types  invite, key, timer, noAudio, event (generic), ... ● Hierarchical DSMs  jumpFSM(), callFSM(), returnFSM() ● repost()  mark event as not processed (transitional states) ● stop() ● exceptions (exception transitions)
  • 28. 28 DSM: Functionality ● Core module: basic actions and conditions  playFile, setPromptSet, playPrompt, recordFile, set, append, log, setTimer, … ● Modules: more actions and conditions  import(mod_name)  mod.action();
  • 29. 29 Trying it out: IVR app VM: /usr/lib/sems/dsm/connect_extension.dsm src: doc/dsm/examples/b2b_connect_extension
  • 30. 30 IVR app: connecting B2B ● Example connects to sip:000777xyz@iptel.org
  • 31. 31 DSM: Modules Module Functionality mod_sys System commands (sys.mkdir, ...) mod_dlg Dialog related (dlg.bye, ...) mod_uri URI processing and operations mod_conference Conferencing functions (conference.join,...) mod_utils Utilities (utils.getNewId, utils.spell, ...) mod_monitoring Monitoring functions mod_aws Amazon AWS functions mod_mysql MySQL (mysq.query) mod_py Python (py(print 'hello world'))
  • 32. 32 DSM: Writing modules ● Implement actions and conditions ● Simplified by macros DEF_ACTION_1P(SCMkDirAction); … DEF_CMD("sys.mkdir", SCMkDirAction); … EXEC_ACTION_START(SCMkDirAction) { string d = resolveVars(arg, sess, sc_sess, event_params); DBG("mkdir '%s'n", d.c_str()); if (sys_mkdir(d.c_str())) { sc_sess->SET_ERRNO(DSM_ERRNO_OK); } else { sc_sess->SET_ERRNO(DSM_ERRNO_FILE); } } EXEC_ACTION_END;
  • 33. 33 DSM benefits ● eases development ● enforces modularity, code reusability ● check service consistency (e.g. BYE handled) ● create service directly from specification ● reduce time to market  adapt services on the fly  speed up implementation/customization – test - product cycle
  • 34. 34 Contents ● Intro: History, general info ● How to: install, use, provision, maintain ● Voice app programming ● SBC
  • 35. 35 SBC application ● B2BUA, completely transparent to fully opaque ● Network separation ● SIP and (optional) RTP ● Mediation (SIP message, codecs etc) ● Registration handling (reg caching) etc ● ”The Swiss Army Knife of call stateful SIP processing”
  • 36. 36 Flexible profile based control SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net SIP/2.0 From: “John” <sip:+431556221@mynet.net>;tag=12 To: “Clara” <+49123@mynet.net> Call-ID: 3cde5d1a960a-dez6oz34llo4 ... # U 210.13.3.100:5060 -> 213.192.59.75:5060 INVITE sip:echo@iptel.org SIP/2.0 From: <anonymous@mynet.net>;tag=3213 To: <sip:echo@iptel.org> Call-ID: y76IIPf4UD68bb ... load_profiles=iptelecho active_profile=iptelecho ... sbc.conf URI=sip:echo@iptel.org From=<anonymous@mynet.net> To=<sip:echo@iptel.org> ... iptelecho.sbcprofile.conf
  • 37. 37 control SBC from proxy SEMS SBC # U 210.13.3.122:5080 -> 210.13.3.100:5060 INVITE sip:+49123@osbc1.mynet.net SIP/2.0 From: “John” <sip:+431556221@mynet.net>;tag=12 To: “Clara” <+49123@mynet.net> Call-ID: 3cde5d1a960a-dez6oz34llo4 ... # U 210.13.3.100:5060 -> 213.192.59.75:5060 INVITE sip:+49123@sbc1.mypeer.net SIP/2.0 From: <+431556221@mynet.net>;tag=3213 To: <sip:+49123@mypeer.net> Call-ID: 3cde5d1a960a-dez6oz34llo4_leg2 ... URI=$tU@sbc1.mypeer.net From=<$fU@mynet.net> To=<sip:$tU@mypeer.net> Call-ID=$ci_leg2 ... set_fromto.sbcprofile.conf known SER pseudo-variables
  • 38. 38 SBC example: auth_b2b ● Identity change ● SIP auth upstream ● Set e.g. In headers  $P(name) selects name from P-App-Param RURI=sip:$rU@$P(d) From=""$P(u)" <sip:$P(u)@$P(d)>" To=""$rU" <sip:$rU@$P(d)>" enable_auth=yes auth_user=$P(u) auth_pwd=$P(p) auth_b2b.sbcprofile.conf Test:
  • 39. 39 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=>iptel fliptel.com=>fliptel urimap.conf
  • 41. 41 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
  • 42. 42 SBC modules SBC sbc sbc application uac_auth For SIP authentication xmlrpc2di Control, e.g. Profile reload, regex maps reload Call control cc_ctl Control settings from SIP msg headers cc_rest Read settings from http API cc_prepaid Prepaid, internal balances cc_prepaid_xmlrpc Prepaid, balances external, queried via XMLRPC cc_call_timer Max call duration timer cc_pcalls Parallel call limit cc_syslog_cdr CDR generation cc_dsm SBC apps in DSM script
  • 43. 43 SBC programming ● Simple call_control API  start(), connect(), end() ● Extended call_control API  SIP Message events, like sipRequest, sipReply, ...  B2B events: B2B.otherRequest, B2B.otherReply, …  Disconnect and reconnect call legs (PBX style)  Program with DSM script
  • 48. 48 Links and References ● SEMS homepage: http://iptel.org/sems ● Code: sems repo at git.sip-router.org ● DSM documentation http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sems;a=tree;f=doc/dsm ● FRAFOS website: www.frafos.com