SlideShare a Scribd company logo
1 of 35
Download to read offline
Media Handling in
    FreeSWITCH
                     Moisés Silva
      Software Engineer / Manager
              moy@sangoma.com
Agenda
•    Audio Codecs
•    Transcoding
•    Codec Negotiation
•    Bypass Media
•    Proxy Media
•    Sangoma Transcoding




            © 2011 Sangoma Technologies   8/10/2011   2
Audio Codecs



© 2011 Sangoma Confidential         8/10/2011   3
Audio Codecs
•  Codecs encode and decode voice for network transmission
    –  Algorithm (compression technology)
    –  Bit rate
    –  Sampling rate
    –  Packetization
•  Algorithm is the core of the codec
•  Bit rate defines bandwidth required. (how many bits per
   second)
•  Sampling rate defines the quality. (all other things being
   equal)
•  Packetization affects latency and bandwidth overhead

              © 2011 Sangoma Technologies                  8/10/2011   4
Audio Codecs
•  G.711 (PCMU/PCMA, Ulaw/Alaw) – Narrowband.
    –  64kbps per second (Bit rate)
    –  8kHz (Sampling rate)
    –  10ms, 20ms, 30ms, 40ms … + (Packetization)
•  G.722 – Wideband
    –  48kbps, 56kbps and 64kbps
    –  16kHz (IANA clocks it at 8kHz due to historical error in
       RFC1890)
    –  10ms, 20ms, 30ms, 40ms … +
•  G.722.1 Annex C - Ultra-wideband
    –  48kbps
    –  32kHz
    –  20ms, 40ms, 60ms

               © 2011 Sangoma Technologies                        8/10/2011   5
FreeSWITCH Audio Codecs
•  FreeSWITCH supports a wide range of codecs
     –  Narrowband (G.711, G.726, G.723.1, G.729AB, Speex …)
     –  Wideband (G.722, G.722.1, G.722.2, Speex …)
     –  Ultra-wideband (G.722.1C, Speex)
     –  CD-quality (CELT)
•  FreeSWITCH core requires the media to be in L16 (signed
   linear, raw digital audio) format for manipulation (mixing, tone
   detection etc)
•  Codec modules encode and decode from/to L16 format
•  Pass-thru codec modules are dummies (mod_g729,
   mod_g723_1)


              © 2011 Sangoma Technologies                  8/10/2011   6
FreeSWITCH Audio Codecs




     © 2011 Sangoma Technologies   8/10/2011   7
Transcoding


© 2011 Sangoma Confidential          8/10/2011   8
Transcoding

•  Required when endpoints have no codec in common

•  FreeSWITCH must stay in the media path

•  Increases CPU usage (particularly if done in software)

•  Is a must if you need:
    –  Call recording
    –  Tone detection
    –  Play announcements or tones


            © 2011 Sangoma Technologies             8/10/2011   9
FreeSWITCH Transcoding
•  Transcoding in one-legged call




             © 2011 Sangoma Technologies   8/10/2011   10
FreeSWITCH Transcoding
•  Transcoding 2 SIP legs




             © 2011 Sangoma Technologies   8/10/2011   11
FreeSWITCH codec pass-thru
•  Pass-thru codecs do not do transcoding




             © 2011 Sangoma Technologies    8/10/2011   12
Codec Negotiation


© 2011 Sangoma Confidential                8/10/2011   13
Codec Negotiation

•  Decisions to be made to choose a codec for a call

•  From a list of codecs, pick one!

•  You can choose when this happens (early vs late)

•  Early happens before call hits the dial plan

•  Late will happen when the leg is answered (or in pre-
   answer)


            © 2011 Sangoma Technologies             8/10/2011   14
Codec Negotiation

•  3 inbound negotiation algorithms
    –  generous
    –  greedy
    –  Scrooge (Bah HUMBUG!)

•  Use inbound-codec-negotiation in SIP profile

•  Use sip_codec_negotiation variable in the dial plan




            © 2011 Sangoma Technologies           8/10/2011   15
Codec Negotiation




       © 2011 Sangoma Technologies   8/10/2011   16
Early Negotiation

•  Default negotiation mode in FreeSWITCH

•  The codec is chosen matching SDP vs inbound-codec-
   prefs in the SIP profile

•  “disable-transcoding” offers the same codec chosen for
   the inbound leg to the outbound leg

•  absolute_codec_str is a good brute-force approach




            © 2011 Sangoma Technologies            8/10/2011   17
Early Negotiation




        © 2011 Sangoma Technologies   8/10/2011   18
Late Negotiation

•  “Smarter” approach to codec negotiation

•  “inbound-late-negotiation” set to “true” in the SIP profile

•  Call will hit the dial plan without looking at codecs

•  Negotiation will occur when incoming leg is answered (or
   requires early media)




             © 2011 Sangoma Technologies                   8/10/2011   19
Late Negotiation

•  You can examine the incoming SDP and re-write SDP to
   fit your own needs

•  “inherit_codec” variable is available to try to use the
   codec from the B leg for the A leg

•  “ep_codec_string” contains the codecs offered by the
   endpoint




             © 2011 Sangoma Technologies               8/10/2011   20
Late Negotiation




        © 2011 Sangoma Technologies   8/10/2011   21
Media Modes


© 2011 Sangoma Confidential           8/10/2011   22
Bypass Media

•  Media goes around FreeSWITCH (not through) directly
   between the endpoints

•  SIP signaling stays in FreeSWITCH

•  Enable by setting variable “bypass_media=true” before
   bridging

•  Set inbound-no-media or inbound-bypass-media in the
   SIP profile for a permanent solution



            © 2011 Sangoma Technologies           8/10/2011   23
Bypass Media

•  You can still play files! (uuid_broadcast)

•  uuid_media [off] can re-invite FreeSWITCH on/off the
   media path

•  Recording will fail unless you manually put back
   FreeSWITCH on the media path




             © 2011 Sangoma Technologies              8/10/2011   24
Bypass Media




       © 2011 Sangoma Technologies   8/10/2011   25
Proxy Media

•  Also called “transparent proxy mode” for the RTP

•  No media capabilities enabled

•  Only the “c=” part in the SDP is modified

•  Allows FreeSWITCH to pass-thru codec media that does
   not support




            © 2011 Sangoma Technologies               8/10/2011   26
Proxy Media

•  Set “proxy_media=true” variable before the bridge to
   enable it

•  Set “inbound-proxy-media” in the SIP profile for a
   permanent solution

•  You most likely want to have “late negotiation” enabled




            © 2011 Sangoma Technologies                 8/10/2011   27
Proxy Media




       © 2011 Sangoma Technologies   8/10/2011   28
Sangoma Transcoding


© 2011 Sangoma Confidential                   8/10/2011   29
Sangoma Transcoding

•  Wider codec support in the industry

•  Seen as an ethernet interface by the operating system

•  SOAP interface for transcoding control

•  Multiple servers can use a single card

•  Firmware upgradable on the field

•  License upgradable (from 30 licenses to 400)

            © 2011 Sangoma Technologies            8/10/2011   30
Capacity

 Codec/P	
  Time	
     10	
  ms	
      20	
  ms	
      30	
  ms	
     40	
  ms	
     50	
  ms	
  
 G.729	
  AB	
         300	
           440	
           459	
          462	
          466	
  
 G.722	
               290	
           388	
           410	
          388	
  
 GSM	
                                 480	
  
 AMR	
  12.20	
                        200	
                          226	
  

 AMR	
  4.75	
                         258	
                          281	
  
 ILBC	
  15.2	
                        310	
                          298	
  
 ILBC	
  13.3	
                                        273	
  
 G.723	
  5.3	
                                        200	
  
 G.723	
  6.3	
                                        200	
  
 G.726	
  32	
         310	
           450	
           480	
          480	
          480	
  
 PCM/U	
               310	
           390	
           420	
          440	
          460	
  
 PCM/A	
               310	
           390	
           420	
          440	
          460	
  



                         © 2011 Sangoma Technologies                                           8/10/2011   31
Single Server Setup

                                             FreeSWITCH	
  
                                                                    I/O	
  core	
  


                                                                codec	
  module	
  

                                                                  SOAP	
  client	
  
                                                               (libsngtc-­‐node)	
  
                                                                                            Control	
  
                                                                                          (SOAP	
  TCP	
  	
  
                                                                                         connecTon)	
  
                                                                 SOAP	
  server	
  
                                 RTP	
  
                               (Voice)	
                              API	
  
                                                                                          Board	
  discovery	
  
                                                                  (libsng-­‐tc)	
          	
  at	
  Install	
  Tme	
  


                                                  Ethernet	
  Driver	
  




        © 2011 Sangoma Technologies                                                    8/10/2011                          32
Distributed Setup

                                                                                                   Transcoding	
  
 App	
                                                                                                Server	
  
Server	
        FreeSWITCH	
  
                                         I/O	
  core	
  

                                     codec	
  module	
  

                                        SOAP	
  client	
  
                                     (libsngtc-­‐node)	
  

                                                                       Control	
  
                         RTP	
                               (SOAP	
  TCP	
  connecTon)	
  
                       (Voice)	
  
                                                                                                           SOAP	
  server	
  

 App	
                                                                                                    API	
  (libsng-­‐tc)	
  
Server	
        FreeSWITCH	
  
                                         I/O	
  core	
                                        Ethernet	
  Driver	
  

                                     codec	
  module	
  

                                        SOAP	
  client	
  
                                     (libsngtc-­‐node)	
  
                         RTP	
  
                       (Voice)	
  


             © 2011 Sangoma Technologies                                                                   8/10/2011                 33
Supported Codecs

•    G.729
•    G.726-32
•    G.722
•    G.722.1
•    G.723.1
•    iLBC
•    AMR

     –  *more codecs supported by the D-series cards but not
        yet implemented by FreeSWITCH codec module


                © 2011 Sangoma Technologies         8/10/2011   34
THANK YOU


© 2011 Sangoma Confidential         8/10/2011   35

More Related Content

What's hot

Kamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouKamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouFred Posner
 
An SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environmentsAn SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environmentsGiacomo 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
 
Introduction to Kamailio (TADSummit 2020 Asia)
Introduction to Kamailio (TADSummit 2020 Asia)Introduction to Kamailio (TADSummit 2020 Asia)
Introduction to Kamailio (TADSummit 2020 Asia)Fred Posner
 
Top 5 Challenges To Add Web Calls to Truphone VoIP Platform
Top 5 Challenges To Add Web Calls to Truphone VoIP PlatformTop 5 Challenges To Add Web Calls to Truphone VoIP Platform
Top 5 Challenges To Add Web Calls to Truphone VoIP PlatformGiacomo Vacca
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and KamailioGiacomo Vacca
 
SIPREC RTPEngine Media Forking
SIPREC RTPEngine Media ForkingSIPREC RTPEngine Media Forking
SIPREC RTPEngine Media ForkingHossein Yavari
 
Getting started with SIP Express Media Server SIP app server and SBC - workshop
Getting started with SIP Express Media Server SIP app server and SBC - workshopGetting started with SIP Express Media Server SIP app server and SBC - workshop
Getting started with SIP Express Media Server SIP app server and SBC - workshopstefansayer
 
Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.Olle E Johansson
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker建澄 吳
 
Getting a live_transcript_of_your_call_using_the_ari
Getting a live_transcript_of_your_call_using_the_ariGetting a live_transcript_of_your_call_using_the_ari
Getting a live_transcript_of_your_call_using_the_ariPascal Cadotte-Michaud
 
FreeSWITCH Monitoring
FreeSWITCH MonitoringFreeSWITCH Monitoring
FreeSWITCH MonitoringMoises Silva
 
Embedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOSEmbedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOS艾鍗科技
 
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022Lorenzo Miniero
 
Expanding Asterisk with Kamailio
Expanding Asterisk with KamailioExpanding Asterisk with Kamailio
Expanding Asterisk with KamailioFred Posner
 
Session initiation protocol SIP
Session initiation protocol SIPSession initiation protocol SIP
Session initiation protocol SIPLaraib Khan
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceEvan McGee
 
Cilium - BPF & XDP for containers
 Cilium - BPF & XDP for containers Cilium - BPF & XDP for containers
Cilium - BPF & XDP for containersDocker, Inc.
 

What's hot (20)

Kamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouKamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and You
 
An SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environmentsAn SFU/MCU integration for heterogeneous environments
An SFU/MCU integration for heterogeneous environments
 
Kamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load BalancersKamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load Balancers
 
SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)SIP Attack Handling (Kamailio World 2021)
SIP Attack Handling (Kamailio World 2021)
 
Introduction to Kamailio (TADSummit 2020 Asia)
Introduction to Kamailio (TADSummit 2020 Asia)Introduction to Kamailio (TADSummit 2020 Asia)
Introduction to Kamailio (TADSummit 2020 Asia)
 
Top 5 Challenges To Add Web Calls to Truphone VoIP Platform
Top 5 Challenges To Add Web Calls to Truphone VoIP PlatformTop 5 Challenges To Add Web Calls to Truphone VoIP Platform
Top 5 Challenges To Add Web Calls to Truphone VoIP Platform
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and Kamailio
 
SIPREC RTPEngine Media Forking
SIPREC RTPEngine Media ForkingSIPREC RTPEngine Media Forking
SIPREC RTPEngine Media Forking
 
Getting started with SIP Express Media Server SIP app server and SBC - workshop
Getting started with SIP Express Media Server SIP app server and SBC - workshopGetting started with SIP Express Media Server SIP app server and SBC - workshop
Getting started with SIP Express Media Server SIP app server and SBC - workshop
 
Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.Why is Kamailio so different? An introduction.
Why is Kamailio so different? An introduction.
 
Sipwise rtpengine
Sipwise rtpengineSipwise rtpengine
Sipwise rtpengine
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
 
Getting a live_transcript_of_your_call_using_the_ari
Getting a live_transcript_of_your_call_using_the_ariGetting a live_transcript_of_your_call_using_the_ari
Getting a live_transcript_of_your_call_using_the_ari
 
FreeSWITCH Monitoring
FreeSWITCH MonitoringFreeSWITCH Monitoring
FreeSWITCH Monitoring
 
Embedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOSEmbedded TCP/IP stack for FreeRTOS
Embedded TCP/IP stack for FreeRTOS
 
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022SIP transfer with Janus/WebRTC @ OpenSIPS 2022
SIP transfer with Janus/WebRTC @ OpenSIPS 2022
 
Expanding Asterisk with Kamailio
Expanding Asterisk with KamailioExpanding Asterisk with Kamailio
Expanding Asterisk with Kamailio
 
Session initiation protocol SIP
Session initiation protocol SIPSession initiation protocol SIP
Session initiation protocol SIP
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
Cilium - BPF & XDP for containers
 Cilium - BPF & XDP for containers Cilium - BPF & XDP for containers
Cilium - BPF & XDP for containers
 

Viewers also liked

FreeSWITCH Modules for Asterisk Developers
FreeSWITCH Modules for Asterisk DevelopersFreeSWITCH Modules for Asterisk Developers
FreeSWITCH Modules for Asterisk DevelopersMoises Silva
 
Introduction to FreeSWITCH
Introduction to FreeSWITCHIntroduction to FreeSWITCH
Introduction to FreeSWITCHChien Cheng Wu
 
Architettura VoIP con FreeSWITCH + gazzurbo
Architettura VoIP con FreeSWITCH + gazzurboArchitettura VoIP con FreeSWITCH + gazzurbo
Architettura VoIP con FreeSWITCH + gazzurboAlessandro Antani
 
開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽Will Huang
 

Viewers also liked (6)

Freeswitch
FreeswitchFreeswitch
Freeswitch
 
FreeSWITCH Modules for Asterisk Developers
FreeSWITCH Modules for Asterisk DevelopersFreeSWITCH Modules for Asterisk Developers
FreeSWITCH Modules for Asterisk Developers
 
Voip FreeSwitch
Voip FreeSwitchVoip FreeSwitch
Voip FreeSwitch
 
Introduction to FreeSWITCH
Introduction to FreeSWITCHIntroduction to FreeSWITCH
Introduction to FreeSWITCH
 
Architettura VoIP con FreeSWITCH + gazzurbo
Architettura VoIP con FreeSWITCH + gazzurboArchitettura VoIP con FreeSWITCH + gazzurbo
Architettura VoIP con FreeSWITCH + gazzurbo
 
開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽
 

Similar to Media Handling in FreeSWITCH

WebRTC Standards from Tim Panton
WebRTC Standards from Tim PantonWebRTC Standards from Tim Panton
WebRTC Standards from Tim PantonAlan Quayle
 
WebRTC overview
WebRTC overviewWebRTC overview
WebRTC overviewRouyun Pan
 
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptxBridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptxAlberto González Trastoy
 
Track F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicsTrack F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicschiportal
 
Building a WebRTC Communication and collaboration platform - techleash barcamp
Building a WebRTC Communication and collaboration platform  -  techleash barcampBuilding a WebRTC Communication and collaboration platform  -  techleash barcamp
Building a WebRTC Communication and collaboration platform - techleash barcampALTANAI BISHT
 
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics WorkshopLagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics WorkshopLagopus SDN/OpenFlow switch
 
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitchDPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitchJim St. Leger
 
9.) audio video ethernet (avb cobra net dante)
9.) audio video ethernet (avb cobra net dante)9.) audio video ethernet (avb cobra net dante)
9.) audio video ethernet (avb cobra net dante)Jeff Green
 
WebRTC Real time media P2P, Server, Infrastructure, and Platform
WebRTC Real time media P2P, Server, Infrastructure, and PlatformWebRTC Real time media P2P, Server, Infrastructure, and Platform
WebRTC Real time media P2P, Server, Infrastructure, and PlatformRyan Jespersen
 
WebRTC, Whats in it for me?
WebRTC, Whats in it for me?WebRTC, Whats in it for me?
WebRTC, Whats in it for me?SeanDuBois3
 
Ryu SDN Framework
Ryu SDN FrameworkRyu SDN Framework
Ryu SDN FrameworkAPNIC
 
TADS Developer Summit WebRTC Dan Burnett
TADS Developer Summit WebRTC Dan BurnettTADS Developer Summit WebRTC Dan Burnett
TADS Developer Summit WebRTC Dan BurnettAlan Quayle
 
Monitoring whole mpeg transport stream
Monitoring whole mpeg transport streamMonitoring whole mpeg transport stream
Monitoring whole mpeg transport streamVolicon
 
Jawdat NGN IDNOG v1.0 public
Jawdat NGN IDNOG v1.0 publicJawdat NGN IDNOG v1.0 public
Jawdat NGN IDNOG v1.0 publicHimawan Nugroho
 
03 (IDNOG01) NGN Next Generation Networks by Himawan Nugroho
03 (IDNOG01) NGN Next Generation Networks by Himawan Nugroho03 (IDNOG01) NGN Next Generation Networks by Himawan Nugroho
03 (IDNOG01) NGN Next Generation Networks by Himawan NugrohoIndonesia Network Operators Group
 
JAWDAT NGN IDNOG v1.0 (public)[COPY]
JAWDAT NGN IDNOG v1.0 (public)[COPY]JAWDAT NGN IDNOG v1.0 (public)[COPY]
JAWDAT NGN IDNOG v1.0 (public)[COPY]Mahadiputra S
 

Similar to Media Handling in FreeSWITCH (20)

WebRTC Standards from Tim Panton
WebRTC Standards from Tim PantonWebRTC Standards from Tim Panton
WebRTC Standards from Tim Panton
 
WebRTC overview
WebRTC overviewWebRTC overview
WebRTC overview
 
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptxBridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
Bridging_WebRTC_with_SIP_Alberto_WebRTCventures_Cluecon2023_NoVideo.pptx
 
Track F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicsTrack F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonics
 
Building a WebRTC Communication and collaboration platform - techleash barcamp
Building a WebRTC Communication and collaboration platform  -  techleash barcampBuilding a WebRTC Communication and collaboration platform  -  techleash barcamp
Building a WebRTC Communication and collaboration platform - techleash barcamp
 
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics WorkshopLagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
 
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitchDPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
 
9.) audio video ethernet (avb cobra net dante)
9.) audio video ethernet (avb cobra net dante)9.) audio video ethernet (avb cobra net dante)
9.) audio video ethernet (avb cobra net dante)
 
WebRTC Real time media P2P, Server, Infrastructure, and Platform
WebRTC Real time media P2P, Server, Infrastructure, and PlatformWebRTC Real time media P2P, Server, Infrastructure, and Platform
WebRTC Real time media P2P, Server, Infrastructure, and Platform
 
WebRTC, Whats in it for me?
WebRTC, Whats in it for me?WebRTC, Whats in it for me?
WebRTC, Whats in it for me?
 
Mellanox Approach to NFV & SDN
Mellanox Approach to NFV & SDNMellanox Approach to NFV & SDN
Mellanox Approach to NFV & SDN
 
Ryu SDN Framework
Ryu SDN FrameworkRyu SDN Framework
Ryu SDN Framework
 
Thinking about IP migration
Thinking about IP migration Thinking about IP migration
Thinking about IP migration
 
TADS Developer Summit WebRTC Dan Burnett
TADS Developer Summit WebRTC Dan BurnettTADS Developer Summit WebRTC Dan Burnett
TADS Developer Summit WebRTC Dan Burnett
 
Monitoring whole mpeg transport stream
Monitoring whole mpeg transport streamMonitoring whole mpeg transport stream
Monitoring whole mpeg transport stream
 
Prashant Resume
Prashant ResumePrashant Resume
Prashant Resume
 
Jawdat NGN IDNOG v1.0 public
Jawdat NGN IDNOG v1.0 publicJawdat NGN IDNOG v1.0 public
Jawdat NGN IDNOG v1.0 public
 
03 (IDNOG01) NGN Next Generation Networks by Himawan Nugroho
03 (IDNOG01) NGN Next Generation Networks by Himawan Nugroho03 (IDNOG01) NGN Next Generation Networks by Himawan Nugroho
03 (IDNOG01) NGN Next Generation Networks by Himawan Nugroho
 
JAWDAT NGN IDNOG v1.0 (public)[COPY]
JAWDAT NGN IDNOG v1.0 (public)[COPY]JAWDAT NGN IDNOG v1.0 (public)[COPY]
JAWDAT NGN IDNOG v1.0 (public)[COPY]
 
R43019698
R43019698R43019698
R43019698
 

More from Moises Silva

Interfaces de Scripting para librerias en C
Interfaces de Scripting para librerias en CInterfaces de Scripting para librerias en C
Interfaces de Scripting para librerias en CMoises Silva
 
Vulnerabilidades en Aplicaciones Web PHP
Vulnerabilidades en Aplicaciones Web PHPVulnerabilidades en Aplicaciones Web PHP
Vulnerabilidades en Aplicaciones Web PHPMoises Silva
 
Manejo de Medios en FreeSWITCH
Manejo de Medios en FreeSWITCHManejo de Medios en FreeSWITCH
Manejo de Medios en FreeSWITCHMoises Silva
 
Implementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in AsteriskImplementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in AsteriskMoises Silva
 
FreeSWITCH: Asterisk con Esteroides
FreeSWITCH: Asterisk con EsteroidesFreeSWITCH: Asterisk con Esteroides
FreeSWITCH: Asterisk con EsteroidesMoises Silva
 
Negociacion de Codecs en Asterisk
Negociacion de Codecs en AsteriskNegociacion de Codecs en Asterisk
Negociacion de Codecs en AsteriskMoises Silva
 
Sangoma en el Ecosistema Open Source
Sangoma en el Ecosistema Open SourceSangoma en el Ecosistema Open Source
Sangoma en el Ecosistema Open SourceMoises Silva
 
FreeTDM PRI Passive Recording
FreeTDM PRI Passive RecordingFreeTDM PRI Passive Recording
FreeTDM PRI Passive RecordingMoises Silva
 
Asterisk PRI Passive Call Recording
Asterisk PRI Passive Call RecordingAsterisk PRI Passive Call Recording
Asterisk PRI Passive Call RecordingMoises Silva
 
OpenR2 in Asterisk
OpenR2 in AsteriskOpenR2 in Asterisk
OpenR2 in AsteriskMoises Silva
 

More from Moises Silva (10)

Interfaces de Scripting para librerias en C
Interfaces de Scripting para librerias en CInterfaces de Scripting para librerias en C
Interfaces de Scripting para librerias en C
 
Vulnerabilidades en Aplicaciones Web PHP
Vulnerabilidades en Aplicaciones Web PHPVulnerabilidades en Aplicaciones Web PHP
Vulnerabilidades en Aplicaciones Web PHP
 
Manejo de Medios en FreeSWITCH
Manejo de Medios en FreeSWITCHManejo de Medios en FreeSWITCH
Manejo de Medios en FreeSWITCH
 
Implementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in AsteriskImplementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in Asterisk
 
FreeSWITCH: Asterisk con Esteroides
FreeSWITCH: Asterisk con EsteroidesFreeSWITCH: Asterisk con Esteroides
FreeSWITCH: Asterisk con Esteroides
 
Negociacion de Codecs en Asterisk
Negociacion de Codecs en AsteriskNegociacion de Codecs en Asterisk
Negociacion de Codecs en Asterisk
 
Sangoma en el Ecosistema Open Source
Sangoma en el Ecosistema Open SourceSangoma en el Ecosistema Open Source
Sangoma en el Ecosistema Open Source
 
FreeTDM PRI Passive Recording
FreeTDM PRI Passive RecordingFreeTDM PRI Passive Recording
FreeTDM PRI Passive Recording
 
Asterisk PRI Passive Call Recording
Asterisk PRI Passive Call RecordingAsterisk PRI Passive Call Recording
Asterisk PRI Passive Call Recording
 
OpenR2 in Asterisk
OpenR2 in AsteriskOpenR2 in Asterisk
OpenR2 in Asterisk
 

Media Handling in FreeSWITCH

  • 1. Media Handling in FreeSWITCH Moisés Silva Software Engineer / Manager moy@sangoma.com
  • 2. Agenda •  Audio Codecs •  Transcoding •  Codec Negotiation •  Bypass Media •  Proxy Media •  Sangoma Transcoding © 2011 Sangoma Technologies 8/10/2011 2
  • 3. Audio Codecs © 2011 Sangoma Confidential 8/10/2011 3
  • 4. Audio Codecs •  Codecs encode and decode voice for network transmission –  Algorithm (compression technology) –  Bit rate –  Sampling rate –  Packetization •  Algorithm is the core of the codec •  Bit rate defines bandwidth required. (how many bits per second) •  Sampling rate defines the quality. (all other things being equal) •  Packetization affects latency and bandwidth overhead © 2011 Sangoma Technologies 8/10/2011 4
  • 5. Audio Codecs •  G.711 (PCMU/PCMA, Ulaw/Alaw) – Narrowband. –  64kbps per second (Bit rate) –  8kHz (Sampling rate) –  10ms, 20ms, 30ms, 40ms … + (Packetization) •  G.722 – Wideband –  48kbps, 56kbps and 64kbps –  16kHz (IANA clocks it at 8kHz due to historical error in RFC1890) –  10ms, 20ms, 30ms, 40ms … + •  G.722.1 Annex C - Ultra-wideband –  48kbps –  32kHz –  20ms, 40ms, 60ms © 2011 Sangoma Technologies 8/10/2011 5
  • 6. FreeSWITCH Audio Codecs •  FreeSWITCH supports a wide range of codecs –  Narrowband (G.711, G.726, G.723.1, G.729AB, Speex …) –  Wideband (G.722, G.722.1, G.722.2, Speex …) –  Ultra-wideband (G.722.1C, Speex) –  CD-quality (CELT) •  FreeSWITCH core requires the media to be in L16 (signed linear, raw digital audio) format for manipulation (mixing, tone detection etc) •  Codec modules encode and decode from/to L16 format •  Pass-thru codec modules are dummies (mod_g729, mod_g723_1) © 2011 Sangoma Technologies 8/10/2011 6
  • 7. FreeSWITCH Audio Codecs © 2011 Sangoma Technologies 8/10/2011 7
  • 8. Transcoding © 2011 Sangoma Confidential 8/10/2011 8
  • 9. Transcoding •  Required when endpoints have no codec in common •  FreeSWITCH must stay in the media path •  Increases CPU usage (particularly if done in software) •  Is a must if you need: –  Call recording –  Tone detection –  Play announcements or tones © 2011 Sangoma Technologies 8/10/2011 9
  • 10. FreeSWITCH Transcoding •  Transcoding in one-legged call © 2011 Sangoma Technologies 8/10/2011 10
  • 11. FreeSWITCH Transcoding •  Transcoding 2 SIP legs © 2011 Sangoma Technologies 8/10/2011 11
  • 12. FreeSWITCH codec pass-thru •  Pass-thru codecs do not do transcoding © 2011 Sangoma Technologies 8/10/2011 12
  • 13. Codec Negotiation © 2011 Sangoma Confidential 8/10/2011 13
  • 14. Codec Negotiation •  Decisions to be made to choose a codec for a call •  From a list of codecs, pick one! •  You can choose when this happens (early vs late) •  Early happens before call hits the dial plan •  Late will happen when the leg is answered (or in pre- answer) © 2011 Sangoma Technologies 8/10/2011 14
  • 15. Codec Negotiation •  3 inbound negotiation algorithms –  generous –  greedy –  Scrooge (Bah HUMBUG!) •  Use inbound-codec-negotiation in SIP profile •  Use sip_codec_negotiation variable in the dial plan © 2011 Sangoma Technologies 8/10/2011 15
  • 16. Codec Negotiation © 2011 Sangoma Technologies 8/10/2011 16
  • 17. Early Negotiation •  Default negotiation mode in FreeSWITCH •  The codec is chosen matching SDP vs inbound-codec- prefs in the SIP profile •  “disable-transcoding” offers the same codec chosen for the inbound leg to the outbound leg •  absolute_codec_str is a good brute-force approach © 2011 Sangoma Technologies 8/10/2011 17
  • 18. Early Negotiation © 2011 Sangoma Technologies 8/10/2011 18
  • 19. Late Negotiation •  “Smarter” approach to codec negotiation •  “inbound-late-negotiation” set to “true” in the SIP profile •  Call will hit the dial plan without looking at codecs •  Negotiation will occur when incoming leg is answered (or requires early media) © 2011 Sangoma Technologies 8/10/2011 19
  • 20. Late Negotiation •  You can examine the incoming SDP and re-write SDP to fit your own needs •  “inherit_codec” variable is available to try to use the codec from the B leg for the A leg •  “ep_codec_string” contains the codecs offered by the endpoint © 2011 Sangoma Technologies 8/10/2011 20
  • 21. Late Negotiation © 2011 Sangoma Technologies 8/10/2011 21
  • 22. Media Modes © 2011 Sangoma Confidential 8/10/2011 22
  • 23. Bypass Media •  Media goes around FreeSWITCH (not through) directly between the endpoints •  SIP signaling stays in FreeSWITCH •  Enable by setting variable “bypass_media=true” before bridging •  Set inbound-no-media or inbound-bypass-media in the SIP profile for a permanent solution © 2011 Sangoma Technologies 8/10/2011 23
  • 24. Bypass Media •  You can still play files! (uuid_broadcast) •  uuid_media [off] can re-invite FreeSWITCH on/off the media path •  Recording will fail unless you manually put back FreeSWITCH on the media path © 2011 Sangoma Technologies 8/10/2011 24
  • 25. Bypass Media © 2011 Sangoma Technologies 8/10/2011 25
  • 26. Proxy Media •  Also called “transparent proxy mode” for the RTP •  No media capabilities enabled •  Only the “c=” part in the SDP is modified •  Allows FreeSWITCH to pass-thru codec media that does not support © 2011 Sangoma Technologies 8/10/2011 26
  • 27. Proxy Media •  Set “proxy_media=true” variable before the bridge to enable it •  Set “inbound-proxy-media” in the SIP profile for a permanent solution •  You most likely want to have “late negotiation” enabled © 2011 Sangoma Technologies 8/10/2011 27
  • 28. Proxy Media © 2011 Sangoma Technologies 8/10/2011 28
  • 29. Sangoma Transcoding © 2011 Sangoma Confidential 8/10/2011 29
  • 30. Sangoma Transcoding •  Wider codec support in the industry •  Seen as an ethernet interface by the operating system •  SOAP interface for transcoding control •  Multiple servers can use a single card •  Firmware upgradable on the field •  License upgradable (from 30 licenses to 400) © 2011 Sangoma Technologies 8/10/2011 30
  • 31. Capacity Codec/P  Time   10  ms   20  ms   30  ms   40  ms   50  ms   G.729  AB   300   440   459   462   466   G.722   290   388   410   388   GSM   480   AMR  12.20   200   226   AMR  4.75   258   281   ILBC  15.2   310   298   ILBC  13.3   273   G.723  5.3   200   G.723  6.3   200   G.726  32   310   450   480   480   480   PCM/U   310   390   420   440   460   PCM/A   310   390   420   440   460   © 2011 Sangoma Technologies 8/10/2011 31
  • 32. Single Server Setup FreeSWITCH   I/O  core   codec  module   SOAP  client   (libsngtc-­‐node)   Control   (SOAP  TCP     connecTon)   SOAP  server   RTP   (Voice)   API   Board  discovery   (libsng-­‐tc)    at  Install  Tme   Ethernet  Driver   © 2011 Sangoma Technologies 8/10/2011 32
  • 33. Distributed Setup Transcoding   App   Server   Server   FreeSWITCH   I/O  core   codec  module   SOAP  client   (libsngtc-­‐node)   Control   RTP   (SOAP  TCP  connecTon)   (Voice)   SOAP  server   App   API  (libsng-­‐tc)   Server   FreeSWITCH   I/O  core   Ethernet  Driver   codec  module   SOAP  client   (libsngtc-­‐node)   RTP   (Voice)   © 2011 Sangoma Technologies 8/10/2011 33
  • 34. Supported Codecs •  G.729 •  G.726-32 •  G.722 •  G.722.1 •  G.723.1 •  iLBC •  AMR –  *more codecs supported by the D-series cards but not yet implemented by FreeSWITCH codec module © 2011 Sangoma Technologies 8/10/2011 34
  • 35. THANK YOU © 2011 Sangoma Confidential 8/10/2011 35