Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Build HA Asterisk on Microsoft Azure using DRBD/Heartbeat

3,602 views

Published on

This was presented during Microsoft Azure's BootCamp on April 25 2015 at Microsoft Malaysia. This particular session was about using OSS Asterisk on Azure with HA capabilities.

Published in: Technology
  • Dating direct: ❤❤❤ http://bit.ly/2ZDZFYj ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Follow the link, new dating source: ♥♥♥ http://bit.ly/2ZDZFYj ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Build HA Asterisk on Microsoft Azure using DRBD/Heartbeat

  1. 1. The Cloud Has Spoken Real-time Communications on Microsoft Azure Copyright 2015 © Astiostech Sdn Bhd. For informational purposes only. No warranties of any kind are made and you have to verify all information before relying on it. You can re-use this presentation as long as you read, agree, and follow the guidelines described in the “Comments” field in File/Properties. #AzureSpeaks | Sanjay@Astiostech.com
  2. 2. Bragging rights Microsoft MVP in Enterprise Security Some 15 years experience with security Communications as well, since 8 years One of the first VaaS in Malaysia Passionate dev. & can play some badminton
  3. 3. Introduction To Asterisk Enterprise PBX functionalities Interconnects to almost any telco (TM, TIME, Maxis, etc) Integration with computers Relatively large scalability Connects with anything compatible (phones, etc..)
  4. 4. Introduction To Asterisk Become a call center Enable IP features (e.g. SIP to cost saving gateways) Bridge using IP between remote offices (free calls) Voicemail/VMtoEmail services Integrate to CRM/Database/Software Build as needed!
  5. 5. Introduction To Asterisk Create voice apps #hackersPBX #AzureSpeaks
  6. 6. It’s simple programming exten => 2020,1,Answer same => n,Playback(hello-world) same => n,Hangup
  7. 7. Demo – Writing a program (dialplan) Let’s program hello world
  8. 8. Azure as my PBX
  9. 9. Asterisk as my PBX • Features Easy deployment Fast scalability Secure by implementation Can be deployed across multi geo locations Plug and play for customers/users Number follows you anywhere you go • Enablers Current telcos providing VoIP PSTN in and out Extremely high broadband penetration rate Cheaper calls, competition with call traffic Multi route for resilience Location independent Obvious TCO Negligible latency
  10. 10. Azure as my PBX Designed for noobs (like me) Proven reliability Supports many big Linux distros Ubuntu CentOS CoreOS Oracle Linux Suse Enterprise and OpenSue Has its own HA/LB method (explained later) Extremely Fast Geographically suitable APAC Singapore, Hong Kong
  11. 11. Azure as my PBX Latency is negligible (using SIP with uLaw, no compression, no encapsulation, no encryption) Singapore was around 40ms-60ms Hong Kong was around 70ms-80ms ITU-T recommendation latency is 150ms for voice traffic (and 250ms roundtrip) Low packet loss rate Approximately 0.09 - 0.1%
  12. 12. Azure Asterisk PBX HA Setup guide..
  13. 13. What did we setup on our demo? Redundant Asterisk on Azure Two SIP servers (Active / Passive) One DB server (could also be HA if required) Uses Azure Cloud HA for targeting Typically we use another method (explained later) Uses common and easy HA methods on Linux
  14. 14. Azure Asterisk HA Demo SetupAsterisk Master Asterisk Slave Asterisk Configurator DB Azure Cloud HA Public Network Telco A Telco B
  15. 15. Software in Demo Azure Asterisk Asterisk 11 or higher FreePBX 2.11 or higher MySQL 5 PHP Heartbeat DRBD
  16. 16. The Azure Asterisk Stack LINUX OS * ASTERISKAPACHE MYSQL FreePBXFOP2 MonAST ASTIOSTECH BTEL PBX UI/Tools Core OS
  17. 17. Steps to build Asterisk HA on Azure • We use Ubuntu
  18. 18. Azure Active Server Targeting Enable HTTP/TCP Ports for Azure Cloud monitoring. Since Azure monitors HTTP or TCP ports only Enable a daemon service [demo] to monitor Asterisk In case Asterisk goes down, initiate failover/failback For WebRTC simply “check” 443 or 80 Ensure client side has sufficient bandwidth Use compression codecs, but don’t compress too much All other ports should then be “relayed and instructed” by the HTTP/TCP via Azure, esp. when there’s RTPSIP ports You might want to enable individual ports for SSH But you cannot use the same public facing port twice AZURE CLOUD LAYER TCP PROBE WHICH ACTIVE SERVER RUNNING TCP 5060 ACTIIVE SERVER CONNECTS TO CONFIG DB PUBLIC LAYER WHICH ACTIVE SERVER RUNNING TCP 5060 SIP USER
  19. 19. Steps to build Asterisk HA on Azure • Use the same Cloud Service on the Second and third VM
  20. 20. Steps to build Asterisk HA on Azure • Create end points and check “CREATE A LOAD-BALANCED SET” to failover the necessary ports else leave it to run normally.
  21. 21. Asterisk HA On Azure Demo Setup Opened Ports
  22. 22. Steps to build Asterisk HA on Azure • Create an empty disk on two of the Asterisk VMs and attach it once done.
  23. 23. Steps to build Asterisk HA on Azure There are 2 major components in our HA package 1. Heartbeat Heartbeat is a daemon that provides cluster infrastructure (communication and membership) services to its clients. 2. DRBD
  24. 24. Steps to build Asterisk HA on Azure DRBD refers to block devices designed as a building block to form high availability (HA) clusters. This is done by mirroring a whole block device via an assigned network. DRBD can be understood as network based raid-1.
  25. 25. Asterisk HA On Azure Management UI
  26. 26. Summary: Steps to build a HA Asterisk on Azure Setup (min 2#) machines on Azure Assign the VMs with the same cloud service. Attach same sized empty disks Install Asterisk (and other software) Build HA – Heartbeat / DRBD Open the necessary end points.
  27. 27. Demo – Calls (In,out,peers) DISCLAIMER: Bandwidth is something we can’t guarantee at this venue Scenarios 1) Calls from desktop to another IP Phone 2) Calls from desktop to Pizzahut Malaysia 3) Auto attendant (XXXXXXXXX)
  28. 28. Live Node = Master SLAVE heartbeat Replication Ext: 1000 Ext: 1001 Anthony s Cell Phone TM MASTER (ACTIVE) astiosmaster.cloudapp.net
  29. 29. Failover (Master -> Slave) Master Slave
  30. 30. Failback and quick test Master Slave
  31. 31. Live Node = Slave SLAVE (ACTIVE) heartbeat Replication Ext: 1000 Ext: 1001 Anthony s Cell Phone TM MASTER astiosmaster.cloudapp.net
  32. 32. Demo: Application Gateways and Asterisk •Dial XX.XXXXXXXX • Enter GST number • Web scraping (customs dept website using phanthom.js).. If exist -> Read company If not -> Complain on the phone The GST checker dialplan
  33. 33. Demos: Video calls, etc.. DISCLAIMER: Bandwidth is something we can’t guarantee at this venue Scenarios 1) Calls from desktop to Win tablet 2) Calls from desktop to iPad (moving target, literally :P) 3) Other stuff
  34. 34. Start building you first Asterisk@Azure It takes 45 minutes to get Asterisk running Use TELCO can supply numbers via SIP (voip) Get decent connections Load test voice then video Limit exposure, use strong passwords, etc.. #AzureSpeaks
  35. 35. The Cloud Has Indeed Spoken #AzureSpeaks Copyright 2015 © Astiostech Sdn Bhd. For informational purposes only. No warranties of any kind are made and you have to verify all information before relying on it. You can re-use this presentation as long as you read, agree, and follow the guidelines described in the “Comments” field in File/Properties.

×