SlideShare a Scribd company logo
1 of 43
Download to read offline
Call transfer and multiple calls
in WebRTC with Janus
Lorenzo Miniero
@elminiero
OpenSIPS Summit
September 28th 2022,
Who am I?
Lorenzo Miniero
• Ph.D @ UniNA
• Chairman @ Meetecho
• Main author of Janus
Contacts and info
• lorenzo@meetecho.com
• https://twitter.com/elminiero
• https://www.slideshare.net/LorenzoMiniero
• https://lminiero.bandcamp.com
Just a few words on Meetecho
• Co-founded in 2009 as an academic spin-off
• University research efforts brought to the market
• Completely independent from the University
• Focus on real-time multimedia applications
• Strong perspective on standardization and open source
• Several activities
• Consulting services
• Commercial support and Janus licenses
• Streaming of live events (IETF, ACM, etc.)
• Proudly brewed in sunny Napoli(*), Italy
((*)
I’m legally obliged to show this)
Intro on the Janus SIP plugin features
https://www.youtube.com/watch?v=beHHL0Ew5xY
A quick reminder on what Janus is!
Janus
General purpose, open source WebRTC server
• https://github.com/meetecho/janus-gateway
• Demos and documentation: https://janus.conf.meetecho.com
• Community: https://groups.google.com/forum/#!forum/meetecho-janus
Extensible Architecture and API
Extensible Architecture and API
The SIP plugin in a nutshell
Works great with OpenSIPS!
An endpoint of behalf of WebRTC users
• Janus SIP plugin acts as a SIP endpoint, not a server/trunk!
• SIP stack implemented with Sofia-SIP
• WebRTC users only see the Janus API (JSON)
• No transcoding, media is only relayed
• Built-in recording (separate media legs)
• Simplifies life for web developers
• No need to worry about a SIP stack (only SIP URIs)
• Basic methods/events to handle calls (call, answer, hangup, message, etc.)
• Allows SIP headers injection in many requests
An endpoint of behalf of WebRTC users
• Janus SIP plugin acts as a SIP endpoint, not a server/trunk!
• SIP stack implemented with Sofia-SIP
• WebRTC users only see the Janus API (JSON)
• No transcoding, media is only relayed
• Built-in recording (separate media legs)
• Simplifies life for web developers
• No need to worry about a SIP stack (only SIP URIs)
• Basic methods/events to handle calls (call, answer, hangup, message, etc.)
• Allows SIP headers injection in many requests
What about call transfers?
• Since we first released Janus, this was asked for a few times
• e.g., https://github.com/meetecho/janus-gateway/issues/978
• Sofia SIP supports them, but additional work needed in Janus
• Support for generic SUBSCRIBE/NOTIFY
• Support for multiple calls at the same time
• Support for actual transfer signalling
• A Colombian company sponsored the development of them all!
• https://github.com/meetecho/janus-gateway/pull/1768 (merged)
• https://github.com/meetecho/janus-gateway/pull/1772 (merged)
• https://github.com/meetecho/janus-gateway/pull/1815 (merged)
What about call transfers?
• Since we first released Janus, this was asked for a few times
• e.g., https://github.com/meetecho/janus-gateway/issues/978
• Sofia SIP supports them, but additional work needed in Janus
• Support for generic SUBSCRIBE/NOTIFY
• Support for multiple calls at the same time
• Support for actual transfer signalling
• A Colombian company sponsored the development of them all!
• https://github.com/meetecho/janus-gateway/pull/1768 (merged)
• https://github.com/meetecho/janus-gateway/pull/1772 (merged)
• https://github.com/meetecho/janus-gateway/pull/1815 (merged)
What about call transfers?
• Since we first released Janus, this was asked for a few times
• e.g., https://github.com/meetecho/janus-gateway/issues/978
• Sofia SIP supports them, but additional work needed in Janus
• Support for generic SUBSCRIBE/NOTIFY
• Support for multiple calls at the same time
• Support for actual transfer signalling
• A Colombian company sponsored the development of them all!
• https://github.com/meetecho/janus-gateway/pull/1768 (merged)
• https://github.com/meetecho/janus-gateway/pull/1772 (merged)
• https://github.com/meetecho/janus-gateway/pull/1815 (merged)
1. Support for generic SUBSCRIBE/NOTIFY
• As discussed, a requirement for call transfers
• Transferor is notified about progress via NOTIFY (message/sipfrag)
• We started working on that first
• Feature entirely missing in Janus SIP plugin until then!
• Generic support opened door for other features (e.g., presence)
• Web application can send subscribe request and get notify events
• In case of call transfers, though, subscription done automatically
• Sofia SIP stack does that on its own when sending REFER
1. Support for generic SUBSCRIBE/NOTIFY
• As discussed, a requirement for call transfers
• Transferor is notified about progress via NOTIFY (message/sipfrag)
• We started working on that first
• Feature entirely missing in Janus SIP plugin until then!
• Generic support opened door for other features (e.g., presence)
• Web application can send subscribe request and get notify events
• In case of call transfers, though, subscription done automatically
• Sofia SIP stack does that on its own when sending REFER
1. Support for generic SUBSCRIBE/NOTIFY
• As discussed, a requirement for call transfers
• Transferor is notified about progress via NOTIFY (message/sipfrag)
• We started working on that first
• Feature entirely missing in Janus SIP plugin until then!
• Generic support opened door for other features (e.g., presence)
• Web application can send subscribe request and get notify events
• In case of call transfers, though, subscription done automatically
• Sofia SIP stack does that on its own when sending REFER
1. Support for generic SUBSCRIBE/NOTIFY
2. Support for multiple calls at the same time
• Another requirement for call transfers
• Endpoints may need to be in two calls at the same time, before completion
• Harder to implement due to how the SIP plugin worked
• In Janus, 1 handle = 1 PeerConnection (WebRTC media session)
• In SIP plugin, 1 handle = 1 SIP endpoint −→ max 1 SIP call at a time
• Other calls refused with a 486, in case user is in a call already
• Ended up implementing generic mechanism for “multiple lines”
• User registers SIP account only on “main” handle (new SIP stack)
• User can add more lines via “helper” handles (SIP stack shared with “main”)
• In case “main” is in a call, additional calls can be handled on “helpers”
2. Support for multiple calls at the same time
• Another requirement for call transfers
• Endpoints may need to be in two calls at the same time, before completion
• Harder to implement due to how the SIP plugin worked
• In Janus, 1 handle = 1 PeerConnection (WebRTC media session)
• In SIP plugin, 1 handle = 1 SIP endpoint −→ max 1 SIP call at a time
• Other calls refused with a 486, in case user is in a call already
• Ended up implementing generic mechanism for “multiple lines”
• User registers SIP account only on “main” handle (new SIP stack)
• User can add more lines via “helper” handles (SIP stack shared with “main”)
• In case “main” is in a call, additional calls can be handled on “helpers”
2. Support for multiple calls at the same time
• Another requirement for call transfers
• Endpoints may need to be in two calls at the same time, before completion
• Harder to implement due to how the SIP plugin worked
• In Janus, 1 handle = 1 PeerConnection (WebRTC media session)
• In SIP plugin, 1 handle = 1 SIP endpoint −→ max 1 SIP call at a time
• Other calls refused with a 486, in case user is in a call already
• Ended up implementing generic mechanism for “multiple lines”
• User registers SIP account only on “main” handle (new SIP stack)
• User can add more lines via “helper” handles (SIP stack shared with “main”)
• In case “main” is in a call, additional calls can be handled on “helpers”
2. Support for multiple calls at the same time
2. Support for multiple calls at the same time
3. Support for actual transfer signalling
• Final step in development
• Based on new changes to support subscriptions and multiple lines
• Implemented as an orchestration of required interactions
• Tried to simplify the process on the web side (still no SIP there)
• New transfer request for both blind and attended transfers
• Mostly differ on whether we ask to replace a call or not
• For blind transfers, no Call-ID is provided
• For attended transfers, it is (and transferee is notified)
• Janus SIP plugin code tries to handle the differences automatically
3. Support for actual transfer signalling
• Final step in development
• Based on new changes to support subscriptions and multiple lines
• Implemented as an orchestration of required interactions
• Tried to simplify the process on the web side (still no SIP there)
• New transfer request for both blind and attended transfers
• Mostly differ on whether we ask to replace a call or not
• For blind transfers, no Call-ID is provided
• For attended transfers, it is (and transferee is notified)
• Janus SIP plugin code tries to handle the differences automatically
3. Support for actual transfer signalling
• Final step in development
• Based on new changes to support subscriptions and multiple lines
• Implemented as an orchestration of required interactions
• Tried to simplify the process on the web side (still no SIP there)
• New transfer request for both blind and attended transfers
• Mostly differ on whether we ask to replace a call or not
• For blind transfers, no Call-ID is provided
• For attended transfers, it is (and transferee is notified)
• Janus SIP plugin code tries to handle the differences automatically
3. Support for actual transfer signalling
Demoed this in an OpenSIPS workshop
Alice in a call with Bob...
Alice decides to transfer the call...
Alice refers Bob to Carol
Bob is notified about the transfer...
Carol receives the transfered call
A quick look under the hood (Janus API)
Alice Bob Carol
Session ID 2882853027068154 5709081044242221 8512736684868091
Main handle 704123326479426 7513373295190055 2834358747375312
Helper handle 7228699494761220 6823091173814012 4398393772247705
Table: Map of sessions and handles in the transfer examples
A quick look under the hood (Janus API)
{
"janus": "message",
"session_id": 2882853027068154,
"handle_id": 704123326479426,
"transaction": "EocmzzHbvyok",
"body": {
"request": "transfer",
"uri": "sip:carol@192.168.1.110"
}
}
A quick look under the hood (Janus API)
{
"janus": "event",
"session_id": 2882853027068154,
"transaction": "EocmzzHbvyok",
"sender": 704123326479426,
"opaque_id": "siptest-7LqZsog4X0MG",
"plugindata": {
"plugin": "janus.plugin.sip",
"data": {
"sip": "event",
"result": {
"event": "transferring"
},
"call_id": "YOO9sE77w3RqNFTPK18C6sN"
}
}
}
A quick look under the hood (Janus API)
{
"janus": "event",
"session_id": 5709081044242221,
"sender": 7513373295190055,
"opaque_id": "siptest-XHWhFZWbcjjG",
"plugindata": {
"plugin": "janus.plugin.sip",
"data": {
"sip": "event",
"result": {
"event": "transfer",
"refer_id": 991347953, <--- IMPORTANT!
"refer_to": "sip:carol@192.168.1.110",
"referred_by": "<sip:alice@192.168.1.110:36091>"
}
}
}
}
A quick look under the hood (Janus API)
{
"janus": "message",
"session_id": 5709081044242221,
"handle_id": 6823091173814012,
"transaction": "J1ndk8jz1yuE",
"body": {
"request": "call",
"uri": "sip:carol@192.168.1.110",
"refer_id": 991347953
},
"jsep":{
// WebRTC SDP stuff
}
}
A quick look under the hood (Janus API)
{
"janus": "event",
"session_id": 8512736684868091,
"sender": 4398393772247705,
"opaque_id": "siptest-748ihwAPS7Lw",
"plugindata": {
"plugin": "janus.plugin.sip",
"data": {
"sip": "event",
"call_id": "LgvQ1kV2MHluoXlJBe9MQs3",
"result": {
"event": "incomingcall",
"username": "sip:bob@192.168.1.110",
"callee": "sip:carol@192.168.1.110",
NOTICE ----> "referred_by": "<sip:alice@192.168.1.110:36091>"
}
}
},
A quick look under the hood (Janus API)
{
"janus": "event",
"session_id": 2882853027068154,
"transaction": "d7LoWBpinfTP",
"sender": 704123326479426,
"opaque_id": "siptest-7LqZsog4X0MG",
"plugindata": {
"plugin": "janus.plugin.sip",
"data": {
"sip": "event",
"result": {
"event": "notify",
"notify": "refer",
"substate": "active",
"content-type": "message/sipfrag",
"content": "SIP/2.0 180 Ringing"
}
}
A quick look under the hood (Janus API)
{
"janus": "event",
"session_id": 2882853027068154,
"transaction": "d7LoWBpinfTP",
"sender": 704123326479426,
"opaque_id": "siptest-7LqZsog4X0MG",
"plugindata": {
"plugin": "janus.plugin.sip",
"data": {
"sip": "event",
"result": {
"event": "notify",
"notify": "refer",
"substate": "active",
"content-type": "message/sipfrag",
"content": "SIP/2.0 200 OK"
}
}
Thanks! Questions? Comments?
Get in touch!
• https://twitter.com/elminiero
• https://twitter.com/meetecho
• http://www.meetecho.com

More Related Content

What's hot

What's hot (20)

Real-Time Text and WebRTC @ Kamailio World 2023
Real-Time Text and WebRTC @ Kamailio World 2023Real-Time Text and WebRTC @ Kamailio World 2023
Real-Time Text and WebRTC @ Kamailio World 2023
 
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONEDScaling WebRTC deployments with multicast @ IETF 110 MBONED
Scaling WebRTC deployments with multicast @ IETF 110 MBONED
 
FreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8sFreeSWITCH Cluster by K8s
FreeSWITCH Cluster by K8s
 
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on KamailioAstricon 10 (October 2013) - SIP over WebSocket on Kamailio
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
 
Scaling server side web rtc applications the janus challenge by lorenzo miniero
Scaling server side web rtc applications the janus challenge by lorenzo minieroScaling server side web rtc applications the janus challenge by lorenzo miniero
Scaling server side web rtc applications the janus challenge by lorenzo miniero
 
Monorepo at Pinterest
Monorepo at PinterestMonorepo at Pinterest
Monorepo at Pinterest
 
Multistream in Janus @ CommCon 2019
Multistream in Janus @ CommCon 2019Multistream in Janus @ CommCon 2019
Multistream in Janus @ CommCon 2019
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 
Using eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumUsing eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in Cilium
 
Introduction to FreeSWITCH
Introduction to FreeSWITCHIntroduction to FreeSWITCH
Introduction to FreeSWITCH
 
Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019
 
SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)
 
Master the Monorepo
Master the MonorepoMaster the Monorepo
Master the Monorepo
 
Kamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouKamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and You
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
 
Can SFUs and MCUs be friends @ IIT-RTC 2020
Can SFUs and MCUs be friends @ IIT-RTC 2020Can SFUs and MCUs be friends @ IIT-RTC 2020
Can SFUs and MCUs be friends @ IIT-RTC 2020
 
Sipwise rtpengine
Sipwise rtpengineSipwise rtpengine
Sipwise rtpengine
 
Distributed tracing 101
Distributed tracing 101Distributed tracing 101
Distributed tracing 101
 
Helm at reddit: from local dev, staging, to production
Helm at reddit: from local dev, staging, to productionHelm at reddit: from local dev, staging, to production
Helm at reddit: from local dev, staging, to production
 
Janus & docker: friends or foe
Janus & docker: friends or foe Janus & docker: friends or foe
Janus & docker: friends or foe
 

Similar to SIP transfer with Janus/WebRTC @ OpenSIPS 2022

Web Planning an Effective Integration with a 3rd party API to Scale
Web Planning an Effective Integration with a 3rd party API to ScaleWeb Planning an Effective Integration with a 3rd party API to Scale
Web Planning an Effective Integration with a 3rd party API to Scale
brettwise
 

Similar to SIP transfer with Janus/WebRTC @ OpenSIPS 2022 (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Janus/SIP @ OpenSIPS 2017
Janus/SIP @ OpenSIPS 2017Janus/SIP @ OpenSIPS 2017
Janus/SIP @ OpenSIPS 2017
 
Janus @ ClueCon 2019
Janus @ ClueCon 2019Janus @ ClueCon 2019
Janus @ ClueCon 2019
 
Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021
 
The challenges of hybrid meetings @ CommCon 2023
The challenges of hybrid meetings @ CommCon 2023The challenges of hybrid meetings @ CommCon 2023
The challenges of hybrid meetings @ CommCon 2023
 
Janus @ RTC2017 Beijing
Janus @ RTC2017 BeijingJanus @ RTC2017 Beijing
Janus @ RTC2017 Beijing
 
SIP/WebRTC load testing @ KamailioWorld 2017
SIP/WebRTC load testing @ KamailioWorld 2017SIP/WebRTC load testing @ KamailioWorld 2017
SIP/WebRTC load testing @ KamailioWorld 2017
 
WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023WebRTC Broadcasting @ TADSummit 2023
WebRTC Broadcasting @ TADSummit 2023
 
WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017WebRTC Rockstars Asian Tour 2017
WebRTC Rockstars Asian Tour 2017
 
Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019
 
Janus/HOMER/HEPIC @ OpenSIPS18
Janus/HOMER/HEPIC @ OpenSIPS18Janus/HOMER/HEPIC @ OpenSIPS18
Janus/HOMER/HEPIC @ OpenSIPS18
 
Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017Janus/Asterisk @ Astricon 2017
Janus/Asterisk @ Astricon 2017
 
Janus + Audio @ Open Source World
Janus + Audio @ Open Source WorldJanus + Audio @ Open Source World
Janus + Audio @ Open Source World
 
WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021WHIP and Janus @ IIT-RTC 2021
WHIP and Janus @ IIT-RTC 2021
 
Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21
 
Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019Fuzzing RTC @ Kamailio World 2019
Fuzzing RTC @ Kamailio World 2019
 
Unicon Nov 2014 IAM Briefing
Unicon Nov 2014 IAM BriefingUnicon Nov 2014 IAM Briefing
Unicon Nov 2014 IAM Briefing
 
Web Planning an Effective Integration with a 3rd party API to Scale
Web Planning an Effective Integration with a 3rd party API to ScaleWeb Planning an Effective Integration with a 3rd party API to Scale
Web Planning an Effective Integration with a 3rd party API to Scale
 

More from Lorenzo Miniero

More from Lorenzo Miniero (12)

Getting AV1/SVC to work in the Janus WebRTC Server
Getting AV1/SVC to work in the Janus WebRTC ServerGetting AV1/SVC to work in the Janus WebRTC Server
Getting AV1/SVC to work in the Janus WebRTC Server
 
BWE in Janus
BWE in JanusBWE in Janus
BWE in Janus
 
Become a rockstar using FOSS!
Become a rockstar using FOSS!Become a rockstar using FOSS!
Become a rockstar using FOSS!
 
JamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConferenceJamRTC @ Wonder WebRTC unConference
JamRTC @ Wonder WebRTC unConference
 
Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021
 
Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021Janus + NDI @ ClueCon 2021
Janus + NDI @ ClueCon 2021
 
Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021
 
Virtual IETF meetings with WebRTC @ IETF 109 MOPS
Virtual IETF meetings with WebRTC @ IETF 109 MOPSVirtual IETF meetings with WebRTC @ IETF 109 MOPS
Virtual IETF meetings with WebRTC @ IETF 109 MOPS
 
Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020
 
Turning live events to virtual with Janus
Turning live events to virtual with JanusTurning live events to virtual with Janus
Turning live events to virtual with Janus
 
Janus workshop @ RTC2019 Beijing
Janus workshop @ RTC2019 BeijingJanus workshop @ RTC2019 Beijing
Janus workshop @ RTC2019 Beijing
 
Welcome to JanusCon! -- Past, Present and Future of Janus
Welcome to JanusCon! -- Past, Present and Future of JanusWelcome to JanusCon! -- Past, Present and Future of Janus
Welcome to JanusCon! -- Past, Present and Future of Janus
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

SIP transfer with Janus/WebRTC @ OpenSIPS 2022

  • 1. Call transfer and multiple calls in WebRTC with Janus Lorenzo Miniero @elminiero OpenSIPS Summit September 28th 2022,
  • 2. Who am I? Lorenzo Miniero • Ph.D @ UniNA • Chairman @ Meetecho • Main author of Janus Contacts and info • lorenzo@meetecho.com • https://twitter.com/elminiero • https://www.slideshare.net/LorenzoMiniero • https://lminiero.bandcamp.com
  • 3. Just a few words on Meetecho • Co-founded in 2009 as an academic spin-off • University research efforts brought to the market • Completely independent from the University • Focus on real-time multimedia applications • Strong perspective on standardization and open source • Several activities • Consulting services • Commercial support and Janus licenses • Streaming of live events (IETF, ACM, etc.) • Proudly brewed in sunny Napoli(*), Italy
  • 5. Intro on the Janus SIP plugin features https://www.youtube.com/watch?v=beHHL0Ew5xY
  • 6. A quick reminder on what Janus is! Janus General purpose, open source WebRTC server • https://github.com/meetecho/janus-gateway • Demos and documentation: https://janus.conf.meetecho.com • Community: https://groups.google.com/forum/#!forum/meetecho-janus
  • 9. The SIP plugin in a nutshell
  • 10. Works great with OpenSIPS!
  • 11. An endpoint of behalf of WebRTC users • Janus SIP plugin acts as a SIP endpoint, not a server/trunk! • SIP stack implemented with Sofia-SIP • WebRTC users only see the Janus API (JSON) • No transcoding, media is only relayed • Built-in recording (separate media legs) • Simplifies life for web developers • No need to worry about a SIP stack (only SIP URIs) • Basic methods/events to handle calls (call, answer, hangup, message, etc.) • Allows SIP headers injection in many requests
  • 12. An endpoint of behalf of WebRTC users • Janus SIP plugin acts as a SIP endpoint, not a server/trunk! • SIP stack implemented with Sofia-SIP • WebRTC users only see the Janus API (JSON) • No transcoding, media is only relayed • Built-in recording (separate media legs) • Simplifies life for web developers • No need to worry about a SIP stack (only SIP URIs) • Basic methods/events to handle calls (call, answer, hangup, message, etc.) • Allows SIP headers injection in many requests
  • 13. What about call transfers? • Since we first released Janus, this was asked for a few times • e.g., https://github.com/meetecho/janus-gateway/issues/978 • Sofia SIP supports them, but additional work needed in Janus • Support for generic SUBSCRIBE/NOTIFY • Support for multiple calls at the same time • Support for actual transfer signalling • A Colombian company sponsored the development of them all! • https://github.com/meetecho/janus-gateway/pull/1768 (merged) • https://github.com/meetecho/janus-gateway/pull/1772 (merged) • https://github.com/meetecho/janus-gateway/pull/1815 (merged)
  • 14. What about call transfers? • Since we first released Janus, this was asked for a few times • e.g., https://github.com/meetecho/janus-gateway/issues/978 • Sofia SIP supports them, but additional work needed in Janus • Support for generic SUBSCRIBE/NOTIFY • Support for multiple calls at the same time • Support for actual transfer signalling • A Colombian company sponsored the development of them all! • https://github.com/meetecho/janus-gateway/pull/1768 (merged) • https://github.com/meetecho/janus-gateway/pull/1772 (merged) • https://github.com/meetecho/janus-gateway/pull/1815 (merged)
  • 15. What about call transfers? • Since we first released Janus, this was asked for a few times • e.g., https://github.com/meetecho/janus-gateway/issues/978 • Sofia SIP supports them, but additional work needed in Janus • Support for generic SUBSCRIBE/NOTIFY • Support for multiple calls at the same time • Support for actual transfer signalling • A Colombian company sponsored the development of them all! • https://github.com/meetecho/janus-gateway/pull/1768 (merged) • https://github.com/meetecho/janus-gateway/pull/1772 (merged) • https://github.com/meetecho/janus-gateway/pull/1815 (merged)
  • 16. 1. Support for generic SUBSCRIBE/NOTIFY • As discussed, a requirement for call transfers • Transferor is notified about progress via NOTIFY (message/sipfrag) • We started working on that first • Feature entirely missing in Janus SIP plugin until then! • Generic support opened door for other features (e.g., presence) • Web application can send subscribe request and get notify events • In case of call transfers, though, subscription done automatically • Sofia SIP stack does that on its own when sending REFER
  • 17. 1. Support for generic SUBSCRIBE/NOTIFY • As discussed, a requirement for call transfers • Transferor is notified about progress via NOTIFY (message/sipfrag) • We started working on that first • Feature entirely missing in Janus SIP plugin until then! • Generic support opened door for other features (e.g., presence) • Web application can send subscribe request and get notify events • In case of call transfers, though, subscription done automatically • Sofia SIP stack does that on its own when sending REFER
  • 18. 1. Support for generic SUBSCRIBE/NOTIFY • As discussed, a requirement for call transfers • Transferor is notified about progress via NOTIFY (message/sipfrag) • We started working on that first • Feature entirely missing in Janus SIP plugin until then! • Generic support opened door for other features (e.g., presence) • Web application can send subscribe request and get notify events • In case of call transfers, though, subscription done automatically • Sofia SIP stack does that on its own when sending REFER
  • 19. 1. Support for generic SUBSCRIBE/NOTIFY
  • 20. 2. Support for multiple calls at the same time • Another requirement for call transfers • Endpoints may need to be in two calls at the same time, before completion • Harder to implement due to how the SIP plugin worked • In Janus, 1 handle = 1 PeerConnection (WebRTC media session) • In SIP plugin, 1 handle = 1 SIP endpoint −→ max 1 SIP call at a time • Other calls refused with a 486, in case user is in a call already • Ended up implementing generic mechanism for “multiple lines” • User registers SIP account only on “main” handle (new SIP stack) • User can add more lines via “helper” handles (SIP stack shared with “main”) • In case “main” is in a call, additional calls can be handled on “helpers”
  • 21. 2. Support for multiple calls at the same time • Another requirement for call transfers • Endpoints may need to be in two calls at the same time, before completion • Harder to implement due to how the SIP plugin worked • In Janus, 1 handle = 1 PeerConnection (WebRTC media session) • In SIP plugin, 1 handle = 1 SIP endpoint −→ max 1 SIP call at a time • Other calls refused with a 486, in case user is in a call already • Ended up implementing generic mechanism for “multiple lines” • User registers SIP account only on “main” handle (new SIP stack) • User can add more lines via “helper” handles (SIP stack shared with “main”) • In case “main” is in a call, additional calls can be handled on “helpers”
  • 22. 2. Support for multiple calls at the same time • Another requirement for call transfers • Endpoints may need to be in two calls at the same time, before completion • Harder to implement due to how the SIP plugin worked • In Janus, 1 handle = 1 PeerConnection (WebRTC media session) • In SIP plugin, 1 handle = 1 SIP endpoint −→ max 1 SIP call at a time • Other calls refused with a 486, in case user is in a call already • Ended up implementing generic mechanism for “multiple lines” • User registers SIP account only on “main” handle (new SIP stack) • User can add more lines via “helper” handles (SIP stack shared with “main”) • In case “main” is in a call, additional calls can be handled on “helpers”
  • 23. 2. Support for multiple calls at the same time
  • 24. 2. Support for multiple calls at the same time
  • 25. 3. Support for actual transfer signalling • Final step in development • Based on new changes to support subscriptions and multiple lines • Implemented as an orchestration of required interactions • Tried to simplify the process on the web side (still no SIP there) • New transfer request for both blind and attended transfers • Mostly differ on whether we ask to replace a call or not • For blind transfers, no Call-ID is provided • For attended transfers, it is (and transferee is notified) • Janus SIP plugin code tries to handle the differences automatically
  • 26. 3. Support for actual transfer signalling • Final step in development • Based on new changes to support subscriptions and multiple lines • Implemented as an orchestration of required interactions • Tried to simplify the process on the web side (still no SIP there) • New transfer request for both blind and attended transfers • Mostly differ on whether we ask to replace a call or not • For blind transfers, no Call-ID is provided • For attended transfers, it is (and transferee is notified) • Janus SIP plugin code tries to handle the differences automatically
  • 27. 3. Support for actual transfer signalling • Final step in development • Based on new changes to support subscriptions and multiple lines • Implemented as an orchestration of required interactions • Tried to simplify the process on the web side (still no SIP there) • New transfer request for both blind and attended transfers • Mostly differ on whether we ask to replace a call or not • For blind transfers, no Call-ID is provided • For attended transfers, it is (and transferee is notified) • Janus SIP plugin code tries to handle the differences automatically
  • 28. 3. Support for actual transfer signalling
  • 29. Demoed this in an OpenSIPS workshop
  • 30. Alice in a call with Bob...
  • 31. Alice decides to transfer the call...
  • 32. Alice refers Bob to Carol
  • 33. Bob is notified about the transfer...
  • 34. Carol receives the transfered call
  • 35. A quick look under the hood (Janus API) Alice Bob Carol Session ID 2882853027068154 5709081044242221 8512736684868091 Main handle 704123326479426 7513373295190055 2834358747375312 Helper handle 7228699494761220 6823091173814012 4398393772247705 Table: Map of sessions and handles in the transfer examples
  • 36. A quick look under the hood (Janus API) { "janus": "message", "session_id": 2882853027068154, "handle_id": 704123326479426, "transaction": "EocmzzHbvyok", "body": { "request": "transfer", "uri": "sip:carol@192.168.1.110" } }
  • 37. A quick look under the hood (Janus API) { "janus": "event", "session_id": 2882853027068154, "transaction": "EocmzzHbvyok", "sender": 704123326479426, "opaque_id": "siptest-7LqZsog4X0MG", "plugindata": { "plugin": "janus.plugin.sip", "data": { "sip": "event", "result": { "event": "transferring" }, "call_id": "YOO9sE77w3RqNFTPK18C6sN" } } }
  • 38. A quick look under the hood (Janus API) { "janus": "event", "session_id": 5709081044242221, "sender": 7513373295190055, "opaque_id": "siptest-XHWhFZWbcjjG", "plugindata": { "plugin": "janus.plugin.sip", "data": { "sip": "event", "result": { "event": "transfer", "refer_id": 991347953, <--- IMPORTANT! "refer_to": "sip:carol@192.168.1.110", "referred_by": "<sip:alice@192.168.1.110:36091>" } } } }
  • 39. A quick look under the hood (Janus API) { "janus": "message", "session_id": 5709081044242221, "handle_id": 6823091173814012, "transaction": "J1ndk8jz1yuE", "body": { "request": "call", "uri": "sip:carol@192.168.1.110", "refer_id": 991347953 }, "jsep":{ // WebRTC SDP stuff } }
  • 40. A quick look under the hood (Janus API) { "janus": "event", "session_id": 8512736684868091, "sender": 4398393772247705, "opaque_id": "siptest-748ihwAPS7Lw", "plugindata": { "plugin": "janus.plugin.sip", "data": { "sip": "event", "call_id": "LgvQ1kV2MHluoXlJBe9MQs3", "result": { "event": "incomingcall", "username": "sip:bob@192.168.1.110", "callee": "sip:carol@192.168.1.110", NOTICE ----> "referred_by": "<sip:alice@192.168.1.110:36091>" } } },
  • 41. A quick look under the hood (Janus API) { "janus": "event", "session_id": 2882853027068154, "transaction": "d7LoWBpinfTP", "sender": 704123326479426, "opaque_id": "siptest-7LqZsog4X0MG", "plugindata": { "plugin": "janus.plugin.sip", "data": { "sip": "event", "result": { "event": "notify", "notify": "refer", "substate": "active", "content-type": "message/sipfrag", "content": "SIP/2.0 180 Ringing" } }
  • 42. A quick look under the hood (Janus API) { "janus": "event", "session_id": 2882853027068154, "transaction": "d7LoWBpinfTP", "sender": 704123326479426, "opaque_id": "siptest-7LqZsog4X0MG", "plugindata": { "plugin": "janus.plugin.sip", "data": { "sip": "event", "result": { "event": "notify", "notify": "refer", "substate": "active", "content-type": "message/sipfrag", "content": "SIP/2.0 200 OK" } }
  • 43. Thanks! Questions? Comments? Get in touch! • https://twitter.com/elminiero • https://twitter.com/meetecho • http://www.meetecho.com