• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
VoIP applications and the Cloud - Where gen_fsm really shines
 

VoIP applications and the Cloud - Where gen_fsm really shines

on

  • 642 views

VoIP applications and the Cloud - Where gen_fsm really shines ...

VoIP applications and the Cloud - Where gen_fsm really shines

Aptela provides hosted communications services for small business. Our - entirely cloud based - platform includes complex call routing, messaging, web-portals, mobile apps, PSTN/SIP access, and a coffee-grinder attachment. At peak, we handle dozens of calls (and an infinity of HTTP requests) per second
These complex calling services work thanks to the magic of gen_fsm, a behavior which is frequently overlooked at best, and ignored at worst. In the first part of the talk, I'll describe our architecture, with gen_fsm's critical role in it as the focus. The second part will delve into the specifics of how this behavior can help build out complex calling services, with examples culled from some of Aptela's cooler (or crazier?) features

Statistics

Views

Total Views
642
Views on SlideShare
642
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Three types of PBXs – Named Box, High Level App Server, and Granular App ServerNamed Box – point at a box, and say “Yup, that’s my server”High Level App Server – Broadsoft and/or FS/Asterisk using dialplans.
  • Point features are really easy to do. They are atomic, and don’t interact with each otherWhen you start talking about multiple entities interacting, users xferring amongst each other, state across a distributed environment, life gets a lot more difficult
  • Explain supervisor trees - restart processes - dynamically move them around - location invariance - resilience
  • We use event_handlers to get information to endpointsGUI – anytime something interesting ahppens, we ship events off to the GUI (ringing, answered, presenceApplication – The State servers (where processes live) ship events back and forth so that processes can keep up to dateTelephony – Call servers use events to know what to do next (based on the FSMs). Pick up the call, play an error message, etc.
  • We use event_handlers to get information to endpointsGUI – anytime something interesting ahppens, we ship events off to the GUI (ringing, answered, presenceApplication – The State servers (where processes live) ship events back and forth so that processes can keep up to dateTelephony – Call servers use events to know what to do next (based on the FSMs). Pick up the call, play an error message, etc.
  • We have our own BGP ASWe have DIDs from multiple providers ( limits exposure)
  • We use Finite State Machines – gen_fsm – to deal with anything and everything involving callsauto_attendant, bridge, check_voicemail, conference, default_phone, fml, dial_out, and havent even gotten to the voicemails and faxes
  • We use Finite State Machines – gen_fsm – to deal with anything and everything involving callsauto_attendant, bridge, check_voicemail, conference, default_phone, fml, dial_out, and havent even gotten to the voicemails and faxes
  • We use Finite State Machines – gen_fsm – to deal with anything and everything involving callsauto_attendant, bridge, check_voicemail, conference, default_phone, fml, dial_out, and havent even gotten to the voicemails and faxes

VoIP applications and the Cloud - Where gen_fsm really shines VoIP applications and the Cloud - Where gen_fsm really shines Presentation Transcript

  • FSMs can be Useful Mahesh Paolini-Subramanya CTO, Vocalocity
  • Hosted PBX Taxonomy ► Named Box • Pure hosting • Clustering/Virtual or Big Honking Box • Load/Scaling issues same as ‘one box’ application ► High Level Application Server • Calls generate high level events • Events interact with application server • Predefined spaces/features • Load/Scaling issues same as ‘one box’ application © Vocalocity 2011. Confidential. 2
  • Hosted PBX Taxonomy ► Granular Application Server • Calls generate granular events • Events interact with application server • Easy to create simple applications  Point features: FML, notifications, transcriptions  Call Switch: Routing, voicemail ► Difficult to build complex applications • Updates and deployments • Testing and Debugging • Concurrency • Scaling and Partitioning • Persistence © Vocalocity 2011. Confidential. 3
  • Cloud Computing ►Wikipedia “a style of computing in which typically real-time scalable resources are provided as a service over the Internet to end- users who need not have knowledge of, expertise in, or control over the technology infrastructure” ►Vocalocity • Horizontal Scaling and/or Clustering • Abstraction of application layer • SOA and/or fine-grained API • Redundancy irrelevance © Vocalocity 2011. Confidential. 4
  • Cloud Computing ► Telephony makes it harder • Simple and distributed actions? Done • High Level Applications? Done • Both at the same time? Well, Maybe Not… ► Vocalocity • Distributed application infrastructure (erlang) • Distributed persistence infrastructure • Distributed telephony infrastructure  Simple, atomic events!! © Vocalocity 2011. Confidential. 5
  • Why erlang? ► Testing ► Code deployment ► Concurrency ► Complexity ► Predictable Performance ► Fault tolerance ► Error Containment ► Testing ► Code Deployment © Vocalocity 2011. Confidential. 6
  • Clean APIs ► Only interface into System ► Handlersfor different modalities System • HTTP for Public • STOMP for Private Business Rules STOMP HTTP Event Workflow Vocalocity Call Server © Vocalocity 2011. Confidential. 7
  • Clean APIs ► Administrative • CRUD – Users, Depts, … System • Regulatory – E911, TRS, … • OSS ► Informative Business Rules • Notifications • High Level Events • Messages – History, Reporting STOMP HTTP Event ► Interactive • Communications – Calls, Contacts, …Workflow Vocalocity Call Server • Profile – Blacklist, FML, Media, … • Messages – History, Reporting, … © Vocalocity 2011. Confidential. 8
  • Processes ► Allrequest goes to any available application node as a message ► Nodes have processes • Users • Clients • Calls • Faxes • Phones • Load Balancers ► Processes do things © Vocalocity 2011. Confidential. 9
  • Event Handlers ► Theyget information to endpoints • GUI • API callbacks © Vocalocity 2011. Confidential. 10
  • Event Handlers ► The perform asynchronous application activities • Logging • notifications ► They bridge between the FSMs and the calls • Check blacklist • Play error message • Hangup • Go offhook © Vocalocity 2011. Confidential. 11
  • Calling ► Calls are tracked as Processes ► Event interface for requests and responses (XML) ► fine-grained events that can • make/break calls • record audio and dtmf System System System • play audio and dtmf • file operations erlang / xml / events ► Call Process tracks • Channel parameters Call Server Call Server Call Server • FSM name and state © Vocalocity 2011. Confidential. 12
  • Finite State Machines ► System has a limited set of states ► Statestransition based on conditions ► Transitions are atomic ► Events and actions at entry and exit A Dog A Cat * Diagrams from http://learnyousomeerlang.com/finite-state-machines © Vocalocity 2011. Confidential. 13
  • Finite State Machines ► Many many many FSMs (25 at last count) init • Auto Attendant • FML Check node • Voicemail • Conference Check Blacklist Move node • Fax • C2C • Video Cancelled Blacklisted Next Endpoint Collections Unknown • Directory • Search • Announcements Auto Attendant FML Voicemail Conference Fax • Paging © Vocalocity 2011. Confidential. 14
  • Finite State Machines ► Templates are your friend init init ► So are BIG sheets of paper. Return Setup Call AutoAttendant ► More is merrier ► But keep them simple, OK? Hangup Get Caller Name Play Transfer ► Mixing States is BAD Message ► As is my haiku talent. Got Caller Name Dial © Vocalocity 2011. Confidential. 15
  • FSMs can be Useful – See? Mahesh Paolini-Subramanya CTO, Vocalocity