Warheads Stacked in the Kitchen http://goecke.posterous.com Most recent posts at Warheads Stacked in the Kitchen posterous.com Tue, 30 Nov 2010 20:11:00 -0800 Winter in San Carlos http://goecke.posterous.com/test http://goecke.posterous.com/test

P208

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Wed, 22 Jul 2009 17:44:14 -0700 Its official - Adhearsion & Voxeo http://goecke.posterous.com/2009/07/22/its-official-adhearsion-voxeo http://goecke.posterous.com/2009/07/22/its-official-adhearsion-voxeo
Media_httpjsgoeckefil_afilo
Adhearsion is effective in making telephony applications easy to develop. The next phase is to make deployment and scaling of these applications easy while increasing choice of development environments. The first step in accelerating this phase was announced today, Adhearsion and Voxeo Launch Voxeo Labs! It is time to take Adhearsion to the cloud. Some of you that have been following along closely, may already have noticed our involvement with Tropo.com. We worked closely with Voxeo at the inception of Tropo which was subsequently launched at eComm in March of 2009. The goal of Tropo.com is to bring a scalable telephony cloud infrastructure to the broadest group of developers by allowing development directly in dynamic languages. Languages included are: Javascript, Groovy, PHP, Python and Ruby. We will now be focused on bringing Tropo and Adhearsion together to offer the power of Adhearsion with the scale of Tropo, while extending capabilities in the other languages. Jay and I as founding members of Voxeo Labs is no accident. The DNA of Voxeo Labs is a commitment to open-source. Adhearsion will continue to evolve as an open-source framework with continued support for Asterisk along with Tropo and others. Our goal is to provide the widest possible set of deployment choices for the Adhearsion community, while eliminating friction for those who want effortless deployment and scaling. Stay tuned as we have lots of interesting announcements just around the corner. In the meantime, thanks to the entire Adhearsion community for the support that allowed us to pursue this next step.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Fri, 17 Jul 2009 08:29:43 -0700 Adhearsion (アドヒアジョン) & Tropo presentation at Ruby Kaigi - Tokyo 2009 http://goecke.posterous.com/2009/07/17/adhearsion-tropo-presentation-at-ruby-kaigi-tokyo-2009 http://goecke.posterous.com/2009/07/17/adhearsion-tropo-presentation-at-ruby-kaigi-tokyo-2009 I just gave my talk at Ruby Kaigi in Tokyo Japan. The event is well organized and attended. I suppose that is a bit easier since Tokyo is the home of Ruby, and filled with 13 million people. Here are the slides: [slideshare id=1732968&doc=rubykaigijuly2009-tokyojapanese-090716214905-phpapp02]

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Wed, 10 Jun 2009 18:15:59 -0700 Behavior Driven Systems Monitoring for Telephony http://goecke.posterous.com/2009/06/10/behavior-driven-systems-monitoring-for-telephony http://goecke.posterous.com/2009/06/10/behavior-driven-systems-monitoring-for-telephony
Media_httpjsgoeckefil_sclwi
While attending Euruko several weeks ago, I had the opportunity to see @aslak_hellesoy present the Cucumber Behavior Driven Development (BDD) framework. BDD is a part of Agile software development focused on bringing the domain expert into the specification process through the use of natural language. This is done through the users and developers creating a story that is directly parsed by the code for tests. Aslak's presentation was well done, giving some compelling reasons to adhere to BDD principals, showing that using Cucumber made it a joy. Thing is, Cucumber is already a part of testing for  the Adhearsion framework and some specific projects we are working on. What was new to me, was a lightning talk given at the end of the day on Cucumber-Nagios. Cucumber-Nagios is a project developed by @auxesis that bridges Cucumber test results into the Nagios monitoring tool. This allows you to take any test you have written and allow the steps to become part of an on-going systems monitoring strategy. While Cucumber-Nagios is geared towards web application testing, you may use this beyond to test virtually any application. Naturally I have started using Cucumber-Nagios to create a series of tests to do application level monitoring of Adhearsion and Asterisk. This now allows one to not only ensure that these processes are running, but they are working as defined by the BDD specification. To start, I created a couple of features that will connect to Adhearsion and/or Asterisk. Then ping the Asterisk Manager Interface (AMI) looking for a corresponding pong, ensuring the systems are still responsive. The feature to ping the AMI uses the straight forward Gherkin language to create a feature file with the test specification:
Media_httpjsgoeckefil_jvrfe
The feature file is then parsed by the steps definitions as set out in the step file:
Media_httpjsgoeckefil_hewft
The methods called in the step definitions then invoke the system testing library I wrote specifically for these telephony systems. The result is having a standalone test framework that may provide direct input at an application level to Nagios, as well as provide plain English feedback to anyone looking to track down the cause of the problem. First, if Asterisk is down we may see the result of running the Cucumber plain English test:
Media_httpjsgoeckefil_qrwca
Then the corresponding Cucumber-Nagios test that also fails with a 'Critical' error:
Media_httpjsgoeckefil_awucu
Now, if Asterisk is up and all is fine we may see these same tests pass. First, for Cucumber all is green:
Media_httpjsgoeckefil_ifhxa
Then for Cucumber-Nagios we see all 3 tests passed:
Media_httpjsgoeckefil_mbdej
The great thing about this approach is that it may be used to test systems using a standard open source dynamic language like Ruby. These tests are not limited to testing Ruby systems though, as you may see in this case I am testing the Asterisk open source telephony engine. Further, I may test not only the standard interfaces of various systems, but that the behavior of my application deployed within these systems is behaving as required from a specification perspective. This is a powerful approach to systems monitoring and troubleshooting, pulling the system administrators directly into the development process. You may check out my telephony-system-tests project on Github. My plan is to greatly extend this system testing framework over time in order to have a stable of standard tests for Adhearsion, Asterisk, Freeswitch and others in the future. One of the next steps will be to integrate SIPr into the framework for testing SIP dialogs as well. Another interesting item from Euruko that I will be posting about soon is Chef, which was presented by Joshua Sierles of 37Signals at the conference. So much more to come on this front.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Mon, 08 Jun 2009 19:01:12 -0700 Using C#/.Net to Invoke the Adhearsion API via REST http://goecke.posterous.com/2009/06/08/using-c-net-to-invoke-the-adhearsion-api-via-rest http://goecke.posterous.com/2009/06/08/using-c-net-to-invoke-the-adhearsion-api-via-rest Recently an Adhearsion community member, David Lawal, built upon the PHP/REST example I posted back in February. David comes from a C#/.Net background and was beginning to learn Ruby in order to use Adhearsion. Then, in his own words:
"...I needed to leverage 'all the work' done in .Net...As I discovered, the marriage of .Net and Adhearsion was lovely, thanks to the RESTful RPC [API of Adhearsion]"
So David created an example and has graciously shared it with the rest of us. The example includes a component in Adhearsion that has this method extending the 'methods_for :rpc': [sourcecode="ruby"] def launch_call_rpc(vars) ahn_log.ami vars channel = vars["src"] exten = vars["dest"] options = { "Channel" => channel, "Context" => "callback", "Exten" => exten, "Priority" => “1”, "Callerid" => “33333” } result = Adhearsion::VoIP::Asterisk.manager_interface.originate options ahn_log.ami "status: call Queued" ahn_log.ami result end [/sourcecode] Following the full README and example here, this C# code may then be used to invoke the Adhearsion REST API: [sourcecode="csharp"] using System; using System.Collections.Generic; using System.Linq; using System.Text; using JSONSharp; using System.Net; using System.IO; namespace adhearsion {//adhearsion server is http://192.168.1.62:5000 class Program { static void Main(string[] args) { Program.connect(); } static void connect() { try { ahnparams ahn = new ahnparams(); ahn.src = @"SIP/4031234567@192.168.1.200"; ahn.dest = @"7801234567"; //Pass it to our static reflector, which will build JSONReflector jsonReflector = new JSONReflector(ahn); //JSONSharp converts the class to JSON format //Console.WriteLine(jsonReflector.ToString()); NetworkCredential myCred = new NetworkCredential("jicksta", "roflcopterz"); CredentialCache myCache = new CredentialCache(); myCache.Add(new Uri("http://192.168.1.62:5000"), "Basic", myCred); WebRequest request = WebRequest.Create("http://192.168.1.62:5000/launch_call_rpc"); request.Credentials = myCache; string postData = "["+jsonReflector.ToString()+"]"; //had to add the [] for it to work with restful_rpc just like php json Console.WriteLine(postData); request.Method = "POST"; byte[] byteArray = Encoding.UTF8.GetBytes(postData); // Set the ContentType property of the WebRequest. request.ContentType = "application/x-www-form-urlencoded"; // Set the ContentLength property of the WebRequest. request.ContentLength = byteArray.Length; // Get the request stream. Stream dataStream = request.GetRequestStream(); // Write the data to the request stream. dataStream.Write(byteArray, 0, byteArray.Length); // Close the Stream object. dataStream.Close(); WebResponse response = request.GetResponse(); // Display the status. Console.WriteLine(((HttpWebResponse)response).StatusDescription); // Get the stream containing content returned by the server. dataStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader(dataStream); // Read the content. string responseFromServer = reader.ReadToEnd(); // Display the content. Console.WriteLine(responseFromServer); // Clean up the streams. reader.Close(); dataStream.Close(); response.Close(); } catch (Exception e) { throw e; } } } } [/sourcecode] This is a great example of the cross-platform capabilities of Adhearsion that you get for free via REST. You do not have to be a Ruby-ist to take advantage of adding voice capabilities to your web applications. You may use virtually any language and platform that may consume web services. We definitely appreciate it when our community takes the time to share their Adhearsion experiences with the rest of us. Thanks David, and for the rest of you the full example with his README is available here.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Fri, 22 May 2009 01:26:12 -0700 Mashing up Tripit with Adhearsion http://goecke.posterous.com/2009/05/21/mashing-up-tripit-with-adhearsion http://goecke.posterous.com/2009/05/21/mashing-up-tripit-with-adhearsion
Media_httpjsgoeckefil_aoubd
A friend of mine in Barcelona who travels frequently, and runs his own business, recently asked me if he could tie his Tripit location to his business phone routing. Even when he is traveling across the Atlantic, he must be able to provide telephone support to his clients but only based on a reasonable time in the timezone he is in. Of course you could setup routing rules in your phone system each time you move to a new timezone, but good luck remembering to do this. Tripit now makes a blog badge available that reports your current location based on city, state or country:
Media_httpjsgoeckefil_gookd
My Tripit Adhearsion Comonponent on Github allows you to mashup the details from your badge and use them in your dialplan. Now, you may add this component to your project and add something like this to your Adhearsion dialplan: [sourcecode='ruby'] adhearsion { user_time = tripit_user_time?('jdoe') if user_time ahn_log.tripit.debug user_time else ahn_log.tripit.debug 'Error' end } [/sourcecode] You may then use this information to decide whether to dial your mobile at your destination, or send it straight to voicemail. This is a great example of using Adhearsion to mashup data available on the web and use it to control your communications.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Wed, 08 Apr 2009 16:26:17 -0700 Early impressions of Skype for SIP (SfS) http://goecke.posterous.com/2009/04/08/early-impressions-of-skype-for-sip-sfs http://goecke.posterous.com/2009/04/08/early-impressions-of-skype-for-sip-sfs
Media_httpjsgoeckefil_kmnxa
The day has finally come, I have been able to place a SIP call directly to and from the Skype network via a Skype service. I received my Skype for SIP (SfS) closed beta credentials yesterday and immediately set to work configuring endpoints to start making calls. The first step was to use an XLite Softphone to connect to the Skype SIP proxy. Then I graduated to connecting an Asterisk server. While there were some initial issues, Skype worked with the beta testers and had all of the major elements working by the end of the first day. I am impressed by how few issues there actually are, but I guess that is to be expected since this service leverages the same infrastructure behind SkypeOut and SkypeIn. Those services have been around for years and make up some of Skype's core revenue generating business. Here was what I was able to do so far:
  • Asterisk/XLite -> SIP -> SkypeOut -> PSTN (w/G711 codec)
  • PSTN -> SkypeIn -> SIP -> Asterisk/XLite (w/G729 codec)
  • Skype User -> SIP -> Asterisk/XLite
(Note: What I will not be able to try is 'Asterisk/Xlite -> SIP -> Skype User' since this is intentionally blocked by Skype. I presume this is to protect their SkypeIn business by blocking the ability to create a competing alternative.) If you have used the SkypeIn/SkypeOut services before, then you already know the quality of the calling. So far I have not had any issues with the call quality or dropped calls once the kinks were worked out. While Skype is supporting the freely available G711 codec via its SIP gateways, it is dependent on what codecs are supported by the carrier that is being used to terminate a particular call. So while on SkypeOut I was able to use the G711 codec to terminate to numbers in the San Francisco Bay Area (415/650), on SkypeIn to a San Jose number (408) the only available codec was g729. So the reality is, you will need to have a SIP endpoint that supports the licensed G729 codec for reliable use. The current calls are not encrypted. Skype has already stated they intend to support TLS/SRTP in the near future as encryption is considered a core feature for SIP as much as for their P2P calls. As time permits I will be continuing to do more tests as well as contrasting with the Skype for Asterisk (SfA) beta software. Skype is definitely on the right track by opening their network to key standards with multiple interfacing options. I believe Skype is now poised to become a key global player in the business VoIP market, as well as bringing in a broader range of developers. I began to think this day would never come, but it has...

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Tue, 07 Apr 2009 14:41:38 -0700 Adhearsion Website and Sandbox Migration Complete http://goecke.posterous.com/2009/04/07/adhearsion-website-and-sandbox-migration-complete http://goecke.posterous.com/2009/04/07/adhearsion-website-and-sandbox-migration-complete
Media_httpjsgoeckefil_ahqti
Over the last week we have been working to migrate various Adhearsion services to new homes. This could not have come a moment too soon, as during the migration one of the hard drives in our server in Texas gave up the ghost. Of course we used RAID, so we did not miss a beat, but clearly it was time to move along. To this end we have now migrated the Adhearsion website, wiki and API docs to Amazon EC2. Leveraging S3 and EBS we have a great solution that allows us to quickly fire up more servers if and when needed. The cloud is great. We have also moved the Sandbox to a new hosted server.
Media_httpwwwvoxeocom_kchhi
Our friends at Voxeo have provided a great server for us and are now sponsoring the Adhearsion Sandbox. It is great to have a visionary leader in the telephony cloud space involved with the Adhearsion community. I would like to take this opportunity to remind folks what the Adhearsion Sandbox provides. We have provided a hosted system that takes away the need to install your own Asterisk to get started developing Adhearsion applications. Simply install Adhearsion, sign-up for a Sandbox account and get started writing apps. Our goal is to lower all the barriers to make it easy for developers to realize the possibilities of voice in modern web development. Enjoy the new servers!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Fri, 03 Apr 2009 20:41:11 -0700 Click to Call on stage with Sinatra, Rack and Passenger http://goecke.posterous.com/2009/04/03/click-to-call-onstage-with-sinatra-rack-and-passenger http://goecke.posterous.com/2009/04/03/click-to-call-onstage-with-sinatra-rack-and-passenger I have been preparing an Amazon Machine Image (AMI) with Adhearsion, Asterisk and all of the available components installed and pre-configur
Media_httpwwwmodrails_ebioq
ed to be made public soon. For the AMI I decided to get the Sinatra web app included with the Click To Call component up and running as a daemon. I used a combination of Rack and Passenger, since they make the process so easy and production ready. To this end I have updated the README and Click To Call component I covered in my previous blog post to include the how to and Rack configuration file required. To get this up and running do the following:
  • Install the Apache Webserver
  • sudo gem install rack
  • sudo gem install passenger (follow instructions here for compiling the Apache module)
Copy the files and directories in ~ahn-project/components/restful_clicktocall/web directory to the appropriate file system location for your Apache web server. Add these virtual host settings to your Apache configuration (ie - /etc/httpd/conf/httpd.conf): [sourcecode language='php'] ServerName ec2-174-129-89-20.compute-1.amazonaws.com DocumentRoot /var/www/restful_clicktocall_web/public [/sourcecode] Change line three to reflect your configuration. Restart your Apache web server and then connect to the site you configured. For more options I recommend referring to the Passenger documentation found here. Stay tuned for the upcoming Amazon Machine Image!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Wed, 01 Apr 2009 19:27:01 -0700 Skype Rates and Least Cost Routing http://goecke.posterous.com/2009/04/01/skype-rates-and-least-cost-routing http://goecke.posterous.com/2009/04/01/skype-rates-and-least-cost-routing Now that Skype is coming to the enterprise with Skype for Asterisk and Skype for SIP, they will need to enhance the data available for their calling rates. Enabling Least Cost Routing (LCR) is a must for any VoIP provider to the enterprise. LCR allows a phone system to determine, on a call by call basis, which VoIP provider to use based on the best rates associated to the country code or prefix being dialed. As of now Skype publishes a web page of calling rates based on the country name and the per minute rate including or excluding the tax. A few additional items are needed to make this usable for LCR systems:
  • The associated country code for each country (ie - '34' for Spain, '1' for the US, etc)
  • More granular prefixes where calling rates may differ (ie - '346' for Spanish mobiles, '336' for Frech mobiles, '1212' for NYC, '1712' for Iowa, etc)
  • Billing intervals
  • A file download in CSV, or similar format, for import into LCR systems
Of course, in the meantime it is easy enough to scrape the website and convert the available data into a more appropriate format. Here is an example, in Ruby, of how this may be done in a trivial way: [sourcecode language='ruby'] require 'rubygems' require 'open-uri' require 'nokogiri' require 'json' skype_rates = Hash.new skype_url = 'http://www.skype.com/prices/callrates/#allRatesTab' skype_htmldoc = Nokogiri::Hpricot(open(skype_url).read) (skype_htmldoc/'table.listing//tr.r1').each do |country| country_name = country.at('td').inner_html skype_rates.merge!({ country_name => { 'amount' => country.at('span.amount').inner_html.split(' country.at('span.vat').inner_html.split('JSON output as follows: [sourcecode language='javascript'] { "Bolivia-La Paz": { "amount":0.122, "vat":0.14 }, "Sweden - Mobile": { "amount":0.292, "vat":0.336 }, "Hong Kong": { "amount":0.021, "vat":0.024 } } [/sourcecode] You may then perform a Regular Expression against another data source to derive the appropriate country codes/prefixes and store those in your LCR system. A good example of the additional detail needed is provided by Flowroute. I have on my list of actions to create an Adhearsion component to provide LCR capabilities for any Adhearsion application. The plan is to support a wide number of VoIP providers and other data inputs as a part of this plug-in. In the meantime, it will be interesting to see how Skype goes about publishing their rates with additional details and formats for download. UPDATE @JimCanuck points out it is not just about least cost, but also about quality of termination. Skype has some interesting approaches to call quality. More here.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Wed, 01 Apr 2009 14:12:04 -0700 Writing Voice Apps in the Clouds with COBOL http://goecke.posterous.com/2009/04/01/writing-voice-apps-in-the-clouds-with-cobol http://goecke.posterous.com/2009/04/01/writing-voice-apps-in-the-clouds-with-cobol Following on the heels of Voxeo's announcement
Media_httpjsgoeckefil_mysbj
of support for COBOL in their recently released Tropo.com platform, I have put together a script showing how to use this great new feature. Finally, I may use the language that first introduced me to the wonders of computer programming to develop voice apps in the clouds. The first application I participated in writing was a Computer Telephony Integration system using COBOL on HP3000s. This system is still alive and well today and now may be adapted to take advantage of all the clouds have to offer. Considering the codebase has not been touched since 1999, and then only for refactoring, this is a tremendous leap forward. Here is an example to get you started, I will be posting to GitHub shortly: [sourcecode language='delphi'] $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. CallingGrace. AUTHOR. Jason Goecke.
  • Demonstrates the use of Tropo.com
  • for writing voice applications from
  • all the world's systems that use
  • COBOL in the clouds.
DATA DIVISION. WORKING-STORAGE SECTION. 01 MenuStr PIC X(99) VALUE "Please tell us what you would like to know about Grace Hopper.". 01 RetryCntr PIC 9 VALUE ZEROS. 01 MenuOptions PIC X(99) VALUE "war('Where did Grace work?'), bug('Where is that moth?')". 01 MenuResult PIC X(99) VALUE "". 01 SayGoodbye PIC X(99) VALUE "Thank you for calling, goodbye.". 01 PleaseTryAgain PIC X(99) VALUE "Invalid choice, please try again." 01 WarDeptPhone PIC 9999999999 VALUE 7035456700. 01 SmithsonianBugs PIC 9999999999 VALUE 2026331000. LINKAGE SECTION 01 TROPO-PROCEDURES PROCEDURE DIVISION USING TROPO-PROCEDURES. 000-MAINLINE. CALL 'ANSWER'. PERFORM UNTIL RetryCntr = 3 MenuResult = CALL 'ASK' USING MenuStr MenuOptions. IF MenuResult ALPHABETIC PERFORM 200-CALL-DESTINATION. RetryCntr = 3. ELSE CALL 'SAY' USING PleaseTryAgain. ADD 1 TO RetryCntr. END-PERFORM. GO TO 300-EXIT. 200-CALL-DESTINATION. IF MenuResult EQUAL 'war' CALL 'TRANSFER' USING WarDeptPhone. IF MenuResult EQUAL 'bug' CALL 'TRANSFER' USING . 300-EXIT. CALL 'SAY' USING SayGoodbye. CALL 'HANGUP'. STOP RUN. [/sourcecode] It is a fact, there are more lines of COBOL in use in the world today than any other single computer programming language. I applaud the visionary leadership behind Tropo.com siezing this giant opportunity to bring voice from the clouds to all of those systems out there.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Tue, 31 Mar 2009 17:17:50 -0700 VXML Style Voice Form for Adhearsion http://goecke.posterous.com/2009/03/31/vxml-style-voice-form-for-adhearsion http://goecke.posterous.com/2009/03/31/vxml-style-voice-form-for-adhearsion The Adhearsion developer community continues to create new applications and components.
Media_httpjsgoeckefil_ggrvf
And even more importantly, sharing them. The latest component addition to the line-up is a VoiceXML style Voice Form plugin for Adhearsion, created by @adzap and posted to GitHub. You may new create your own compenent, include the Voice Form module and create extensive voice menus to your callers. Here is the classic Adhearison Simon example re-factored into a Voice Form: [sourcecode language='ruby'] class SimonGame include VoiceForm voice_form do setup do @number = '' end field(:attempt, :attempts => 1) do prompt :play => :current_number, :bargein => false, :timeout => 2 setup do @number here. Enjoy and many thanks to @adzap!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Tue, 31 Mar 2009 15:34:56 -0700 Adhearsion Developer Community Writing Apps for America http://goecke.posterous.com/2009/03/31/adhearsion-developer-community-writing-apps-for-america http://goecke.posterous.com/2009/03/31/adhearsion-developer-community-writing-apps-for-america
Media_httpjsgoeckefil_aihwg
@3lsilver (aka lewdsilver) has brought to my attention an application that he and a team built for the Apps for America contest. Apps for America is a contest sponsored by Sunlight Labs, where their moto is 'turning government data into usable information'. Sunlight Labs provides a set of APIs that exposes such information as census data, congressional data and much more. The APIs are intended to power mash-ups to drive government transparency and citizen participation. At least two of the applications submitted to the contest use the combination of Adhearsion and Asterisk. Speak for Change, submitted by @3lsilver and team, allows citizens to leave voicemails for their representatives by calling a toll-free number, then makes these messages public for all to listen to and comment on. The second application, Call Congress, provides a website with a click to call capability to find and then contact your Senators and Representatives. As I have said before, radical transparency is the way forward out of the current US predicament, not excessive regulation. This includes the government and financial markets. It is great to see open source telephony and Adhearsion playing their roles. These applications are great examples of open source making it possible to do things today that would have been prohibitively expensive and difficult before.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Fri, 27 Mar 2009 16:40:44 -0700 Skype for Asterisk DOA, long live Skype for Asterisk! http://goecke.posterous.com/2009/03/27/skype-for-asterisk-doa-long-live-skype-for-asterisk http://goecke.posterous.com/2009/03/27/skype-for-asterisk-doa-long-live-skype-for-asterisk Digium has responded to concerns about the value of Skype for Asterisk (SFA) after the announcement of
Media_httpjsgoeckefil_bubhv
Skype for SIP (SFS) last Monday. I would like to state for the record that I did not declare SFA dead, but raised the question. It is indisputable that the value of SFA is diminshed in light of the announcement of SFS, therein lies the opportunity to push for deeper integration to regain that ground. In the 'Voice On The Web - Skype in Your Business' public Skype chat, Skype did correct two items in the Digium post:
  • SFA can handle incoming Skype calls from any user on the Skype network.  SFS can receive incoming calls from Skype users only by statically mapping a Skype name to a SIP account.
  • SFA supports incoming calls directly from SkypeIn DID numbers.  SFS does not.
These are not differentiators unique to SFA, as they may both be done in SFA and SFS. With this correction we are left with four differentiators:
  • SFA can place calls to any user on the Skype network.  SFS cannot place calls to Skype users.
  • SFA includes support for Skype presence information.  SFS has no support for presence.
  • SFA includes buddy list management.  SFS has no buddy list management features.
  • SFA supports multiple media codecs including G.711 aLaw and uLaw as well as G.729.  Wide-band audio will be available in a near-term revision.  SFS supports only compressed telephony-grade G.729 media streams.
There is value here, which I have highlighted before. But the number of use cases where I now need SFA is signifcantly reduced now that SFS will be availalbe. The reason is that Asterisk of course supports SIP, so I may now use SFS to handle all inbound calls, and use SFA in the specific cases needed. For example, one channel license may provide all of the presence updates I need. The biggest advantage, SIP -> Skype User calls, may or may not be needed for your use cases, and if so maybe at a reduced number of channels now that you have SFS and may have a hybrid solution. Voxeo had the equivalent of SFS for a while now and hummed along happily providing useful applications. The point is not to declare SFA dead, but to highlight these points in the hopes that the opportunities for deeper integration and the associated benefits are clear. For SFA to overshadow the SFS announcement, I contend these features are needed:
  • Two-way chat via the Manager API
  • Extended presence support
  • SILK-codec support, which would require end-points (ie - SIP soft phones/hardware phones) embedding SILK
I understand that Digum and Skype need to get SFA to market, but a clear roadmap of what comes next and the timing would be immensly useful as developers look to place their bets. I applaud the work that Skype and Digium have been doing and the opening of the Skype network on multiple fronts. I just hope this is an opportunity to open the Skype network that little bit more. *UPDATE* Digium has changed their list of differentiators in the blog post, and have replaced one of the incorrect items with this one:
  • SFA calls are encrypted from end-to-end while SFS calls are delivered to the SFS endpoint devices (PBX) as unencrypted RTP streams.
This will be a short lived one, as while the SFS beta will be UDP/RTP, Skype have already committed to TLS/TCP and SRTP. So SFS will have the same ability for encrypted communications as SFA does.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Mon, 23 Mar 2009 16:55:44 -0700 Skype for SIP == Skype for Asterisk DOA? http://goecke.posterous.com/2009/03/23/skype-for-sip-skype-for-asterisk-doa http://goecke.posterous.com/2009/03/23/skype-for-sip-skype-for-asterisk-doa Today Skype announced Skype for SIP (SFS). Put simply, enterprise telephone systems may now interconnect with the
Media_httpjsgoeckefil_ahcau
Skype network to receive calls from the Skype network and place calls to SkypeOut. All without the need to install any special hardware or software on most modern enterprise phone systems (IP-PBXs to be more specific). Skype's new enterprise targeted connectivity uses SIP, the industry standard for VoIP interconnection. SIP already powers the bulk of Skype's revenue, via SkypeIn/SkypeOut, so this is a logical progression to take advantage of the large scale infrastructure already in place at Skype. This is a tremendous move by Skype and one I have contended for years was necessary for them to make headway in the enterprise. I applaud this step. There are plenty of great posts out there covering this already, including the one by @danyork on Disruptive Telephony. What does this mean for Skype for Asterisk (SFA) announced last September? At best the value of SFA has been signficantly reduced by this announcement. Previously SIP interconnection to the Skype cloud was given to the rarified group of larger players such as Voxeo, Tellme, Genesys and others. SFA was the first time this access was going to be brought to the world of open source telephony developers through Asterisk. This provided an immense opportunity for the Asterisk developer community to create new applications to take advantage of this, which lead me to invest time to participate in the closed beta for SFA still underway. The SFS announcement this morning has just marginalized SFA to applications that benefit from direct dialing of Skype users from Asterisk and from basic presence updates from the Skype network. Gone are the benefits of providing Skype/SkypeIn inbound calls to the enterprise, SkypeOut trunking, etc. More so, SFA is at a disadvantage since you will have to pay a per channel (simultaneous call) license fee on top of any SkypeIn/SkypeOut costs. Further, I suspect that the number of SFA channels available to a single account will be limited for the same reason that SFS does not do SIP to Skype dialing, so that no one may provide large scale alternatives to SkypeIn. All of this has really taken the wind out of the SFA sails before it even had a chance to make it to a public beta. Digium must now look to quickly add new features. Such as advanced presence information, instant messaging, the SILK codec and others, if they hope to salvage their own investment in the development of SFA to date. While I understand these things take time, the lethargy of getting the SFA to market does not bode well for rapidly trumping the SFS announcement. Time will tell.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Mon, 16 Mar 2009 20:57:48 -0700 Three new ways to access the Adhearsion Sandbox http://goecke.posterous.com/2009/03/16/three-new-ways-to-access-the-adhearsion-sandbox http://goecke.posterous.com/2009/03/16/three-new-ways-to-access-the-adhearsion-sandbox Since the launch of the new Adhearsion website earlier this year we have made a Getting Started Sandbox available to developers. We want everyone to easily give Adhearsion a try without having to setup an entire telephone system to do so. All you need to do is install Adhearsion (and maybe Ruby, depending on which operating system you use) and you may immediately begin using our free Sandbox in the cloud. Here are the new access methods that we have recently added (more details are available on the Getting Started page here):
Media_httpapiphonefro_hbgns
Phonefromhere has a Java IAX2 client that is a great way to access the Sandbox from the internet. Tim Panton of Phonefromhere has graciously made his hosted system available to us. Check out their app, as I am sure you will find it useful for your new Adhearsion applications as you roll them out.
Media_httpaboutskypec_pbyat
We have been participating in the Skype for Asterisk (SFA) closed beta. We have already developed the Skype Utils Adhearsion component that I mentioned in a previous blog post and will be making available as part of the Sandbox soon. In the meantime you may use Skype to access the Sandbox to get a preview of how you may easily develop apps for the Skype world leveraging Adhearsion and Asterisk.
Media_httpwwwvoxbonec_wovce
Voxbone has kindly donated a 10 channel inbound phone number for use with the Adhearsion Sandbox. So now you may simply use any old telephone to test your Adhearsion applications on the Sandbox infrastructure. Enjoy!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Sat, 14 Mar 2009 04:52:43 -0700 Skype for Asterisk component for Adhearsion http://goecke.posterous.com/2009/03/13/skype-for-asterisk-component-for-adhearsion http://goecke.posterous.com/2009/03/13/skype-for-asterisk-component-for-adhearsion After having more time to work in detail with the Skype for Asterisk (SFA) channel in closed beta, I have developed an Adhearsion component to ease my development and testing efforts. Hopefully this will ease yours in the near future when the public beta becomes available.
Media_httpjsgoeckefil_fcqix
The Skype Utils component provides a few features to take advantage of what this new channel brings to the Asterisk platform. First, the component provides a single method call to access a wealth of information in your dialplan that is delivered with each Skype call. This type of information is unheard of on any other channel available to Asterisk (let alone telecoms in general), this information includes:
  • skype_languages - A space-separated list of language identifiers (ie - es, en, etc)
  • skype_topic - A user-provided string that can identify the 'topic' of the call
  • skype_token - Similar to skype_topic
  • skype_about - 'about' profile entry
  • skype_birthday - Birthday
  • skype_gender - Gender
  • skype_homepage - Home page URL
  • skype_homephone - Home phone number
  • skype_officephone - Office phone number
  • skype_mobilephone - Mobile phone number
  • skype_city - City name
  • skype_province - State/Province name
  • skype_country - Country name
The next feature that the component provides is the ability to map Skype usernames with Asterisk extensions. Typically Asterisk is used with phones that require you to enter a numeric phone number when dialing someone. Of course most Skype names are usernames that have nothing to do with a phone number. With this component you may enter the relationship between an extension number and a Skype username in  database with a Ruby on Rails web interface. Then when calls are made to and from the Skype network you have a seamless translation between the two.
Media_httpjsgoeckefil_faoba
Last (so far), but not least, is the ability to track Skype presence information. The SFA channel allows you to add 'buddies' to your Asterisk/Skype username. Once this has been done, you are then able to obtain status updates from each of the buddies on your list. The component then allows you to track these status updates and access them in your dialplan. The status updates may be persisted to a database or kept in memory. Further, those status updates are not only available to your dialplan but to the REST, DRb and STOMP APIs of Adhearsion, making them available to virtually any program. With this you may track if each Skype user is in one of the following states:
  • Online - user is online
  • Skype Me - user is available and asking to be 'Skyped'
  • Away - the user is away from their Skype client
  • Not Available - the user is not available for a call
  • Do Not Disturb - the user does not want to be disturbed
  • Offline (Voicemail Enabled) - the user is offline and has voicemail
  • Offline (Voicemail Disabled) - the user is offline and has no voicemail
Stay tuned for example applications that will build upon this component. In the meantime do not hesitate to have a look at the code and details here. I would also like to thank @steely_glint and Todd Gould, fellow beta team members, for their assistance in constructing an environment where all the pieces could work. Great progress is being made on the SFA beta code, but of course there are still some quirks.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Thu, 12 Mar 2009 04:44:29 -0700 GrandCentral Becomes Google Voice http://goecke.posterous.com/2009/03/11/grandcentral-becomes-google-voice http://goecke.posterous.com/2009/03/11/grandcentral-becomes-google-voice
Media_httpjsgoeckefil_fgtfh
As a follow up to my previous post on the subject, it would appear that the re-release of GrandCentral is imminent. The service is now Google Voice and is accepting sign-ups to be notified when it is available here. I am anxious to see the new features that will accompany this re-launch... In the meantime get a taste here.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Tue, 10 Mar 2009 16:24:17 -0700 May 2009 Speaking Schedule http://goecke.posterous.com/2009/03/10/may-2009-speaking-schedule http://goecke.posterous.com/2009/03/10/may-2009-speaking-schedule Early May will be a busy month for Jay and I on the speaking circuit. We have three engagements in three countries so we are dividing and conquering.
Media_httpjsgoeckefil_ydars
Railsconf 2009 - May 4th through May 7th, 2009 Las Vegas, NV - USA Speaker: Jay Phillips
Media_httpjsgoeckefil_icbon
Amoocon - May 4th through May 6th, 2009 Rockstock Germany Speaker: Jason Goecke
Media_httpjsgoeckefil_jadch
EuRuKo - May 9th through May 10th, 2009 Barcelona Spain Speaker: Jason Goecke

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke
Mon, 09 Mar 2009 23:18:11 -0700 Using Adhearsion and Asterisk with the Tropo cloud http://goecke.posterous.com/2009/03/09/using-adhearsion-and-asterisk-with-the-tropo-cloud http://goecke.posterous.com/2009/03/09/using-adhearsion-and-asterisk-with-the-tropo-cloud

You have written a great Adhearsion application and now you want to add some fancy Speech Synthesis or Speech Recognition. Your best option has been to acquire software to install on your Asterisk server. While there are open source applications available, such as Festival and Sphinx, they take a fair amount of know-how and work to tune, and then still may not perform as you hope. There are also some great commercial applications out there such as Cepstral and Lumenvox, but they require an upfront investment and add additional overhead to your Asterisk server. What if you could just obtain these services from the cloud and pay as you go?

Media_httpjsgoeckefil_xmxgt

Now you can. Tropo was announced last week at eComm as dicussed in my previous post from the conference. Since we had the opportunity to work with the folks at Voxeo on the launch of Tropo, integration to Adhearsion is available for the initial release. This integration allows you to invoke services from the Tropo cloud as needed in your Adhearsion dialplan, obtain the results and then continue on in your dialplan. This means industry leading Speech Recognition and Speech Synthesis on a per minute basis with no need to install any third party engines may now be added to your Adhearsion app. How it works The initial release of Tropo is the first step allowing interoperability with Adhearsion. We are continuing to work with the folks at Tropo on their future Remote API to provide a more robust integration. In the meantime the integration works as follows:
  1. A call comes into your local Asterisk and Adhearsion dialplan
  2. Your dialplan decides it needs to create a menu to obtain results from the caller using Speech Recognition
  3. The diaplan invokes the dialplan method 'tropo' (provided by the Tropo component) passing the text and options menu for Tropo to use
  4. Adhearsion creates a GUID via the new_guid method to track the session, then instructs Asterisk to create a dynamic conference, dropping the caller into the conference
  5. Adhearsion then places a SIP call, with the caller id set to the session GUID, to Tropo dropping that call into the same dynamic conference the caller is in
  6. Tropo queries Adhearsion for the instructions using the session GUID, does its thing with the caller, returning the results via DRb (note: REST support is coming soon) to Adhearsion and then hangs up
  7. Adhearsion redirects the caller out of the conference and back into the dialplan, taking action based on the result returned from Tropo
HowTo The first step is to create your Tropo account and application as described in my previous post. In this case, you will load the file 'adhearsion_drb.rb' available from the Tropo documentation site. My recommendation is to use the built in Tropo hosting service and let them run this script from their servers. You will then need to change the following line (number 9) in the script to reflect the hostname where your Adhearsion application/DRb server will be running: [sourcecode language='ruby'] Adhearsion = DRbObject.new_with_uri druby://yourhost.net:9050' [/sourcecode] While on the Tropo application page take note of the SIP URI to contact your app, as this will be needed for the Adhearsion Tropo component configuration later. The next step is to compile and install the Asterisk 'app_conference' add-on to your local Asterisk server. We generally use app_conference as it performs better than the built-in MeetMe application and is easier to install on a virtualization platform such as Amazon EC2 or VMWare. Next, enter the following contexts into your Asterisk dialplan (/etc/asterisk/extensions.conf) to provide the contexts needed to interact with your Tropo-enabled Adhearsion application: [sourcecode language='ruby'] ;This is the context that you ;should initially send your call to [adhearsion] exten = _X.,1,AGI(agi://localhost) exten = _X.,n,Hangup [send_to_tropo] exten = s,1,AGI(agi://localhost) exten = s,n,Hangup [after_tropo] exten = s,1,AGI(agi://localhost) exten = s,n,Hangup [/sourcecode] Next, create your Adhearsion application as follows: [sourcecode language='ruby'] myhost ~ # ahn create myshinyapp create create components/simon_game create components/disabled/stomp_gateway create components/disabled/sandbox create components/ami_remote create components/disabled/restful_rpc/spec create config create .ahnrc create components/simon_game/simon_game.rb create components/ami_remote/ami_remote.rb create components/disabled/stomp_gateway/stomp_gateway.rb create components/disabled/stomp_gateway/stomp_gateway.yml create components/disabled/stomp_gateway/README.markdown create components/disabled/restful_rpc/restful_rpc.rb create components/disabled/restful_rpc/restful_rpc.yml create components/disabled/restful_rpc/README.markdown create components/disabled/restful_rpc/example-client.rb create components/disabled/restful_rpc/spec/restful_rpc_spec.rb create components/disabled/sandbox/sandbox.yml create components/disabled/sandbox/sandbox.rb create config/startup.rb create dialplan.rb create events.rb create README create Rakefile [/sourcecode] Edit the configuration of Adhearsion (~myshinyapp/config/startup.rb). First, enable the Asterisk Manager Interface configuration to connect Adhearsion to Asterisk. Second, enable DRb connections from the localhost as well as the Tropo cloud (all Tropo connection requests should come from 66.193.54.21). [sourcecode language='ruby'] config.asterisk.enable_ami :host => "127.0.0.1", :username => "admin", :password => "password", :events => true config.enable_drb :host => "0.0.0.0", :deny => "0.0.0.0", :allow => ["127.0.0.1", "66.193.54.21"] [/sourcecode] Then, clone the Tropo Adhearsion component from Github in your project's component folder (~myshinyapp/components) as follows: [sourcecode language='ruby'] git clone git://github.com/jsgoecke/tropo.git [/sourcecode] Next, edit the Tropo component configuration file (~myshinyapp/components/tropo/tropo.yml) to include the configuration from your Tropo account replacing 'sip_uri' with your SIP URI from your application page on Tropo: [sourcecode language='ruby'] #The address for your Tropo account sip_uri: SIP/9999999999@sip.voxeo.net timeout: 10 contexts: #Context to send the originate to bring Tropo into the conference send_to_tropo: send_to_tropo #Context to send the call after Tropo processing after_tropo: after_tropo [/sourcecode] And last, but not least, you may use this Adhearsion diaplan (~myshinyapp/dialplan.rb) to test your Tropo integration: [sourcecode language='ruby'] adhearsion { #The options build the choices and menus based on the Tropo API, all #Tropo capabilities may be used by passing them instructions via the #options hash options = { :choices => "[5 DIGITS]", :repeat => 3, :timeout => 7, :onBadChoice => 'Invalid entry, please try again.', :onTimeout => 'Timeout, please try again.' , :onChoice => err log '============>' + err + 'Passing Instructions to Tropo In the dialplan.rb example above you may see that the options hash is built a little differently from the example in my previous post. Since Ruby lambdas may not be serialized and sent over the wire with DRb (look to MagLev for this), we use strings and a heredoc to pass the instructions to Tropo for event handlers. The adhearsion_drb.rb script running on Tropo will then do an eval on those strings to pass in the code for the anonymous methods. Other than this difference, you may pass options to Tropo from Adhearsion with all of the same capabilities as you would with Ruby natively on Tropo. Summary While this approach is a bit of a hack, it does work and shows the power of obtaining cloud services on demand with Adhearsion. Stay tuned as we work with Tropo to provide a deeper and more comprehensive integration with their upcoming Remote API. Please do not hesitate to drop into the Adhearsion IRC channel (#adhearsion on irc.freenode.net) or the Adhearsion mailing list with questions or input.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/883038/photo.jpeg http://posterous.com/users/Ztolo9RHwlP Jason Goecke jsgoecke Jason Goecke