ARI and AGI
A powerful combination
Jöran Vinzens
@vinzens81
linkedin.com/in/jvinzens/
What?
What?
It is not a manual how to use Asterisk!
What?
Story of how we think we could be ready for the future.
What are AMI, AGI and ARI
What are AMI, AGI and ARI
Interfaces to control the Asterisk
What are AMI, AGI and ARI
AMI - Asterisk Manager Interface
● Event based
● Modify or create Channels
● No access to Dialplan Functions or Apps
● Asynchronous does not block
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=4817239
What are AMI, AGI and ARI
AGI - Asterisk Gateway Interface
● Execute a script or call a socket
● Only on dialplan operation
● Can execute dialplan applications and functions
● Easy to use
● Synchronous and blocks channel
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=32375589
AGI != FastAGI
What are AMI, AGI and ARI
ARI - Asterisk REST Interface
● Event based
● HTTP socket and REST interface
● Control of low level resources in Asterisk
● Asynchronous, might block
ARI = Dialplan app Stasis
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573
What are AMI, AGI and ARI
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573
What are AMI, AGI and ARI
When to use what?
AMI - Channel manipulation during a call
AGI - Extended dialplan Handling
ARI - Write your own dialplan application
https://wiki.asterisk.org/wiki/display/AST/AMI+v2+Specification#AMIv2Specification-ProtocolOverview
Goal
Goal
Everyone should be able to write PBX features
Goal
SIP, Asterisk Dialplan, AGI, AMI, ARI, etc. are complex
Goal
Create an abstraction
What are we doing with the Asterisk
What are we doing with the Asterisk?
Call routing
In call features
Accounting/billing
Announcements
IVR, Conference etc….
Customer API
How are we using the Asterisk
How are we using the Asterisk?
Lot of Dialplan
Several FastAGI executions
Some AGI Scripts
AMI call manipulation
How are we using the Asterisk?
Lot of Dialplan
Several FastAGI executions
Some AGI Scripts
AMI call manipulation
Every feature is distributed allover the place
Problems with the current setup
Problems with the current Setup
Everything saved in Channel Vars
Several local Dial()
Multiple Calls of FastAGI and AGI and manager Interconnection
Problems with the current Setup
Loss of state and variables
Features interfere with each other
Problems with the current Setup
Loss of state and variables
Features interfere with each other
Setup has been grown beyond repair
Possible solution
Possible solution
Respect system boundaries
Stick to standards
Use components for what they are designed for
Possible solution
AGI
● Use as testable dialplan generic to any features
ARI
● Control of resources during the call specific to each feature
Possible solution
AGI
● Call Setup and Teardown
ARI
● The only instance controlling a feature during the entire call
Possible solution
AGI
● Check the feature and call correct Stasis App
● Determine outgoing carrier, write CDR, ...
ARI
● All feature relevant handlings
How would it look like
How would it look like?
How would it look like?
How would it look like?
App
dispatcher
ARI App
Out
dispatcher
App
dispatcher
ARI App
SIP SIPlocal
How would it look like?
App Dial -> App Stasis
How would it look like?
App Dial -> App Stasis
Small-sized Stasis apps
How would it look like?
Use ARI Proxy
Move routing logic away from Asterisk
How would it look like?
Use ARI Proxy
Move routing logic away from Asterisk
Kafka -> https://github.com/retel-io/ari-proxy
NATS / Rabbit MQ -> https://github.com/CyCoreSystems/ari-proxy
How would it look like?
How would it look like?
Low level API, ARI High level API
How would it look like?
Asterisk
ARI WS
ARI REST
Kafka
Low level
Call
control
High level
Feature
control
Low level API, ARI High level API
ARI Proxy
Benefits
Benefits
● Less untested dialplan
● Easy to replace features
● No developer interactions with Asterisk Dialplan
● Generic Asterisk dialplan
● Low level ARI API enables any feature
● Decouple telephony feature from Asterisk
Benefits
AGI -> control generic Features
ARI -> enables features and isolates from each other
Earlier
Earlier
Astricon 2018: How ARI-Proxy works
youtube.com/watch?v=vMCyuItMYxE
CommCon 2019: Migrate old to new
youtube.com/watch?v=Y9R0mg9eC9c
Questions?
Thanks for listening!
Jöran Vinzens
@vinzens81
linkedin.com/in/jvinzens/

More Related Content

PPTX
Using ARI and AGI to Connect Asterisk Instances
ODP
Expanding Asterisk with Kamailio
ODP
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
PDF
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
ODP
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
PDF
LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...
PDF
Getting a live_transcript_of_your_call_using_the_ari
PDF
SIP Attack Handling (Kamailio World 2021)
Using ARI and AGI to Connect Asterisk Instances
Expanding Asterisk with Kamailio
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
LF_APIStrat17_Creating Communication Applications using the Asterisk RESTFul ...
Getting a live_transcript_of_your_call_using_the_ari
SIP Attack Handling (Kamailio World 2021)

What's hot (20)

PDF
Kamailio on Docker
PDF
Scaling Asterisk with Kamailio
PDF
Sipwise rtpengine
PPTX
FreeSWITCH as a Kickass SBC
PDF
Astricon 2016 - Scaling ARI and Production
PDF
Simple callcenter platform with PHP
PDF
Kamailio, FreeSWITCH, and You
PPTX
ceph optimization on ssd ilsoo byun-short
PDF
SIPREC RTPEngine Media Forking
PDF
Kernel Recipes 2015: Representing device-tree peripherals in ACPI
PDF
IT Automation with Ansible
PDF
Asterisk Complete Training
PDF
Asterisk, HTML5 and NodeJS; a world of endless possibilities
PPTX
Introduction to ansible
PDF
Kamailio with Docker and Kubernetes
PDF
rtpengine and kamailio - or how to simulate calls at scale
PPT
Matrix Telecom Solutions: SETU VTEP - Fixed VoIP to T1/E1 PRI Gateway
PDF
HashiCorp's Vault - The Examples
PDF
Kamailio :: A Quick Introduction
DOCX
Huawei cisco command conversion
Kamailio on Docker
Scaling Asterisk with Kamailio
Sipwise rtpengine
FreeSWITCH as a Kickass SBC
Astricon 2016 - Scaling ARI and Production
Simple callcenter platform with PHP
Kamailio, FreeSWITCH, and You
ceph optimization on ssd ilsoo byun-short
SIPREC RTPEngine Media Forking
Kernel Recipes 2015: Representing device-tree peripherals in ACPI
IT Automation with Ansible
Asterisk Complete Training
Asterisk, HTML5 and NodeJS; a world of endless possibilities
Introduction to ansible
Kamailio with Docker and Kubernetes
rtpengine and kamailio - or how to simulate calls at scale
Matrix Telecom Solutions: SETU VTEP - Fixed VoIP to T1/E1 PRI Gateway
HashiCorp's Vault - The Examples
Kamailio :: A Quick Introduction
Huawei cisco command conversion
Ad

Similar to ARI and AGI, a powerful combination (20)

PDF
SITREP - Asterisk REST. The first steps are done, now what? - CommCon 2019
PDF
Astricon plan 9 2020
PDF
Using Asterisk in a SIP softswitch
PPTX
Parth for ip pbx- office communication
PDF
astricon2018
PDF
Asterisk Update
PDF
PDF
Asterisk-Java Framework Presentation
PDF
Adhearsion and Telegraph Framework Presentation
PDF
Digital connect
PDF
Apidays Paris 2023 - AGI & APIs: Crafting the Future of Intelligent Integrati...
PDF
respond_to :voice - the convergence of voice and web interfaces with Rails an...
PDF
Asterisk - el futuro es REST
PDF
Scaling FastAGI Applications with Go
PPTX
Asterisk Deployments
PPTX
Introduction to IP telephony & VoIP
PDF
Asterisk: the future is at REST
PDF
Asterisk: El futuro es REST
PPSX
Presentación exiacore inglés blog
PDF
Netstyle VoIP Solutions
SITREP - Asterisk REST. The first steps are done, now what? - CommCon 2019
Astricon plan 9 2020
Using Asterisk in a SIP softswitch
Parth for ip pbx- office communication
astricon2018
Asterisk Update
Asterisk-Java Framework Presentation
Adhearsion and Telegraph Framework Presentation
Digital connect
Apidays Paris 2023 - AGI & APIs: Crafting the Future of Intelligent Integrati...
respond_to :voice - the convergence of voice and web interfaces with Rails an...
Asterisk - el futuro es REST
Scaling FastAGI Applications with Go
Asterisk Deployments
Introduction to IP telephony & VoIP
Asterisk: the future is at REST
Asterisk: El futuro es REST
Presentación exiacore inglés blog
Netstyle VoIP Solutions
Ad

More from Jöran Vinzens (7)

PPTX
Integrate POTS Carrier grade PBX to AI and WebRTC
PDF
Asterisk 11to16, What could go wrong
PDF
Commcon 2018
ODP
Astricon 2015
PDF
Ss7 isup homer
PDF
Astricon 2016
PDF
Astricon 2017 Superpower of deployment tools
Integrate POTS Carrier grade PBX to AI and WebRTC
Asterisk 11to16, What could go wrong
Commcon 2018
Astricon 2015
Ss7 isup homer
Astricon 2016
Astricon 2017 Superpower of deployment tools

Recently uploaded (20)

PDF
Getting Started with Data Integration: FME Form 101
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
STKI Israel Market Study 2025 version august
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Hybrid model detection and classification of lung cancer
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Five Habits of High-Impact Board Members
PDF
August Patch Tuesday
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Getting started with AI Agents and Multi-Agent Systems
Getting Started with Data Integration: FME Form 101
sustainability-14-14877-v2.pddhzftheheeeee
STKI Israel Market Study 2025 version august
Univ-Connecticut-ChatGPT-Presentaion.pdf
O2C Customer Invoices to Receipt V15A.pptx
Hybrid model detection and classification of lung cancer
A comparative study of natural language inference in Swahili using monolingua...
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Enhancing emotion recognition model for a student engagement use case through...
Benefits of Physical activity for teenagers.pptx
NewMind AI Weekly Chronicles – August ’25 Week III
Taming the Chaos: How to Turn Unstructured Data into Decisions
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Five Habits of High-Impact Board Members
August Patch Tuesday
A contest of sentiment analysis: k-nearest neighbor versus neural network
observCloud-Native Containerability and monitoring.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Zenith AI: Advanced Artificial Intelligence
Getting started with AI Agents and Multi-Agent Systems

ARI and AGI, a powerful combination

  • 1. ARI and AGI A powerful combination Jöran Vinzens @vinzens81 linkedin.com/in/jvinzens/
  • 3. What? It is not a manual how to use Asterisk!
  • 4. What? Story of how we think we could be ready for the future.
  • 5. What are AMI, AGI and ARI
  • 6. What are AMI, AGI and ARI Interfaces to control the Asterisk
  • 7. What are AMI, AGI and ARI AMI - Asterisk Manager Interface ● Event based ● Modify or create Channels ● No access to Dialplan Functions or Apps ● Asynchronous does not block https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=4817239
  • 8. What are AMI, AGI and ARI AGI - Asterisk Gateway Interface ● Execute a script or call a socket ● Only on dialplan operation ● Can execute dialplan applications and functions ● Easy to use ● Synchronous and blocks channel https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=32375589
  • 10. What are AMI, AGI and ARI ARI - Asterisk REST Interface ● Event based ● HTTP socket and REST interface ● Control of low level resources in Asterisk ● Asynchronous, might block ARI = Dialplan app Stasis https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573
  • 11. What are AMI, AGI and ARI https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573
  • 12. What are AMI, AGI and ARI When to use what? AMI - Channel manipulation during a call AGI - Extended dialplan Handling ARI - Write your own dialplan application https://wiki.asterisk.org/wiki/display/AST/AMI+v2+Specification#AMIv2Specification-ProtocolOverview
  • 13. Goal
  • 14. Goal Everyone should be able to write PBX features
  • 15. Goal SIP, Asterisk Dialplan, AGI, AMI, ARI, etc. are complex
  • 17. What are we doing with the Asterisk
  • 18. What are we doing with the Asterisk? Call routing In call features Accounting/billing Announcements IVR, Conference etc…. Customer API
  • 19. How are we using the Asterisk
  • 20. How are we using the Asterisk? Lot of Dialplan Several FastAGI executions Some AGI Scripts AMI call manipulation
  • 21. How are we using the Asterisk? Lot of Dialplan Several FastAGI executions Some AGI Scripts AMI call manipulation Every feature is distributed allover the place
  • 22. Problems with the current setup
  • 23. Problems with the current Setup Everything saved in Channel Vars Several local Dial() Multiple Calls of FastAGI and AGI and manager Interconnection
  • 24. Problems with the current Setup Loss of state and variables Features interfere with each other
  • 25. Problems with the current Setup Loss of state and variables Features interfere with each other Setup has been grown beyond repair
  • 27. Possible solution Respect system boundaries Stick to standards Use components for what they are designed for
  • 28. Possible solution AGI ● Use as testable dialplan generic to any features ARI ● Control of resources during the call specific to each feature
  • 29. Possible solution AGI ● Call Setup and Teardown ARI ● The only instance controlling a feature during the entire call
  • 30. Possible solution AGI ● Check the feature and call correct Stasis App ● Determine outgoing carrier, write CDR, ... ARI ● All feature relevant handlings
  • 31. How would it look like
  • 32. How would it look like?
  • 33. How would it look like?
  • 34. How would it look like? App dispatcher ARI App Out dispatcher App dispatcher ARI App SIP SIPlocal
  • 35. How would it look like? App Dial -> App Stasis
  • 36. How would it look like? App Dial -> App Stasis Small-sized Stasis apps
  • 37. How would it look like? Use ARI Proxy Move routing logic away from Asterisk
  • 38. How would it look like? Use ARI Proxy Move routing logic away from Asterisk Kafka -> https://github.com/retel-io/ari-proxy NATS / Rabbit MQ -> https://github.com/CyCoreSystems/ari-proxy
  • 39. How would it look like?
  • 40. How would it look like? Low level API, ARI High level API
  • 41. How would it look like? Asterisk ARI WS ARI REST Kafka Low level Call control High level Feature control Low level API, ARI High level API ARI Proxy
  • 43. Benefits ● Less untested dialplan ● Easy to replace features ● No developer interactions with Asterisk Dialplan ● Generic Asterisk dialplan ● Low level ARI API enables any feature ● Decouple telephony feature from Asterisk
  • 44. Benefits AGI -> control generic Features ARI -> enables features and isolates from each other
  • 46. Earlier Astricon 2018: How ARI-Proxy works youtube.com/watch?v=vMCyuItMYxE CommCon 2019: Migrate old to new youtube.com/watch?v=Y9R0mg9eC9c
  • 47. Questions? Thanks for listening! Jöran Vinzens @vinzens81 linkedin.com/in/jvinzens/