Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rayo for FreeSWITCH

Ben Langfeld
September 04, 2013

Rayo for FreeSWITCH

Presented on the ClueCon Weekly call, 2013-09-04.

Ben Langfeld

September 04, 2013
Tweet

More Decks by Ben Langfeld

Other Decks in Programming

Transcript

  1. P A G E 2 WHAT IS ADHEARSION? •Middle man

    between phone calls and the real world •Does not process any media or handle signaling directly •Exercises third-party call control (3PCC) •All Ruby •High-level API Voice App Punchblock AMI IES FreeSWITCH Logging Plugins Statistics SQL Web Service REST/JSON/XML Carrier APIs Wednesday, 4 September 13
  2. • Separation of business logic from switching • Flexibility of

    high-level languages and their libraries • Clean application structure • Reuse of application level logic P A G E 3 WHY 3PCC? • Modern object-oriented language • Optimised for developer happiness • Easy to learn • Vast community and body of 3rd party libraries WHY RUBY? Wednesday, 4 September 13
  3. P A G E HOW DO CALLS WORK WITH 3PCC?

    4 SIP Media & Signaling 3PCC No media, just business logic Rayo Protocol (over XMPP) Jingle Wednesday, 4 September 13
  4. P A G E HOW DOES ADHEARSION WORK ON FS?

    5 Wednesday, 4 September 13
  5. • Punchblock ‘platform consistency’ layer P A G E HOW

    DOES ADHEARSION WORK ON FS? 5 Wednesday, 4 September 13
  6. • Punchblock ‘platform consistency’ layer • Inbound Event Socket ->

    Rayo Protocol P A G E HOW DOES ADHEARSION WORK ON FS? 5 Wednesday, 4 September 13
  7. • Punchblock ‘platform consistency’ layer • Inbound Event Socket ->

    Rayo Protocol • Adhearsion consumes Rayo Protocol P A G E HOW DOES ADHEARSION WORK ON FS? 5 Wednesday, 4 September 13
  8. • Punchblock ‘platform consistency’ layer • Inbound Event Socket ->

    Rayo Protocol • Adhearsion consumes Rayo Protocol • One application instance per FS instance P A G E HOW DOES ADHEARSION WORK ON FS? 5 Wednesday, 4 September 13
  9. • Punchblock ‘platform consistency’ layer • Inbound Event Socket ->

    Rayo Protocol • Adhearsion consumes Rayo Protocol • One application instance per FS instance • Future: true multi-tenant Rayo on FS? P A G E HOW DOES ADHEARSION WORK ON FS? 5 Wednesday, 4 September 13
  10. P A G E FREESWITCH GETS MOD_RAYO 6 Voice App

    Punchblock AMI FreeSWITCH Logging Plugins Statistics SQL Web Service REST/JSON/XML Carrier APIs Wednesday, 4 September 13
  11. P A G E FREESWITCH GETS MOD_RAYO • mod_rayo developed

    by Chris Rienzo with the sponsorship of Grasshopper 6 Voice App Punchblock AMI FreeSWITCH Logging Plugins Statistics SQL Web Service REST/JSON/XML Carrier APIs Wednesday, 4 September 13
  12. P A G E FREESWITCH GETS MOD_RAYO • mod_rayo developed

    by Chris Rienzo with the sponsorship of Grasshopper • Available in stable 1.2.x releases since 1.2.12 6 Voice App Punchblock AMI FreeSWITCH Logging Plugins Statistics SQL Web Service REST/JSON/XML Carrier APIs Wednesday, 4 September 13
  13. P A G E FREESWITCH GETS MOD_RAYO • mod_rayo developed

    by Chris Rienzo with the sponsorship of Grasshopper • Available in stable 1.2.x releases since 1.2.12 • Provides FreeSWITCH with native support for the Rayo protocol 6 Voice App Punchblock AMI FreeSWITCH Logging Plugins Statistics SQL Web Service REST/JSON/XML Carrier APIs Wednesday, 4 September 13
  14. P A G E FREESWITCH GETS MOD_RAYO • mod_rayo developed

    by Chris Rienzo with the sponsorship of Grasshopper • Available in stable 1.2.x releases since 1.2.12 • Provides FreeSWITCH with native support for the Rayo protocol • Also includes mod_ssml to allow playback of SSML documents using built-in rendering 6 Voice App Punchblock AMI FreeSWITCH Logging Plugins Statistics SQL Web Service REST/JSON/XML Carrier APIs Wednesday, 4 September 13
  15. P A G E FREESWITCH GETS MOD_RAYO • mod_rayo developed

    by Chris Rienzo with the sponsorship of Grasshopper • Available in stable 1.2.x releases since 1.2.12 • Provides FreeSWITCH with native support for the Rayo protocol • Also includes mod_ssml to allow playback of SSML documents using built-in rendering • Accepts direct connections from Rayo clients or can join a Rayo cluster 6 Voice App Punchblock AMI FreeSWITCH Logging Plugins Statistics SQL Web Service REST/JSON/XML Carrier APIs Wednesday, 4 September 13
  16. P A G E GETTING STARTED WITH AHN & FREESWTICH

    <extension name="Adhearsion"> <condition field="destination_number" expression=".*$"> <action application="rayo"/> </condition> </extension> 7 <extension name="Adhearsion"> <condition field="destination_number" expression=".*$"> <action application="park"/> </condition> </extension> Wednesday, 4 September 13
  17. P A G E AHN & FS DEMO USING TELEPHONY

    DEV BOX 8 Wednesday, 4 September 13
  18. P A G E • Background info @ http://rayo.org •

    Experimental spec (XSF) @ http://rayo.org/xep • Source @ http://github.com/rayo/xmpp • Issue queue @ http://github.com/rayo/xmpp/issues 9 Wednesday, 4 September 13
  19. P A G E • Call Control: Incoming calls are

    "offered" to clients at which point they can be answered, rejected, redirected to another destination, etc. Every attempt is made to be shield the Rayo client from the low level telephony protocol (e.g. SIP, Jingle, PSTN, etc.) 10 Wednesday, 4 September 13
  20. P A G E • Call Control: Incoming calls are

    "offered" to clients at which point they can be answered, rejected, redirected to another destination, etc. Every attempt is made to be shield the Rayo client from the low level telephony protocol (e.g. SIP, Jingle, PSTN, etc.) • Audio File Playback: A compatible Rayo server will fetch a file from a a specified URL and play the containing audio to the caller. 10 Wednesday, 4 September 13
  21. P A G E • Call Control: Incoming calls are

    "offered" to clients at which point they can be answered, rejected, redirected to another destination, etc. Every attempt is made to be shield the Rayo client from the low level telephony protocol (e.g. SIP, Jingle, PSTN, etc.) • Audio File Playback: A compatible Rayo server will fetch a file from a a specified URL and play the containing audio to the caller. • Speech Synthesis / TTS: In cases where dynamic data must be spoken, a Speech Synthesis engine many be used to play computer generated speech to the caller. 10 Wednesday, 4 September 13
  22. P A G E • Call Control: Incoming calls are

    "offered" to clients at which point they can be answered, rejected, redirected to another destination, etc. Every attempt is made to be shield the Rayo client from the low level telephony protocol (e.g. SIP, Jingle, PSTN, etc.) • Audio File Playback: A compatible Rayo server will fetch a file from a a specified URL and play the containing audio to the caller. • Speech Synthesis / TTS: In cases where dynamic data must be spoken, a Speech Synthesis engine many be used to play computer generated speech to the caller. • DTMF / Touch-tone Events: Rayo surfaces real-time event when the caller presses keys on their touch-tone keypad. 10 Wednesday, 4 September 13
  23. P A G E • Call Control: Incoming calls are

    "offered" to clients at which point they can be answered, rejected, redirected to another destination, etc. Every attempt is made to be shield the Rayo client from the low level telephony protocol (e.g. SIP, Jingle, PSTN, etc.) • Audio File Playback: A compatible Rayo server will fetch a file from a a specified URL and play the containing audio to the caller. • Speech Synthesis / TTS: In cases where dynamic data must be spoken, a Speech Synthesis engine many be used to play computer generated speech to the caller. • DTMF / Touch-tone Events: Rayo surfaces real-time event when the caller presses keys on their touch-tone keypad. • Speech Recognition: Enables the phone application to take spoken queues allowing for sophisticated voice-driven menus and directory services. 10 Wednesday, 4 September 13
  24. P A G E • Call Control: Incoming calls are

    "offered" to clients at which point they can be answered, rejected, redirected to another destination, etc. Every attempt is made to be shield the Rayo client from the low level telephony protocol (e.g. SIP, Jingle, PSTN, etc.) • Audio File Playback: A compatible Rayo server will fetch a file from a a specified URL and play the containing audio to the caller. • Speech Synthesis / TTS: In cases where dynamic data must be spoken, a Speech Synthesis engine many be used to play computer generated speech to the caller. • DTMF / Touch-tone Events: Rayo surfaces real-time event when the caller presses keys on their touch-tone keypad. • Speech Recognition: Enables the phone application to take spoken queues allowing for sophisticated voice-driven menus and directory services. • Call Recording: Can be used to capture the caller’s voice (e.g. Voicemail) or both sides of the call for auditing and compliance purposes. 10 Wednesday, 4 September 13
  25. P A G E • Call Control: Incoming calls are

    "offered" to clients at which point they can be answered, rejected, redirected to another destination, etc. Every attempt is made to be shield the Rayo client from the low level telephony protocol (e.g. SIP, Jingle, PSTN, etc.) • Audio File Playback: A compatible Rayo server will fetch a file from a a specified URL and play the containing audio to the caller. • Speech Synthesis / TTS: In cases where dynamic data must be spoken, a Speech Synthesis engine many be used to play computer generated speech to the caller. • DTMF / Touch-tone Events: Rayo surfaces real-time event when the caller presses keys on their touch-tone keypad. • Speech Recognition: Enables the phone application to take spoken queues allowing for sophisticated voice-driven menus and directory services. • Call Recording: Can be used to capture the caller’s voice (e.g. Voicemail) or both sides of the call for auditing and compliance purposes. • Mixing: Typically referred to as an audio “conference”; calls can be joined together so that the participants can hear each other in real-time. 10 Wednesday, 4 September 13
  26. P A G E WHY ANOTHER PROTOCOL? • Simple client

    library implementation - XMPP client libraries exist in all modern languages, and many are of a high standard of quality and maturity. 11 Wednesday, 4 September 13
  27. P A G E WHY ANOTHER PROTOCOL? • Simple client

    library implementation - XMPP client libraries exist in all modern languages, and many are of a high standard of quality and maturity. • Cross-platform standard - The protocol must not expose any platform specifics and all elements should be candidates for implementation on any suitable platform. Additionally, the protocol must be ratified as a standard following a community discussion. 11 Wednesday, 4 September 13
  28. P A G E WHY ANOTHER PROTOCOL? • Simple client

    library implementation - XMPP client libraries exist in all modern languages, and many are of a high standard of quality and maturity. • Cross-platform standard - The protocol must not expose any platform specifics and all elements should be candidates for implementation on any suitable platform. Additionally, the protocol must be ratified as a standard following a community discussion. • Asynchronous interface - The protocol should present an asynchronous interface for the purposes of performance and flexibility in performing parallel operations. 11 Wednesday, 4 September 13
  29. P A G E WHY ANOTHER PROTOCOL? • Simple client

    library implementation - XMPP client libraries exist in all modern languages, and many are of a high standard of quality and maturity. • Cross-platform standard - The protocol must not expose any platform specifics and all elements should be candidates for implementation on any suitable platform. Additionally, the protocol must be ratified as a standard following a community discussion. • Asynchronous interface - The protocol should present an asynchronous interface for the purposes of performance and flexibility in performing parallel operations. • Consistent - The protocol must provide a considered, unobtrusive, logically and philosophically consistent interface. 11 Wednesday, 4 September 13
  30. P A G E WHY ANOTHER PROTOCOL? • Simple client

    library implementation - XMPP client libraries exist in all modern languages, and many are of a high standard of quality and maturity. • Cross-platform standard - The protocol must not expose any platform specifics and all elements should be candidates for implementation on any suitable platform. Additionally, the protocol must be ratified as a standard following a community discussion. • Asynchronous interface - The protocol should present an asynchronous interface for the purposes of performance and flexibility in performing parallel operations. • Consistent - The protocol must provide a considered, unobtrusive, logically and philosophically consistent interface. • Federated - The protocol must support communication between client and server entities on separately owned, operated and addressed networks. 11 Wednesday, 4 September 13
  31. P A G E WHY ANOTHER PROTOCOL? • Simple client

    library implementation - XMPP client libraries exist in all modern languages, and many are of a high standard of quality and maturity. • Cross-platform standard - The protocol must not expose any platform specifics and all elements should be candidates for implementation on any suitable platform. Additionally, the protocol must be ratified as a standard following a community discussion. • Asynchronous interface - The protocol should present an asynchronous interface for the purposes of performance and flexibility in performing parallel operations. • Consistent - The protocol must provide a considered, unobtrusive, logically and philosophically consistent interface. • Federated - The protocol must support communication between client and server entities on separately owned, operated and addressed networks. • Flexible routing - The protocol must lend itself to routing across wide networks such as the internet, and to potential complex routing such as proxying or redirection. Additionally, the client and server should each be aware of the presence of the other and be able to use such information to make routing decisions. 11 Wednesday, 4 September 13
  32. P A G E WHY ANOTHER PROTOCOL? • Simple client

    library implementation - XMPP client libraries exist in all modern languages, and many are of a high standard of quality and maturity. • Cross-platform standard - The protocol must not expose any platform specifics and all elements should be candidates for implementation on any suitable platform. Additionally, the protocol must be ratified as a standard following a community discussion. • Asynchronous interface - The protocol should present an asynchronous interface for the purposes of performance and flexibility in performing parallel operations. • Consistent - The protocol must provide a considered, unobtrusive, logically and philosophically consistent interface. • Federated - The protocol must support communication between client and server entities on separately owned, operated and addressed networks. • Flexible routing - The protocol must lend itself to routing across wide networks such as the internet, and to potential complex routing such as proxying or redirection. Additionally, the client and server should each be aware of the presence of the other and be able to use such information to make routing decisions. • Extensible - The protocol must provide for the possibility of extra functionality being added by future specifications or an individual implementation. 11 Wednesday, 4 September 13
  33. P A G E WHY ANOTHER PROTOCOL? • Simple client

    library implementation - XMPP client libraries exist in all modern languages, and many are of a high standard of quality and maturity. • Cross-platform standard - The protocol must not expose any platform specifics and all elements should be candidates for implementation on any suitable platform. Additionally, the protocol must be ratified as a standard following a community discussion. • Asynchronous interface - The protocol should present an asynchronous interface for the purposes of performance and flexibility in performing parallel operations. • Consistent - The protocol must provide a considered, unobtrusive, logically and philosophically consistent interface. • Federated - The protocol must support communication between client and server entities on separately owned, operated and addressed networks. • Flexible routing - The protocol must lend itself to routing across wide networks such as the internet, and to potential complex routing such as proxying or redirection. Additionally, the client and server should each be aware of the presence of the other and be able to use such information to make routing decisions. • Extensible - The protocol must provide for the possibility of extra functionality being added by future specifications or an individual implementation. • Secure - The protocol should include appropriate measures for authentication and authorization of participants, as well as preventing third-parties from intercepting control messages. 11 Wednesday, 4 September 13
  34. P A G E • Primitives: Offer, Accept, Answer, Reject,

    Hangup, Join/Unjoin 12 Wednesday, 4 September 13
  35. P A G E • Primitives: Offer, Accept, Answer, Reject,

    Hangup, Join/Unjoin • Media components: 12 Wednesday, 4 September 13
  36. P A G E • Primitives: Offer, Accept, Answer, Reject,

    Hangup, Join/Unjoin • Media components: • Output (audio playback, text-to-speech) 12 Wednesday, 4 September 13
  37. P A G E • Primitives: Offer, Accept, Answer, Reject,

    Hangup, Join/Unjoin • Media components: • Output (audio playback, text-to-speech) • Input (DTMF, speech recognition) 12 Wednesday, 4 September 13
  38. P A G E • Primitives: Offer, Accept, Answer, Reject,

    Hangup, Join/Unjoin • Media components: • Output (audio playback, text-to-speech) • Input (DTMF, speech recognition) • Prompt (mix of Output & Input) 12 Wednesday, 4 September 13
  39. P A G E • Primitives: Offer, Accept, Answer, Reject,

    Hangup, Join/Unjoin • Media components: • Output (audio playback, text-to-speech) • Input (DTMF, speech recognition) • Prompt (mix of Output & Input) • Record 12 Wednesday, 4 September 13
  40. P A G E • Primitives: Offer, Accept, Answer, Reject,

    Hangup, Join/Unjoin • Media components: • Output (audio playback, text-to-speech) • Input (DTMF, speech recognition) • Prompt (mix of Output & Input) • Record • Currently voice only, but extensible to video 12 Wednesday, 4 September 13