Skype Journal

Home - Contact Us - Policies - Advertise - About News feed Independently covering the Talk Revolution since 2003

Wednesday, April 8, 2009

Skype Rates and Least Cost Routing

Guest post by Jason Goecke, Adhearsion

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 (i.e. - ‘34′ for Spain, ‘1′ for the US, etc)
  • More granular prefixes where calling rates may differ (i.e. - ‘346′ for Spanish mobiles, ‘336′ for French 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:

    1. require 'rubygems'
    2. require 'open-uri'
    3. require 'nokogiri'
    4. require 'json'
    5. skype_rates = Hash.new
    6. skype_url = 'http://www.skype.com/prices/callrates/#allRatesTab'
    7. skype_htmldoc = Nokogiri::Hpricot(open(skype_url).read) 
    8. (skype_htmldoc/'table.listing//tr.r1').each do |country| 
    9.   country_name = country.at('td').inner_html 
    10.   skype_rates.merge!({ country_name => { 'amount' => country.at('span.amount').inner_html.split('<!')[0].gsub('$ ', '').to_f, 
    11. 'vat' => country.at('span.vat').inner_html.split('<!')[0].gsub('$ ', '').to_f } }) 
    12. end
    13. p skype_rates.to_json 

Which produces JSON output as follows:

    1. "Bolivia-La Paz": { 
    2. "amount":0.122, 
    3. "vat":0.14 
    4.   }, 
    5. "Sweden - Mobile": { 
    6. "amount":0.292, 
    7. "vat":0.336 
    8.   }, 
    9. "Hong Kong": { 
    10. "amount":0.021, 
    11. "vat":0.024 
    12.   } 

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.

tags: , , , , , ,

Call me at +1-510-455-4384, Skype me, follow @skypejournal and @Phil Wolff.
Visit our Skype Journal private roundtable, one of the longest running public Skype chats.

Labels: , , , , , , ,

0 Comments:

Post a Comment

We've started to moderate comments to avoid spam. Please excuse the short delay. We'll get your post online a quickly as possible.

Links to this post:

Create a Link

<< Home