SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
GETTING A LIVE TRANSCRIPT
OF YOUR CALL
PASCAL CADOTTE MICHAUD | CORE DEVELOPER
ASTRICON, ATLANTA, OCT. 2019
WHO AM I?
OPEN SOURCE ENTHUSIAST
PASCAL CADOTTE MICHAUD, CORE DEVELOPER @ WAZO
10+ YEARS IN DEVELOPMENT
PROGRAMMING SOFTWARES USING ASTERISK FOR ALMOST 10 YEARS USING
● AMI
● DIALPLAN
● AGI
● ARI AND STASIS APPLICATIONS
@PCADOTTE @PC-M
WAZO PLATFORM
PROJECT MISSION
LEVERAGE THE BEST OPEN SOURCE COMPONENTS TO
TRANSFORM THE WAY WE BUILD IP TELECOM
INFRASTRUCTURE AND CREATE COMMUNICATION SERVICES
WHY WOULD YOU WANT TO STREAM THE AUDIO OUT OF ASTERISK
INTERESTING USES CASES
WHY WOULD I STREAM SOUNDS OUT OF ASTERISK?
● ADDING SUBTITLES TO A CALL
● TRANSLATIONS
● DETECTING CUSTOMER FEELING
● CALL PRIORITIZATION
● FRAUD DETECTION
● INDEXATION
● CALL ROUTING IVR
http://www.wazo-platform.org/blog/solving-the-emergency-call-prioritization-issue-with-programmable-telecom
TIMELINE
AUGUST 2018
AUDIO SOCKET
OCTOBER 2018
ASTRIDEVCON
JANUARY 2019
WAZO PARIS HACKATHON
RES_ARI_STREAM
JULY 2019
ASTRICON CFP
OCTOBER 2019
ASTERISK 16.6.0 WITH
EXTERNALMEDIA
OUR JOURNEY
AUDIO SOCKET
BY SEÁN C. MCCORD
“AUDIOSOCKET IS A SIMPLE TCP-BASED PROTOCOL FOR SENDING AND
RECEIVING REALTIME AUDIO STREAMS.
THERE EXISTS A PROTOCOL DEFINITION, A GO LIBRARY, AND AN ASTERISK
APPLICATION.”
VERY SIMPLE PROTOCOL USING AN ASTERISK DIALPLAN APPLICATION.
SEE SEÁN’S PRESENTATION TOMORROW AT 10:30 FOR MORE INTERESTING
DETAILS.
https://wiki.asterisk.org/wiki/display/AST/AudioSocket
A FIRST WORKING IMPLEMENTATION
RES_ARI_STREAM
RES_ARI_STREAM IS A MODULE
DEVELOPED AS A HACKATHON
PROJECT TO GET A GOOD FEEL OF THE
PROBLEM.
IT USES THE ARI WEBSOCKET WITH
THE SUB-PROTOCOL
“STREAM-CHANNEL”.
HOW DOES IT WORK
RES_ARI_STREAM
1. ON LOAD ADDS A SUB-PROTOCOL TO THE WEBSOCKET
2. ON SUBSCRIPTION A HOOK ON RECEIVED FRAMES IS
ADDED
3. ON VOICE FRAME THE VOICE IS TRANSCODED TO SLIN16
4. THEN THE FRAMES ARE WRITTEN TO THE SUBSCRIBED
WEBSOCKET
https://github.com/sboily/wazo-hackathon-asterisk-stream-module
A VERY BASIC EXAMPLE
WRITING THE AUDIO FRAMES TO A FILE
import websocket
import sys
with open("out.wav", "wb") as f:
ws = websocket.WebSocketApp(
"ws://localhost:5039/ws",
on_message=lambda ws, msg: out.write(msg),
on_error=lambda ws, error: print(error),
on_close=lambda ws: print(“### closed ###”),
subprotocols=["stream-channel"],
header=[“Channel-ID: “ + sys.argv[1]],
)
ws.run_forever()
A VERY SIMPLE EXAMPLE
USAGE
RECORDING THE AUDIO TO A FILE
LISTENING TO YOUR RECORDING
play -t raw -b 16 --endian little -c 1 -e signed-integer -r 16000 out.wav
python3 record-channel-id.py “<my-channel>”
ASTERISK IMPLEMENTATION IN ASTERISK 16.6.0
POST /channels/externalmedia
1. CREATE AN EXTERNAL MEDIA CHANNEL WITH AN HOST AND PORT
2. ASTERISK WILL SEND RTP TO THE HOST AND PORT
3. ADD THE EXTERNAL MEDIA CHANNEL TO THE BRIDGE YOU WISH TO LISTEN
4. READ THE RTP FROM THE SOCKET
THE UNICASTRTP_LOCAL_ADDRESS AND UNICASTRTP_LOCAL_PORT CHANNEL
VARIABLES CONTAIN WHAT YOU NEED TO SEND MEDIA BACK TO ASTERISK.
https://wiki.asterisk.org/wiki/display/AST/External+Media+and+ARI
https://github.com/asterisk/asterisk-external-media
DIFFERENCES BETWEEN THE 3 OPTIONS
RES_ARI_STREAM ARI EXTERNALMEDIA AUDIOSOCKET
MEDIA DIRECTION UNI-DIRECTIONAL BI-DIRECTIONAL BI-DIRECTIONAL
USAGE
HTTP ENDPOINT WITH A
SPECIFIC SUB-PROTOCOL FOR
THE WEBSOCKET
LIMITED TO CHANNELS IN
STASIS
DIALPLAN APPLICATION AND
CHANNEL DRIVER
ARI RESOURCE IN A GERRIT PULL
REQUEST
FORMAT SLIN16 IS RECEIVED
RTP WITH SPECIFIED CODEC
IS RECEIVED
VERY SIMPLE PROTOCOL WITH
SLIN16 PAYLOAD
CONNECTIVITY CONNECTS TO A CHANNEL CONNECTS TO A BRIDGE
CONNECTS TO A CHANNEL OR A
BRIDGE
TRANSPORT WEBSOCKET UDP TCP
RES_ARI_STREAM DEMO
DEMO OF THE RES_ARI_STREAM MODULE
https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/wazo.py
https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/transcription.py
INCOMING CALL
AN INCOMING CALL IS
ANSWERED BY ALICE
THIS IS A NORMAL CALL, NO
STASIS APPLICATION IS
REQUIRED HERE
TRANSCRIPT SCRIPT
TRANSCRIPTION SCRIPT IS
LAUNCHED ON THE
INCOMING CALL
THE SCRIPT CONNECTS TO THE
ASTERISK WEBSOCKET AND
REGISTERS ITSELF TO THE
INCOMING CALL CHANNEL ID
GOOGLE SPEECH API
TRANSCRIPTION
GOOGLE SPEECH API IS USED
FOR THE TRANSCRIPTION
USER
HTTP SERVER
THE TRANSLATED TEXT IS
SERVED TO THE USER
ARI EXTERNAL MEDIA DEMO
DEMO OF THE ASTERISK ARI VERSION
https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/ari_stasis.py
https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/ari_server.py
https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/transcription.py
STASIS
THE CALL ENTERS
STASIS
THE STASIS APPLICATION
ADDS THE CALL TO ITS
BRIDGE
UDP SERVER
THE SERVER RECEIVES
THE RTP FROM
ASTERISK
THE SERVER CREATES THE
EXTERNAL MEDIA CHANNELS
WHICH GET ADDED TO THE
STASIS BRIDGE AND RECEIVES
THE RTP
GOOGLE SPEECH API
TRANSCRIPTION
GOOGLE SPEECH API IS
USED FOR THE
TRANSCRIPTION
USER
HTTP SERVER
THE TRANSLATED TEXT IS
SERVED TO THE USER
WAZO PLATFORM: COLLABORATION
OPEN COLLABORATION & OPEN DEVELOPMENT
OPEN SOURCE PROJECT
https://www.wazo-platform.org/
PR WORKFLOW @ GITHUB
https://github.com/wazo-platform/
MATTERMOST CHAN
https://mm.wazo.community/wazo-platform/
SERVICE CODE UNDER GLPV3+ LICENCE
LIBRARY CODE UNDER MIT LICENCE
LET’S CONNECT
BUILD GREAT SOLUTIONS WITH WAZO PLATFORM
BOOTH WAZO W/ THE TEAM :
FRED, SYLVAIN, PASCAL & JÉROME
TO KNOW MORE :
- JEROME’S TALK : WEDNESDAY - 1:30PM
MORE INFO :
- BLOG POST
- OFFICIAL DEMO @GITHUB
QUESTIONS

Contenu connexe

Tendances

Tendances (20)

Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH DeploymentThree Ways Kamailio Can Help Your FreeSWITCH Deployment
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
 
rtpengine and kamailio - or how to simulate calls at scale
rtpengine and kamailio - or how to simulate calls at scalertpengine and kamailio - or how to simulate calls at scale
rtpengine and kamailio - or how to simulate calls at scale
 
Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick Introduction
 
rtpengine - Media Relaying and Beyond
rtpengine - Media Relaying and Beyondrtpengine - Media Relaying and Beyond
rtpengine - Media Relaying and Beyond
 
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
 
Asterisk: the future is at REST
Asterisk: the future is at RESTAsterisk: the future is at REST
Asterisk: the future is at REST
 
AstriCon 2017 - Docker Swarm & Asterisk
AstriCon 2017  - Docker Swarm & AsteriskAstriCon 2017  - Docker Swarm & Asterisk
AstriCon 2017 - Docker Swarm & Asterisk
 
Simple callcenter platform with PHP
Simple callcenter platform with PHPSimple callcenter platform with PHP
Simple callcenter platform with PHP
 
Implementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in AsteriskImplementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in Asterisk
 
Kamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade TrafficKamailio - SIP Firewall for Carrier Grade Traffic
Kamailio - SIP Firewall for Carrier Grade Traffic
 
Sipwise rtpengine
Sipwise rtpengineSipwise rtpengine
Sipwise rtpengine
 
Using Kamailio for Scalability and Security
Using Kamailio for Scalability and SecurityUsing Kamailio for Scalability and Security
Using Kamailio for Scalability and Security
 
Containerd Internals: Building a Core Container Runtime
Containerd Internals: Building a Core Container RuntimeContainerd Internals: Building a Core Container Runtime
Containerd Internals: Building a Core Container Runtime
 
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
 
Kamailio on Docker
Kamailio on DockerKamailio on Docker
Kamailio on Docker
 
Introduction to FreeSWITCH
Introduction to FreeSWITCHIntroduction to FreeSWITCH
Introduction to FreeSWITCH
 
Kamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and YouKamailio, FreeSWITCH, and You
Kamailio, FreeSWITCH, and You
 
Networking in Java with NIO and Netty
Networking in Java with NIO and NettyNetworking in Java with NIO and Netty
Networking in Java with NIO and Netty
 
Kamailio - Secure Communication
Kamailio - Secure CommunicationKamailio - Secure Communication
Kamailio - Secure Communication
 
Kamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load BalancersKamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load Balancers
 

Similaire à Getting a live_transcript_of_your_call_using_the_ari

Similaire à Getting a live_transcript_of_your_call_using_the_ari (20)

Developing SIP Applications
Developing SIP ApplicationsDeveloping SIP Applications
Developing SIP Applications
 
How to Build Advanced Voice Assistants and Chatbots
How to Build Advanced Voice Assistants and ChatbotsHow to Build Advanced Voice Assistants and Chatbots
How to Build Advanced Voice Assistants and Chatbots
 
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a FoxModern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
 
CableTap - Wirelessly Tapping Your Home Network
CableTap - Wirelessly Tapping Your Home NetworkCableTap - Wirelessly Tapping Your Home Network
CableTap - Wirelessly Tapping Your Home Network
 
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
 
WebSockets 101
WebSockets 101WebSockets 101
WebSockets 101
 
Containerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to KubernetesContainerizing a REST API and Deploying to Kubernetes
Containerizing a REST API and Deploying to Kubernetes
 
Serverless APIs with Apache OpenWhisk
Serverless APIs with Apache OpenWhiskServerless APIs with Apache OpenWhisk
Serverless APIs with Apache OpenWhisk
 
Securing Your BBC Identity
Securing Your BBC IdentitySecuring Your BBC Identity
Securing Your BBC Identity
 
Wazo Platform @ Astricon19
Wazo Platform @ Astricon19Wazo Platform @ Astricon19
Wazo Platform @ Astricon19
 
Build advanced Voice Assistants and Chat Bots - Stève Sfartz - Codemotion Mil...
Build advanced Voice Assistants and Chat Bots - Stève Sfartz - Codemotion Mil...Build advanced Voice Assistants and Chat Bots - Stève Sfartz - Codemotion Mil...
Build advanced Voice Assistants and Chat Bots - Stève Sfartz - Codemotion Mil...
 
API and Microservices Meetup - To Code or Low Code?
API and Microservices Meetup - To Code or Low Code?API and Microservices Meetup - To Code or Low Code?
API and Microservices Meetup - To Code or Low Code?
 
今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k
 
WebRTC Videobroadcasting
WebRTC VideobroadcastingWebRTC Videobroadcasting
WebRTC Videobroadcasting
 
Is your python application secure? - PyCon Canada - 2015-11-07
Is your python application secure? - PyCon Canada - 2015-11-07Is your python application secure? - PyCon Canada - 2015-11-07
Is your python application secure? - PyCon Canada - 2015-11-07
 
PyCon Canada 2015 - Is your python application secure
PyCon Canada 2015 - Is your python application securePyCon Canada 2015 - Is your python application secure
PyCon Canada 2015 - Is your python application secure
 
WebKit, why it matters (PDF version)
WebKit, why it matters (PDF version)WebKit, why it matters (PDF version)
WebKit, why it matters (PDF version)
 
Building Serverless applications with Python
Building Serverless applications with PythonBuilding Serverless applications with Python
Building Serverless applications with Python
 
WP-CLI: Unleash the power
WP-CLI: Unleash the powerWP-CLI: Unleash the power
WP-CLI: Unleash the power
 
Building iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache BahirBuilding iot applications with Apache Spark and Apache Bahir
Building iot applications with Apache Spark and Apache Bahir
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Getting a live_transcript_of_your_call_using_the_ari

  • 1. GETTING A LIVE TRANSCRIPT OF YOUR CALL PASCAL CADOTTE MICHAUD | CORE DEVELOPER ASTRICON, ATLANTA, OCT. 2019
  • 2. WHO AM I? OPEN SOURCE ENTHUSIAST PASCAL CADOTTE MICHAUD, CORE DEVELOPER @ WAZO 10+ YEARS IN DEVELOPMENT PROGRAMMING SOFTWARES USING ASTERISK FOR ALMOST 10 YEARS USING ● AMI ● DIALPLAN ● AGI ● ARI AND STASIS APPLICATIONS @PCADOTTE @PC-M
  • 3. WAZO PLATFORM PROJECT MISSION LEVERAGE THE BEST OPEN SOURCE COMPONENTS TO TRANSFORM THE WAY WE BUILD IP TELECOM INFRASTRUCTURE AND CREATE COMMUNICATION SERVICES
  • 4. WHY WOULD YOU WANT TO STREAM THE AUDIO OUT OF ASTERISK
  • 5. INTERESTING USES CASES WHY WOULD I STREAM SOUNDS OUT OF ASTERISK? ● ADDING SUBTITLES TO A CALL ● TRANSLATIONS ● DETECTING CUSTOMER FEELING ● CALL PRIORITIZATION ● FRAUD DETECTION ● INDEXATION ● CALL ROUTING IVR http://www.wazo-platform.org/blog/solving-the-emergency-call-prioritization-issue-with-programmable-telecom
  • 6. TIMELINE AUGUST 2018 AUDIO SOCKET OCTOBER 2018 ASTRIDEVCON JANUARY 2019 WAZO PARIS HACKATHON RES_ARI_STREAM JULY 2019 ASTRICON CFP OCTOBER 2019 ASTERISK 16.6.0 WITH EXTERNALMEDIA OUR JOURNEY
  • 7. AUDIO SOCKET BY SEÁN C. MCCORD “AUDIOSOCKET IS A SIMPLE TCP-BASED PROTOCOL FOR SENDING AND RECEIVING REALTIME AUDIO STREAMS. THERE EXISTS A PROTOCOL DEFINITION, A GO LIBRARY, AND AN ASTERISK APPLICATION.” VERY SIMPLE PROTOCOL USING AN ASTERISK DIALPLAN APPLICATION. SEE SEÁN’S PRESENTATION TOMORROW AT 10:30 FOR MORE INTERESTING DETAILS. https://wiki.asterisk.org/wiki/display/AST/AudioSocket
  • 8. A FIRST WORKING IMPLEMENTATION RES_ARI_STREAM RES_ARI_STREAM IS A MODULE DEVELOPED AS A HACKATHON PROJECT TO GET A GOOD FEEL OF THE PROBLEM. IT USES THE ARI WEBSOCKET WITH THE SUB-PROTOCOL “STREAM-CHANNEL”.
  • 9. HOW DOES IT WORK RES_ARI_STREAM 1. ON LOAD ADDS A SUB-PROTOCOL TO THE WEBSOCKET 2. ON SUBSCRIPTION A HOOK ON RECEIVED FRAMES IS ADDED 3. ON VOICE FRAME THE VOICE IS TRANSCODED TO SLIN16 4. THEN THE FRAMES ARE WRITTEN TO THE SUBSCRIBED WEBSOCKET https://github.com/sboily/wazo-hackathon-asterisk-stream-module
  • 10. A VERY BASIC EXAMPLE WRITING THE AUDIO FRAMES TO A FILE import websocket import sys with open("out.wav", "wb") as f: ws = websocket.WebSocketApp( "ws://localhost:5039/ws", on_message=lambda ws, msg: out.write(msg), on_error=lambda ws, error: print(error), on_close=lambda ws: print(“### closed ###”), subprotocols=["stream-channel"], header=[“Channel-ID: “ + sys.argv[1]], ) ws.run_forever()
  • 11. A VERY SIMPLE EXAMPLE USAGE RECORDING THE AUDIO TO A FILE LISTENING TO YOUR RECORDING play -t raw -b 16 --endian little -c 1 -e signed-integer -r 16000 out.wav python3 record-channel-id.py “<my-channel>”
  • 12. ASTERISK IMPLEMENTATION IN ASTERISK 16.6.0 POST /channels/externalmedia 1. CREATE AN EXTERNAL MEDIA CHANNEL WITH AN HOST AND PORT 2. ASTERISK WILL SEND RTP TO THE HOST AND PORT 3. ADD THE EXTERNAL MEDIA CHANNEL TO THE BRIDGE YOU WISH TO LISTEN 4. READ THE RTP FROM THE SOCKET THE UNICASTRTP_LOCAL_ADDRESS AND UNICASTRTP_LOCAL_PORT CHANNEL VARIABLES CONTAIN WHAT YOU NEED TO SEND MEDIA BACK TO ASTERISK. https://wiki.asterisk.org/wiki/display/AST/External+Media+and+ARI https://github.com/asterisk/asterisk-external-media
  • 13. DIFFERENCES BETWEEN THE 3 OPTIONS RES_ARI_STREAM ARI EXTERNALMEDIA AUDIOSOCKET MEDIA DIRECTION UNI-DIRECTIONAL BI-DIRECTIONAL BI-DIRECTIONAL USAGE HTTP ENDPOINT WITH A SPECIFIC SUB-PROTOCOL FOR THE WEBSOCKET LIMITED TO CHANNELS IN STASIS DIALPLAN APPLICATION AND CHANNEL DRIVER ARI RESOURCE IN A GERRIT PULL REQUEST FORMAT SLIN16 IS RECEIVED RTP WITH SPECIFIED CODEC IS RECEIVED VERY SIMPLE PROTOCOL WITH SLIN16 PAYLOAD CONNECTIVITY CONNECTS TO A CHANNEL CONNECTS TO A BRIDGE CONNECTS TO A CHANNEL OR A BRIDGE TRANSPORT WEBSOCKET UDP TCP
  • 15. DEMO OF THE RES_ARI_STREAM MODULE https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/wazo.py https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/transcription.py INCOMING CALL AN INCOMING CALL IS ANSWERED BY ALICE THIS IS A NORMAL CALL, NO STASIS APPLICATION IS REQUIRED HERE TRANSCRIPT SCRIPT TRANSCRIPTION SCRIPT IS LAUNCHED ON THE INCOMING CALL THE SCRIPT CONNECTS TO THE ASTERISK WEBSOCKET AND REGISTERS ITSELF TO THE INCOMING CALL CHANNEL ID GOOGLE SPEECH API TRANSCRIPTION GOOGLE SPEECH API IS USED FOR THE TRANSCRIPTION USER HTTP SERVER THE TRANSLATED TEXT IS SERVED TO THE USER
  • 17. DEMO OF THE ASTERISK ARI VERSION https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/ari_stasis.py https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/ari_server.py https://github.com/pc-m/transcript-demo/blob/master/transcript_demo/transcription.py STASIS THE CALL ENTERS STASIS THE STASIS APPLICATION ADDS THE CALL TO ITS BRIDGE UDP SERVER THE SERVER RECEIVES THE RTP FROM ASTERISK THE SERVER CREATES THE EXTERNAL MEDIA CHANNELS WHICH GET ADDED TO THE STASIS BRIDGE AND RECEIVES THE RTP GOOGLE SPEECH API TRANSCRIPTION GOOGLE SPEECH API IS USED FOR THE TRANSCRIPTION USER HTTP SERVER THE TRANSLATED TEXT IS SERVED TO THE USER
  • 18. WAZO PLATFORM: COLLABORATION OPEN COLLABORATION & OPEN DEVELOPMENT OPEN SOURCE PROJECT https://www.wazo-platform.org/ PR WORKFLOW @ GITHUB https://github.com/wazo-platform/ MATTERMOST CHAN https://mm.wazo.community/wazo-platform/ SERVICE CODE UNDER GLPV3+ LICENCE LIBRARY CODE UNDER MIT LICENCE
  • 19. LET’S CONNECT BUILD GREAT SOLUTIONS WITH WAZO PLATFORM BOOTH WAZO W/ THE TEAM : FRED, SYLVAIN, PASCAL & JÉROME TO KNOW MORE : - JEROME’S TALK : WEDNESDAY - 1:30PM MORE INFO : - BLOG POST - OFFICIAL DEMO @GITHUB