Its official – Adhearsion & Voxeo

2009 July 22

Picture 1Adhearsion 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.

Adhearsion (アドヒアジョン) & Tropo presentation at Ruby Kaigi – Tokyo 2009

2009 July 17

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:

Behavior Driven Systems Monitoring for Telephony

2009 June 10

CucumberLogo

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.

read more…

Using C#/.Net to Invoke the Adhearsion API via REST

2009 June 8
by jasongoecke

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’:

read more…

Mashing up Tripit with Adhearsion

2009 May 21
by jasongoecke

Picture 3A 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:

Picture 2My 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:

adhearsion {
  user_time = tripit_user_time?('jdoe')
  if user_time
    ahn_log.tripit.debug user_time
  else
    ahn_log.tripit.debug 'Error'
  end
}

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.

Early impressions of Skype for SIP (SfS)

2009 April 8

125251152_618186f502The 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…

Adhearsion Website and Sandbox Migration Complete

2009 April 7

sandbox1Over 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. 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!

Click to Call on stage with Sinatra, Rack and Passenger

2009 April 3

I have been preparing an Amazon Machine Image (AMI) with Adhearsion, Asterisk and all of the available components installed and pre-configured 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):

<VirtualHost *:80>
  ServerName ec2-174-129-89-20.compute-1.amazonaws.com
  DocumentRoot /var/www/restful_clicktocall_web/public
</VirtualHost>

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!

Skype Rates and Least Cost Routing

2009 April 1

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:

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('<!')[0].gsub('$ ', '').to_f,
                                         'vat' => country.at('span.vat').inner_html.split('<!')[0].gsub('$ ', '').to_f } })
end

p skype_rates.to_json

Which produces JSON output as follows:

{
  "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
  }
}

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.

Writing Voice Apps in the Clouds with COBOL

2009 April 1
by jasongoecke

Following on the heels of Voxeo’s announcement h96920kof 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:

      $ SET SOURCEFORMAT"FREE"
IDENTIFICATION DIVISION.
PROGRAM-ID.  CallingGrace.
AUTHOR.  Jason Goecke.
<ul>
  <li>Demonstrates the use of Tropo.com</li>
<li>for writing voice applications from</li>
<li>all the world's systems that use</li>
<li>COBOL in the clouds.</li>
</ul>

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.

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.