SlideShare a Scribd company logo
1 of 73
Download to read offline
WebRTC Cloud Phone with
Asterisk, sipML5 & Janus
Alessandro Polidori - @ale_polidori

Chicago, IL, USA
August 8th 2019
Web Everywhere
travels
health
customer service
shopping
pay tv
hotels
eCommerce ?
getSupport() ?
knowledge base
email
live chat
facebook messenger
automatic bot
We will call you within: LESS THAN 1 MINUTE !
???
NEW INTERACTIONS
Web - Video Calls - Smartphone GSM
What components ?
1. Backend PBX
2. Frontend Web
1. Backend PBX
2. Frontend Web
1. Backend PBX
2. Frontend Web
1. Backend
1. Backend PBX
1. Backend PBX
1. Backend PBX
1. Backend PBX
1. Backend PBX
{ REST-API }WebSocket
1. Backend PBX
{ REST-API }WebSocket
Rest-API Doc
Developer Doc
bit.ly/nethcti-devdoc
bit.ly/nethcti-api
REAL-TIME COMMUNICATION
To the WEB
JAVASCRIPT
Media Engine
APIs
getUserMedia

RTCPeerConnection

RTCDataChannel
NATIVE SUPPORT
No Plugins

OpenSource
APPLICATIONS
Audio - Video - Data - P2P
S I G N A L I N G
SDP: media describe

SIP over WebSocket

Server needed
N E T W O R K
STUN

TURN

ICE
WHY ?
High costs

VoIP deep knowledge

Additional plugins
Used by Google Hangouts - Discord

Facebook Messenger

Amazon Chime - TokBox
Android iOS Web SDK
webrtcindex.com
• Video Conferencing

• Telephony

• Customer Service

• Healthcare

• Unified Communications

• Gaming
… and Browser Support ?
caniuse.com
supported
partialnot supported
Native debug
InternetPSTN
JS
InternetPSTN
JS
InternetPSTN
Signaling

WebSocket / HTTPS
SRTP Media

UDP
2. Frontend Web
sipML5
SIP over WebSocket (signaling)
Audio - Video - IM - Screen Sharing
OnSIP platform backend
JsSIP fork
HTML
<!doctype html>
<html>
<head></head>
<body>
<video autoplay id="video"></video>
<script src="sip-client.js"></script>
</body>
</html>
HTML
<!doctype html>
<html>
<head></head>
<body>
<video autoplay id="video"></video>
<script src="sip-client.js"></script>
</body>
</html>
let configuration = {
uri: '3000@nethesis.it',
transportOptions: {
wsServers: [ 'wss://nethesis.it:8089/ws' ]
},
authorizationUser: '3000',
password: '1234'
};
let phone = new SIP.UA(configuration);
phone.on('registered', e => {...});
phone.on('invite', e => {...});
phone.on('...', e => {...});
phone.start();
1 User Agent
2 Video Call
3 Answer Call
4 Hangup
let configuration = {
uri: '3000@nethesis.it',
transportOptions: {
wsServers: [ 'wss://nethesis.it:8089/ws' ]
},
authorizationUser: '3000',
password: '1234'
};
let phone = new SIP.UA(configuration);
phone.on('registered', e => {...});
phone.on('invite', e => {...});
phone.on('...', e => {...});
phone.start();
1 User Agent
2 Video Call
3 Answer Call
4 Hangup
3 Answer Call
4 Hangup
2 Video Call
1 User Agent
let session = phone.invite('34012@nethesis.it');
session.on('progress', e => {...});
session.on('failed', e => {...});
session.on('trackAdded', () => {
let pc = session.sessionDescriptionHandler
.peerConnection;
let remoteStream = new MediaStream();
pc.getReceivers().forEach(receiver => {
remoteStream.addTrack(receiver.track);
});
remoteStreamVideo.srcObject = remoteStream;
remoteStreamVideo.play();
// and add local one
});
3 Answer Call
4 Hangup
2 Video Call
1 User Agent
let session = phone.invite('34012@nethesis.it');
session.on('progress', e => {...});
session.on('failed', e => {...});
session.on('trackAdded', () => {
let pc = session.sessionDescriptionHandler
.peerConnection;
let remoteStream = new MediaStream();
pc.getReceivers().forEach(receiver => {
remoteStream.addTrack(receiver.track);
});
remoteStreamVideo.srcObject = remoteStream;
remoteStreamVideo.play();
// and add local one
});
2 Video Call
4 Hangup
1 User Agent
3 Answer Call
phone.on('invite', session => {
session.on('progress', e => {...});
session.on('failed', e => {...});
session.on('trackAdded', () => {
let pc = session
.sessionDescriptionHandler
.peerConnection;
let remoteStream = new MediaStream();
pc.getReceivers().forEach(receiver => {
remoteStream.addTrack(receiver.track);
});
remoteStreamVideo.srcObject = remoteStream;
remoteStreamVideo.play();
// and add local one
});
});
2 Video Call
4 Hangup
1 User Agent
3 Answer Call
phone.on('invite', session => {
session.on('progress', e => {...});
session.on('failed', e => {...});
session.on('trackAdded', () => {
let pc = session
.sessionDescriptionHandler
.peerConnection;
let remoteStream = new MediaStream();
pc.getReceivers().forEach(receiver => {
remoteStream.addTrack(receiver.track);
});
remoteStreamVideo.srcObject = remoteStream;
remoteStreamVideo.play();
// and add local one
});
});
3 Answer Call
1 User Agent
2 Video Call
4 Hangup
let hangup = e => {
rtcSession.terminate();
};
Implementation #2
sipML5
Google I/O 2012
Signals: SIP over WebSocket
Audio - Video - IM - Screen Sharing
Desktop & Mobile
1Initialization
2SIP Stack Creation
3Events Listener
4Extension registration
5Video call
SIPml.init(successCb, errorCb);
function engineReadyCb(e) {
createSipStack();
}
function engineErrorCb(e) {
console.error(e.stack);
}
3Events Listener
4Extension registration
5Video call
1Initialization
2SIP Stack Creation
let sipStack = new SIPml.Stack({
realm: 'nethesis.it',
impu: 'sip:3000@nethesis.it',
password: '1234',
display_name: 'ale_polidori',
websocket_proxy_url: 'wss://nethesis.it:8089/ws',
events_listener: {
events: '*',
listener: sipEventsListener
}
});
sipStack.start();
2SIP Stack Creation
4Extension registration
5Video call
1Initialization
3Events Listener
function sipEventsListener (e) {
if (e.type === 'i_new_call') {
ringing.play();
e.newSession.setConfiguration({
video_local: document.getElementById(localId),
video_remote: document.getElementById(remoteId),
audio_remote: document.getElementById(audioId),
events_listener: {
events: '*',
listener: callEventsListener
}
});
}
}
2SIP Stack Creation
3Events Listener
5Video call
1Initialization
4Extension registration
let registerSession = sipStack.newSession(
'register', {
events_listener: {
events: '*',
listener: registerEventsListener
}
});
registerSession.register();
2SIP Stack Creation
3Events Listener
4Extension registration
1Initialization
5Video Call
let callSession = sipStack.newSession(
'call-audiovideo', {
video_local: document.getElementById(localId),
video_remote: document.getElementById(remoteId),
audio_remote: document.getElementById(audioId),
events_listener: {
events: '*',
listener: callEventsListener
}
}
);
callSession.call('00393401234567');
calling.play();
Implementation #3
Meetecho Company
WebRTC Gateway
Plugins: SIP, VideoConf, Screen Sharing, IM
Transports: HTTP, WebSocket, RabbitMQ
Monitoring
1 Initialization
2 Video Call
3 Answer Call
4 Hangup
Janus.init({
debug: 'all',
callback: function () {
console.log('Janus initialized');
// session creation...
}
});
3 Answer Call
4 Hangup
2 Session creation
1 User Agent
function createSession() {
let janus = new Janus({
server: 'https://nethesis.it/janus',
success: function () {
// attach SIP plugin...
},
error: function (err) {
console.error(err.stack);
},
destroyed: function () {
console.log('janus destroyed !');
}
});
}
3 Answer Call
4 Hangup
2 Session creation
1 User Agent
function createSession() {
let janus = new Janus({
server: 'https://nethesis.it/janus',
success: function () {
// attach SIP plugin...
},
error: function (err) {
console.error(err.stack);
},
destroyed: function () {
console.log('janus destroyed !');
}
});
}
2 Video Call
4 Hangup
1 User Agent
3 Attach SIP Plugin
function attachSipPlugin() {
janus.attach({
plugin: 'janus.plugin.sip',
success: function (sipHandle) {...},
error: function (err) {...},
onmessage: function (msg, jsep) {
if (msg.result.event === 'incomingcall') {
ringing.play();
}
},
onlocalstream: function (stream) {
Janus.attachMediaStream(localStreamVideo, stream);
},
onremotestream: function (stream) {
var videoTracks = stream.getVideoTracks();
Janus.attachMediaStream(
remoteStreamVideo,
new MediaStream(videoTracks)
);
},
oncleanup: function () {...}
});
}
2 Video Call
4 Hangup
1 User Agent
3 Attach SIP Plugin
function attachSipPlugin() {
janus.attach({
plugin: 'janus.plugin.sip',
success: function (sipHandle) {...},
error: function (err) {...},
onmessage: function (msg, jsep) {
if (msg.result.event === 'incomingcall') {
ringing.play();
}
},
onlocalstream: function (stream) {
Janus.attachMediaStream(localStreamVideo, stream);
},
onremotestream: function (stream) {
var videoTracks = stream.getVideoTracks();
Janus.attachMediaStream(
remoteStreamVideo,
new MediaStream(videoTracks)
);
},
oncleanup: function () {...}
});
}
3 Answer Call
1 User Agent
2 Video Call
4 Video Call
sipHandle.createOffer({
media: {
audioSend: true, audioRecv: true,
videoSend: video, videoRecv: video
},
success: function (jsep) {
var body = {
request: 'call',
uri: 'sip:3401234567@nethesis.it'
};
sipcall.send({
'message': body,
'jsep': jsep
});
counterpartNum = to;
},
error: function (err) {...}
});
3 Answer Call
1 User Agent
2 Video Call
4 Video Call
sipHandle.createOffer({
media: {
audioSend: true, audioRecv: true,
videoSend: video, videoRecv: video
},
success: function (jsep) {
var body = {
request: 'call',
uri: 'sip:3401234567@nethesis.it'
};
sipcall.send({
'message': body,
'jsep': jsep
});
counterpartNum = to;
},
error: function (err) {...}
});
DEMO
alepolidori.github.com/janus-webrtc-phone
• SERVER

• CLIENT
NethServer VoIP PBX on DigitalOcean
links ON
bit.ly/cluecon-2019
TAKEAWAYS
SERVER PBX

NethVoice

NethServer PBX

CLIENT JS

SIP.js

sipML5

Janus-Gateway

DEMO

alepolidori.github.com/webrtc-phone
Alessandro Polidori
Sr. Software Engineer
@ale_polidori
ClueCon Weekly March 2019
bit.ly/ccweekly-alep
Thank you !
@ale_polidori
alessandro.polidori@nethesis.it
alessandropolidori

More Related Content

What's hot

Building scalable web socket backend
Building scalable web socket backendBuilding scalable web socket backend
Building scalable web socket backendConstantine Slisenka
 
Hackference 2014 - Node.js, the awesome parts
Hackference 2014 - Node.js, the awesome partsHackference 2014 - Node.js, the awesome parts
Hackference 2014 - Node.js, the awesome partsDan Jenkins
 
SIP & TLS - a very brief overview for the POSH BOF at IETF 87
SIP & TLS - a very brief overview for the POSH BOF at IETF 87SIP & TLS - a very brief overview for the POSH BOF at IETF 87
SIP & TLS - a very brief overview for the POSH BOF at IETF 87Olle E Johansson
 
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your networkLT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your networkIndonesia Network Operators Group
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsOlle E Johansson
 
WebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascriptWebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascriptMichele Di Salvatore
 
Open Canary - novahackers
Open Canary - novahackersOpen Canary - novahackers
Open Canary - novahackersChris Gates
 
The better PHP API (EN)
The better PHP API (EN)The better PHP API (EN)
The better PHP API (EN)boen_robot
 
4.4.1.2 packet tracer configure ip ac ls to mitigate attacks-instructor
4.4.1.2 packet tracer   configure ip ac ls to mitigate attacks-instructor4.4.1.2 packet tracer   configure ip ac ls to mitigate attacks-instructor
4.4.1.2 packet tracer configure ip ac ls to mitigate attacks-instructorSalem Trabelsi
 
4.1.1.10 packet tracer configuring extended ac ls scenario 1
4.1.1.10 packet tracer   configuring extended ac ls scenario 14.1.1.10 packet tracer   configuring extended ac ls scenario 1
4.1.1.10 packet tracer configuring extended ac ls scenario 1mps125
 
Elixir Berlin 2019: Dominic Letz on Doing Blockchain with Elixir
Elixir Berlin 2019: Dominic Letz on Doing Blockchain with ElixirElixir Berlin 2019: Dominic Letz on Doing Blockchain with Elixir
Elixir Berlin 2019: Dominic Letz on Doing Blockchain with Elixiryahsinhuangtw
 
Python+anaconda Development Environment
Python+anaconda Development EnvironmentPython+anaconda Development Environment
Python+anaconda Development EnvironmentKwangyoun Jung
 
Sip2016 - a talk at VOIP2DAY 2016
Sip2016 - a talk at VOIP2DAY 2016Sip2016 - a talk at VOIP2DAY 2016
Sip2016 - a talk at VOIP2DAY 2016Olle E Johansson
 
5.5.1.2 packet tracer configure ios intrusion prevention system (ips) using...
5.5.1.2 packet tracer   configure ios intrusion prevention system (ips) using...5.5.1.2 packet tracer   configure ios intrusion prevention system (ips) using...
5.5.1.2 packet tracer configure ios intrusion prevention system (ips) using...Salem Trabelsi
 

What's hot (20)

Building scalable web socket backend
Building scalable web socket backendBuilding scalable web socket backend
Building scalable web socket backend
 
No More Fraud, Astricon, Las Vegas 2014
No More Fraud, Astricon, Las Vegas 2014No More Fraud, Astricon, Las Vegas 2014
No More Fraud, Astricon, Las Vegas 2014
 
Number one-issue-voip-today-fraud
Number one-issue-voip-today-fraudNumber one-issue-voip-today-fraud
Number one-issue-voip-today-fraud
 
Hackference 2014 - Node.js, the awesome parts
Hackference 2014 - Node.js, the awesome partsHackference 2014 - Node.js, the awesome parts
Hackference 2014 - Node.js, the awesome parts
 
Twilio
TwilioTwilio
Twilio
 
SIP & TLS - a very brief overview for the POSH BOF at IETF 87
SIP & TLS - a very brief overview for the POSH BOF at IETF 87SIP & TLS - a very brief overview for the POSH BOF at IETF 87
SIP & TLS - a very brief overview for the POSH BOF at IETF 87
 
No More Fraud Cluecon2014
No More Fraud Cluecon2014No More Fraud Cluecon2014
No More Fraud Cluecon2014
 
SIMCON 3
SIMCON 3SIMCON 3
SIMCON 3
 
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your networkLT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installations
 
WebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascriptWebRTC + Socket.io: building a skype-like video chat with native javascript
WebRTC + Socket.io: building a skype-like video chat with native javascript
 
Open Canary - novahackers
Open Canary - novahackersOpen Canary - novahackers
Open Canary - novahackers
 
The better PHP API (EN)
The better PHP API (EN)The better PHP API (EN)
The better PHP API (EN)
 
4.4.1.2 packet tracer configure ip ac ls to mitigate attacks-instructor
4.4.1.2 packet tracer   configure ip ac ls to mitigate attacks-instructor4.4.1.2 packet tracer   configure ip ac ls to mitigate attacks-instructor
4.4.1.2 packet tracer configure ip ac ls to mitigate attacks-instructor
 
4.1.1.10 packet tracer configuring extended ac ls scenario 1
4.1.1.10 packet tracer   configuring extended ac ls scenario 14.1.1.10 packet tracer   configuring extended ac ls scenario 1
4.1.1.10 packet tracer configuring extended ac ls scenario 1
 
Asterisk Voip
Asterisk VoipAsterisk Voip
Asterisk Voip
 
Elixir Berlin 2019: Dominic Letz on Doing Blockchain with Elixir
Elixir Berlin 2019: Dominic Letz on Doing Blockchain with ElixirElixir Berlin 2019: Dominic Letz on Doing Blockchain with Elixir
Elixir Berlin 2019: Dominic Letz on Doing Blockchain with Elixir
 
Python+anaconda Development Environment
Python+anaconda Development EnvironmentPython+anaconda Development Environment
Python+anaconda Development Environment
 
Sip2016 - a talk at VOIP2DAY 2016
Sip2016 - a talk at VOIP2DAY 2016Sip2016 - a talk at VOIP2DAY 2016
Sip2016 - a talk at VOIP2DAY 2016
 
5.5.1.2 packet tracer configure ios intrusion prevention system (ips) using...
5.5.1.2 packet tracer   configure ios intrusion prevention system (ips) using...5.5.1.2 packet tracer   configure ios intrusion prevention system (ips) using...
5.5.1.2 packet tracer configure ios intrusion prevention system (ips) using...
 

Similar to Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸

soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)dantleech
 
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationWebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationDan Jenkins
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiJérémy Derussé
 
Going real time with Socket.io
Going real time with Socket.ioGoing real time with Socket.io
Going real time with Socket.ioArnout Kazemier
 
From Ruby to Node.js
From Ruby to Node.jsFrom Ruby to Node.js
From Ruby to Node.jsjubilem
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration SeminarYoss Cohen
 
Arduino and the real time web
Arduino and the real time webArduino and the real time web
Arduino and the real time webAndrew Fisher
 
Alexey Orlenko ''High-performance IPC and RPC for microservices and apps''
Alexey Orlenko ''High-performance IPC and RPC for microservices and apps''Alexey Orlenko ''High-performance IPC and RPC for microservices and apps''
Alexey Orlenko ''High-performance IPC and RPC for microservices and apps''OdessaJS Conf
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 
The Physical World meets the Web
The Physical World meets the WebThe Physical World meets the Web
The Physical World meets the WebMaximiliano Firtman
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT Meetup
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Sujee Maniyam
 
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...Amitesh Madhur
 
Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8guest441c58b71
 
Building fast,scalable game server in node.js
Building fast,scalable game server in node.jsBuilding fast,scalable game server in node.js
Building fast,scalable game server in node.jsXie ChengChao
 
Remote Notifications
Remote NotificationsRemote Notifications
Remote NotificationsJosef Cacek
 
Monitoring with Syslog and EventMachine (RailswayConf 2012)
Monitoring  with  Syslog and EventMachine (RailswayConf 2012)Monitoring  with  Syslog and EventMachine (RailswayConf 2012)
Monitoring with Syslog and EventMachine (RailswayConf 2012)Wooga
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés RianchoCODE BLUE
 
React Native EU 2021 - Creating a VoIP app in React Native - the beginner's g...
React Native EU 2021 - Creating a VoIP app in React Native - the beginner's g...React Native EU 2021 - Creating a VoIP app in React Native - the beginner's g...
React Native EU 2021 - Creating a VoIP app in React Native - the beginner's g...Wojciech Kwiatek
 

Similar to Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸 (20)

soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
 
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationWebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC application
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
 
Going real time with Socket.io
Going real time with Socket.ioGoing real time with Socket.io
Going real time with Socket.io
 
From Ruby to Node.js
From Ruby to Node.jsFrom Ruby to Node.js
From Ruby to Node.js
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
 
Arduino and the real time web
Arduino and the real time webArduino and the real time web
Arduino and the real time web
 
Alexey Orlenko ''High-performance IPC and RPC for microservices and apps''
Alexey Orlenko ''High-performance IPC and RPC for microservices and apps''Alexey Orlenko ''High-performance IPC and RPC for microservices and apps''
Alexey Orlenko ''High-performance IPC and RPC for microservices and apps''
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
The Physical World meets the Web
The Physical World meets the WebThe Physical World meets the Web
The Physical World meets the Web
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)
 
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
Web rtc, Media stream, Peer connection, Setting up STUN and TURN on Linux and...
 
Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8
 
Building fast,scalable game server in node.js
Building fast,scalable game server in node.jsBuilding fast,scalable game server in node.js
Building fast,scalable game server in node.js
 
Remote Notifications
Remote NotificationsRemote Notifications
Remote Notifications
 
Monitoring with Syslog and EventMachine (RailswayConf 2012)
Monitoring  with  Syslog and EventMachine (RailswayConf 2012)Monitoring  with  Syslog and EventMachine (RailswayConf 2012)
Monitoring with Syslog and EventMachine (RailswayConf 2012)
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
 
React Native EU 2021 - Creating a VoIP app in React Native - the beginner's g...
React Native EU 2021 - Creating a VoIP app in React Native - the beginner's g...React Native EU 2021 - Creating a VoIP app in React Native - the beginner's g...
React Native EU 2021 - Creating a VoIP app in React Native - the beginner's g...
 

Recently uploaded

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 

Recently uploaded (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 

Presentation at ClueCon 2019 - Chicago, IL, USA 🇺🇸

  • 1. WebRTC Cloud Phone with Asterisk, sipML5 & Janus Alessandro Polidori - @ale_polidori Chicago, IL, USA August 8th 2019
  • 4.
  • 6. knowledge base email live chat facebook messenger automatic bot
  • 7. We will call you within: LESS THAN 1 MINUTE !
  • 8.
  • 9. ???
  • 10. NEW INTERACTIONS Web - Video Calls - Smartphone GSM
  • 11.
  • 13. 1. Backend PBX 2. Frontend Web
  • 14. 1. Backend PBX 2. Frontend Web
  • 15. 1. Backend PBX 2. Frontend Web
  • 21. 1. Backend PBX { REST-API }WebSocket
  • 22. 1. Backend PBX { REST-API }WebSocket
  • 24.
  • 25. REAL-TIME COMMUNICATION To the WEB JAVASCRIPT Media Engine
  • 28. S I G N A L I N G SDP: media describe SIP over WebSocket Server needed
  • 29. N E T W O R K STUN TURN ICE
  • 30. WHY ? High costs VoIP deep knowledge Additional plugins
  • 31.
  • 32. Used by Google Hangouts - Discord Facebook Messenger Amazon Chime - TokBox Android iOS Web SDK
  • 33. webrtcindex.com • Video Conferencing • Telephony • Customer Service • Healthcare • Unified Communications • Gaming
  • 34. … and Browser Support ? caniuse.com
  • 35.
  • 42. SIP over WebSocket (signaling) Audio - Video - IM - Screen Sharing OnSIP platform backend JsSIP fork
  • 43. HTML <!doctype html> <html> <head></head> <body> <video autoplay id="video"></video> <script src="sip-client.js"></script> </body> </html>
  • 44. HTML <!doctype html> <html> <head></head> <body> <video autoplay id="video"></video> <script src="sip-client.js"></script> </body> </html>
  • 45. let configuration = { uri: '3000@nethesis.it', transportOptions: { wsServers: [ 'wss://nethesis.it:8089/ws' ] }, authorizationUser: '3000', password: '1234' }; let phone = new SIP.UA(configuration); phone.on('registered', e => {...}); phone.on('invite', e => {...}); phone.on('...', e => {...}); phone.start(); 1 User Agent 2 Video Call 3 Answer Call 4 Hangup
  • 46. let configuration = { uri: '3000@nethesis.it', transportOptions: { wsServers: [ 'wss://nethesis.it:8089/ws' ] }, authorizationUser: '3000', password: '1234' }; let phone = new SIP.UA(configuration); phone.on('registered', e => {...}); phone.on('invite', e => {...}); phone.on('...', e => {...}); phone.start(); 1 User Agent 2 Video Call 3 Answer Call 4 Hangup
  • 47. 3 Answer Call 4 Hangup 2 Video Call 1 User Agent let session = phone.invite('34012@nethesis.it'); session.on('progress', e => {...}); session.on('failed', e => {...}); session.on('trackAdded', () => { let pc = session.sessionDescriptionHandler .peerConnection; let remoteStream = new MediaStream(); pc.getReceivers().forEach(receiver => { remoteStream.addTrack(receiver.track); }); remoteStreamVideo.srcObject = remoteStream; remoteStreamVideo.play(); // and add local one });
  • 48. 3 Answer Call 4 Hangup 2 Video Call 1 User Agent let session = phone.invite('34012@nethesis.it'); session.on('progress', e => {...}); session.on('failed', e => {...}); session.on('trackAdded', () => { let pc = session.sessionDescriptionHandler .peerConnection; let remoteStream = new MediaStream(); pc.getReceivers().forEach(receiver => { remoteStream.addTrack(receiver.track); }); remoteStreamVideo.srcObject = remoteStream; remoteStreamVideo.play(); // and add local one });
  • 49. 2 Video Call 4 Hangup 1 User Agent 3 Answer Call phone.on('invite', session => { session.on('progress', e => {...}); session.on('failed', e => {...}); session.on('trackAdded', () => { let pc = session .sessionDescriptionHandler .peerConnection; let remoteStream = new MediaStream(); pc.getReceivers().forEach(receiver => { remoteStream.addTrack(receiver.track); }); remoteStreamVideo.srcObject = remoteStream; remoteStreamVideo.play(); // and add local one }); });
  • 50. 2 Video Call 4 Hangup 1 User Agent 3 Answer Call phone.on('invite', session => { session.on('progress', e => {...}); session.on('failed', e => {...}); session.on('trackAdded', () => { let pc = session .sessionDescriptionHandler .peerConnection; let remoteStream = new MediaStream(); pc.getReceivers().forEach(receiver => { remoteStream.addTrack(receiver.track); }); remoteStreamVideo.srcObject = remoteStream; remoteStreamVideo.play(); // and add local one }); });
  • 51. 3 Answer Call 1 User Agent 2 Video Call 4 Hangup let hangup = e => { rtcSession.terminate(); };
  • 53. sipML5 Google I/O 2012 Signals: SIP over WebSocket Audio - Video - IM - Screen Sharing Desktop & Mobile
  • 54. 1Initialization 2SIP Stack Creation 3Events Listener 4Extension registration 5Video call SIPml.init(successCb, errorCb); function engineReadyCb(e) { createSipStack(); } function engineErrorCb(e) { console.error(e.stack); }
  • 55. 3Events Listener 4Extension registration 5Video call 1Initialization 2SIP Stack Creation let sipStack = new SIPml.Stack({ realm: 'nethesis.it', impu: 'sip:3000@nethesis.it', password: '1234', display_name: 'ale_polidori', websocket_proxy_url: 'wss://nethesis.it:8089/ws', events_listener: { events: '*', listener: sipEventsListener } }); sipStack.start();
  • 56. 2SIP Stack Creation 4Extension registration 5Video call 1Initialization 3Events Listener function sipEventsListener (e) { if (e.type === 'i_new_call') { ringing.play(); e.newSession.setConfiguration({ video_local: document.getElementById(localId), video_remote: document.getElementById(remoteId), audio_remote: document.getElementById(audioId), events_listener: { events: '*', listener: callEventsListener } }); } }
  • 57. 2SIP Stack Creation 3Events Listener 5Video call 1Initialization 4Extension registration let registerSession = sipStack.newSession( 'register', { events_listener: { events: '*', listener: registerEventsListener } }); registerSession.register();
  • 58. 2SIP Stack Creation 3Events Listener 4Extension registration 1Initialization 5Video Call let callSession = sipStack.newSession( 'call-audiovideo', { video_local: document.getElementById(localId), video_remote: document.getElementById(remoteId), audio_remote: document.getElementById(audioId), events_listener: { events: '*', listener: callEventsListener } } ); callSession.call('00393401234567'); calling.play();
  • 60. Meetecho Company WebRTC Gateway Plugins: SIP, VideoConf, Screen Sharing, IM Transports: HTTP, WebSocket, RabbitMQ Monitoring
  • 61. 1 Initialization 2 Video Call 3 Answer Call 4 Hangup Janus.init({ debug: 'all', callback: function () { console.log('Janus initialized'); // session creation... } });
  • 62. 3 Answer Call 4 Hangup 2 Session creation 1 User Agent function createSession() { let janus = new Janus({ server: 'https://nethesis.it/janus', success: function () { // attach SIP plugin... }, error: function (err) { console.error(err.stack); }, destroyed: function () { console.log('janus destroyed !'); } }); }
  • 63. 3 Answer Call 4 Hangup 2 Session creation 1 User Agent function createSession() { let janus = new Janus({ server: 'https://nethesis.it/janus', success: function () { // attach SIP plugin... }, error: function (err) { console.error(err.stack); }, destroyed: function () { console.log('janus destroyed !'); } }); }
  • 64. 2 Video Call 4 Hangup 1 User Agent 3 Attach SIP Plugin function attachSipPlugin() { janus.attach({ plugin: 'janus.plugin.sip', success: function (sipHandle) {...}, error: function (err) {...}, onmessage: function (msg, jsep) { if (msg.result.event === 'incomingcall') { ringing.play(); } }, onlocalstream: function (stream) { Janus.attachMediaStream(localStreamVideo, stream); }, onremotestream: function (stream) { var videoTracks = stream.getVideoTracks(); Janus.attachMediaStream( remoteStreamVideo, new MediaStream(videoTracks) ); }, oncleanup: function () {...} }); }
  • 65. 2 Video Call 4 Hangup 1 User Agent 3 Attach SIP Plugin function attachSipPlugin() { janus.attach({ plugin: 'janus.plugin.sip', success: function (sipHandle) {...}, error: function (err) {...}, onmessage: function (msg, jsep) { if (msg.result.event === 'incomingcall') { ringing.play(); } }, onlocalstream: function (stream) { Janus.attachMediaStream(localStreamVideo, stream); }, onremotestream: function (stream) { var videoTracks = stream.getVideoTracks(); Janus.attachMediaStream( remoteStreamVideo, new MediaStream(videoTracks) ); }, oncleanup: function () {...} }); }
  • 66. 3 Answer Call 1 User Agent 2 Video Call 4 Video Call sipHandle.createOffer({ media: { audioSend: true, audioRecv: true, videoSend: video, videoRecv: video }, success: function (jsep) { var body = { request: 'call', uri: 'sip:3401234567@nethesis.it' }; sipcall.send({ 'message': body, 'jsep': jsep }); counterpartNum = to; }, error: function (err) {...} });
  • 67. 3 Answer Call 1 User Agent 2 Video Call 4 Video Call sipHandle.createOffer({ media: { audioSend: true, audioRecv: true, videoSend: video, videoRecv: video }, success: function (jsep) { var body = { request: 'call', uri: 'sip:3401234567@nethesis.it' }; sipcall.send({ 'message': body, 'jsep': jsep }); counterpartNum = to; }, error: function (err) {...} });
  • 70. TAKEAWAYS SERVER PBX NethVoice NethServer PBX CLIENT JS SIP.js sipML5 Janus-Gateway DEMO alepolidori.github.com/webrtc-phone
  • 71. Alessandro Polidori Sr. Software Engineer @ale_polidori
  • 72. ClueCon Weekly March 2019 bit.ly/ccweekly-alep