Page 270 - Asterisk™: The Future of Telephony
P. 270

• Ruby can execute a command inside backticks and return the result as a String.
                   We report the uptime here with it.

               This example of course assumes that you have configured your application’s database
               integration properly and have an Employee class mapping to a table with an exten
               sion and full_name column.
               Because  Micromenus  simply  render  varying  responses  over  HTTP,  a  normal  web
               browser can make a request to the Micromenus’ server, too. For these more high-tech
               endpoints, Micromenus render an attractive interface with Ajax loading, DHTML ef-
               fects, and draggable windows.
               In the interest of “adhering” people together, Micromenus exist as another option to
               make your Adhearsion VoIP applications more robust.

               Integrating with a Web Application

               Though Adhearsion by design can integrate with virtually any application, including
               PHP or Java Servlets, Ruby on Rails makes for a particularly powerful partner. Rails is
               a web development framework getting a lot of press lately for all the right reasons. Its
               developers use Ruby to its full potential, showing how meta-programming really does
               eliminate unnecessary developer work. Rails’ remarkable code clarity and application
               of the Don’t Repeat Yourself (DRY) principle served as a strong inspiration to the in-
               ception of Adhearsion as it exists today.

               Starting with Adhearsion version 0.8.0, Adhearsion’s application directory drops in
               place atop an existing Rails application, sharing data automatically. If you have needs
               to develop a complex web interface to VoIP functionality, consider this deadly duo.


               Using Java
               Eyebrows around the world raised when Sun announced their hiring of the two core
               developers of the JRuby interpreter project, Charles Nutter and Thomas Enebo, in
               September 2006. JRuby is a Ruby interpreter written in Java instead of C. Because JRuby
               can compile parts of a Ruby application to Java bytecode, JRuby is actually outper-
               forming the C implementation of Ruby 1.8 in many different benchmarks and promises
               to outperform Ruby 1.8 in all cases in the near future.
               A Ruby application running in JRuby has the full benefit of not only Ruby libraries but
               any Java library as well. Running Adhearsion in JRuby brings the dumbfounding as-
               sortment  of  third-party  Java  libraries  to  PBX  dialplan  writing.  If  your  corporate
               environment requires tight integration with other Java technologies, embedding Ad-
               hearsion in a J2EE stack may offer the flexibility needed.








               242 | Chapter 10: Asterisk Manager Interface (AMI) and Adhearsion
   265   266   267   268   269   270   271   272   273   274   275