Skype Rates and Least Cost Routing

img

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: 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. tags: skype, lcr, cost, routing, asterisk, adhearsion, voipCall 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.

Fuente original

Comments are closed.