From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Asterisk amqp @ astricon19
1. AMQP SUPPORT FOR ASTERISK
SYLVAIN BOILY | CTO WAZO
ASTRICON, ATLANTA, OCT 2019
2. WHO AM I?
OPEN SOURCE ENTHUSIAST
SYLVAIN BOILY, CTO @ WAZO
20 YEARS IN OPEN SOURCE
FOUNDER OF XIVO (2005) AND WAZO PROJECT (2016)
@quintana_ @sboily
3. CONTEXT
WHAT IS WAZO-PLATFORM?
UNIFIED APPROACH
FOR AUTHENTICATION,
CONF, DEPLOYMENT,
MGMT, SECURITY,
SCALING, …
ABILITY TO HAVE A
COHERENT & FULL
FEATURED PLATFORM TO
BUILD TELECOM
INFRASTRUCTURE
ABSTRACT TELECOM
COMPLEXITY AND CONSUME
ALL YOUR SERVICES
THROUGH WEB & CLOUD
TECHNOLOGIES
4. WHY?
● Use case
○ Simplify the scaling without any proxy
○ Synchronize state with AMQP
■ devstate
■ channels
○ Multiple applications on single stasis
● Remove direct connection to AMI (no parsing)
○ And use AJAM to send actions to AMI
● Scale (auto)
○ https://github.com/sboily/asterisk-consul-module
● Remove external proxy for ARI like (no SPOF)
○ https://github.com/nvisibleinc/go-ari-proxy
● We already talked about this feature at different last Astridevcon
5. PRESENTED IN 2017
First version has been presented at Astridevcon 2017
● AMQP support for Stasis in
○ AMI
○ ARI
○ Channels
But some issues has been found. Wasn’t possible to use websocket and AMQP at same time.
No time to continue this project before this summer ...
Thank to Andrew (@tm1000) for making some tests.
6. WHAT WE CHANGED?
● Worked this summer (thank to Nicolaos)
● Capacity to use websocket or AMQP for an application
● Added ARI endpoint to activate the application
● Add support for subscribing to AMQP for res_amqp
● 3 modules now
○ But probably more will be better (plugable system)
7. RES_AMQP
● AMQP client for Asterisk
○ publish
○ subscribe (on a branch)
● Based on patch from https://reviewboard.asterisk.org/r/4365/
● Extracted version to have a first asterisk patch
○ https://github.com/wazo-platform/wazo-res-amqp
● Base on librabbitmq
○ We only test with rabbitmq
● Configuration is on /etc/asterisk/amqp.conf
● it doesn’t nothing, only an AMQP client
● To install
○ git clone, make, make install
8. RES_STASIS_AMQP
● Publish stasis messages to AMQP
○ https://github.com/wazo-platform/wazo-res-stasis-amqp
● Support
○ stasis AMI
○ stasis ARI
○ stasis channel
● Depends on res_amqp client
● Configuration /etc/asterisk/res_stasis_amqp.conf
● To install
○ git clone, make, make install
● To test on your Asterisk and get messages
○ https://github.com/wazo-platform/xivo-tools/blob/master/scripts/recv-bus-event
○ Adapt the exchange on the script
9. RES_ARI_AMQP
● Activate application to use AMQP instead websocket
○ Stateless and not statefull
○ Application is not connected, but events is sent
● Create a new endpoint on ARI to permit to activate an application
10. QUICK DANGEROUS DEMO
With websocket support
● Call a number
● Received call in the ARI application
With AMQP support
● Activate application with the ARI endpoint
● Call number
● Received event in AMQP
With AMI support in AMQP
● Call number and see AMI events from AMQP
11. INTEGRATION TO ASTERISK
● Proposal
○ submit to gerrit the res-amqp support (pub and sub)
○ submit to gerrit the res-stasis-amqp support
■ Probably different approach for ARI and AMI? (modules for each support?)
○ submit to gerrit the res-ari-amqp support
■ Feedback about endpoint naming is welcome
PASCAL IN THE ROOM WILL BE IN CHARGE TO PUSH IT TO GERRIT.