PNR - The black magic behind phone number recognition
By
Peter Kalmström on January 26, 2006 in Developer Blog.
You might have noticed that the Skype Web Toolbars are getting better at recognizing phone numbers in web pages. We have done a lot of work in this area and now we are (almost) ready to share it with the world!
Do you need to recognize or clean up phone numbers to make Skype phone calls? PNR is your friend!
How
The PNR is a standard COM-component that can be called from any programming language that supports such components. If you are in this devzone I am sure you know what I am talking about. A free re-usable component!
What can it do
So far we have seen these major uses for the PNR:
1. Finding phone numbers in text or html. If you supply it with a (long or short) body of text or html it will return a collection of all the phone numbers found in the text.
2. Cleaning up existing phone numbers, making them into proper international dialling numbers.
3. List of countries in 7 languages. If you need to have a list of country names localized (and maybe even grouped by part of the world) the PNR has all that built in.
4. Country Selector dialog - if you want to let the user specify which country he/she is in - the PNR has a nice Skype-blue world map to select the country from.
5. You could actually place it on a web server also - to help you make phone numbers into the proper international dialling format before storing them into a database. The component doesn't have any dependencies so you can basically install it on any machine running Windows. (Yes, we plan to port it also)
Example
Let's say our favorite devzone blogger, Lester has a customer database with phone numbers in it:
1. Customers are mainly in the UK and don't have the country code filled out.
2. Some customers are in other countries and they do have the country field filled out.
3. Phone numbers can be either in local format or in international dialling format (starting with + or 00)
In this scenario Lester can use the PNR to clean up the phone numbers and let his users call via SkypeOut. He would supply the current number for example 0151 5311777 and GB for United Kingdom.
The PNR component would then return +441515311777. This might not look so impressive but consider that the PNR has (correctly) removed the 0. The PNR knows the full list of such city codes prefixes for every country in the world. Also it knows when to remove them and when to leave them in (in Italy for example).
Now all that Lester needs to do, is to add a nice looking Skype icon next to each phone number and make it a nice user-friendly skype:+441515311777 link.

Call to action!
Do you have any kind of application development going on that has phone numbers in it? I am sure this will make adding Skype dialling much easier and more reliable for you. Let us know your progress, or add your tools to the Extras gallery!!
Beta
The current PNR version is still in BETA - along with the Skype Web Toolbars, so there are still some issues and of course, you use it at your own peril. However, it is quite stable and useful, in my opinion.
Where?
If you install one of the Web Toolbars you can find the SPhoneParser.dll under the Skype program files directory.
Links:
Download and try the Skype Web Toolbars
Optimize your own site for Skype Web Toolbars
Nice Skype Buttons








Comments
Nice job!
I know how complicated that can be and I appreciate your efforts a lot. The value in reliable and usable data is huge and I always wished that any system that allowed phone numbers to be stored would force normalisation. Well, that's not the case. That's why such analyzers are required.
Looking forward to see the final versions of the toolbars.
jurgenhaas | Thursday, Jan 26
So when do we PNR as a web service?
evanwolf | Monday, Aug 28
Can this be turned off? It's wreaking havoc by inserting a bunch of code in our clients' web pages. My company developed a CMS for clients that uses a WYSIWYG editor, and Skype *automatically* puts this code in the content editor whenever it finds a phone number and the person editing the content has a Skype window open. This is NOT GOOD.
jenonskype | Thursday, Feb 1
While it is correct in most countries to drop the initial zero in front of the area code, it's not for Italy. Even if you add the country code to it, the zero in front of the area code needs to stay.
Could you please fix this?
fritzschmitz | Saturday, Mar 24
Please tell me how to switch this off .. it is wreaking my web pages!!!!!
ewbimisglobal | Sunday, Dec 9
CAn the phone number formatting be turned off?
dmcclana | Monday, Dec 17
Were there any responses to those who want a way to turn this feature off? I, too, would like for it to go away...
twreeves7378 | Friday, Feb 8
Hi, Peter:
I recognized your name from the error message I get when my IE7 freezes up. Unfortunately IE7 is totally disabled and unable to forward the error report to you. Right now, I'm using Firefox, or I wouldn't be able to post this. I cannot use IE7 without uninstalling Skype. I have updated to the latest version of Skype and done all patches to my WindowsXP SP2 office workstation using Microsoft Update.
Here's the error:
can also see the page, but after loading 3 secs later... I get IE 7 error... IE has encountered a problem and needs to close..."
AppName: iexplorer.exe
AppVer: 7.0.6000.16574
ModName: sphoneparser.dll
ModVer: 1.0.1.157
Offset: 0001dd74
mvalleydave | Wednesday, Feb 13
Hey mate, how do we turn this feature off? Its ruining my html styles cause of it. Its not just happening to me only.
geekmonkey | Thursday, Mar 6
Just to echo what MOST people are asking: how can a site owner disable this rather pointless 'enhancement' when it is defacing our well-crafted web pages?
This behaviour is going to quickly become the norm for anyone with Skype installed, and it is ruining our page designs.
Most users will not understand what is going on, they will simply think that we haven't been doing our job right.
Kindly provide instructions which will allow us to block the unsolicited rewriting of our clients' websites.
fergbyrne | Thursday, Mar 13
All web sites ruined, I think better turn it off for all sites. And who want this future on own site then he just insert same html code that ALLOW skype to change phone number. Respect web design.
polyetilen | Thursday, Apr 10
Okay from messing with the skype options, I discovered nothing...but on the window browser IE 7 you can disable phone number recognition. [prn]
To disable Skype number recognition in IE7:
1. Open browser, go to tools, internet options
2. Select Programs tab at top
3. Click Manage add-ons button at bottom
4. Wait for window to open and populate add-ons
5. KILL!!!! "Skype add-on" (mastermind) [select both and disable]
What if Skype is already installed on all the machines in your company or network already? Copy this info and broadcast email, otherwise you will have to uninstall and reinstall Skype and wait for the window that installs plug-ins to appear and disable it at that stage.
Not sure about Mozilla.
jdavidlopez | Wednesday, Apr 16
Hi Peter,
I want to recognize phone number in my web page when there is no skype installed. So how I can do that? Is there any dll which I have to reference in my web project or there is any other logic which help me to identify the phone number.
Regards,
Imran Ahmad Mughal
imran.ahmad.mughal | Wednesday, Jul 9
Hi Peter,
How do I turn off this PRN for Firefox?
When I look up a person's phone number in www.whitepages.com.au all I can see is the country flag then the area code then nothing more -- because not enough is displayed.
[flag](02...[phone icon]
Maybe a button on the toolbar. Then I can switch it on and off when I need to. Please note that I am not phoning with Skype EVERY time I see a phone number on a webpage!
Bob T
bob_trussler | Saturday, Dec 27
Hi Peter,
in Firefox, I found the Options / Manage Add-ons / then the Add-ons pop-up.
The only option for me is the Disable Skype extension for Firefox 2.2.0.102
This now displays the phone number as simple text.
Is there anything else I should do?
Bob T
bob_trussler | Saturday, Dec 27
thank you, thank you for the info on turning this off in ie7.
darwin.collins | Wednesday, Feb 11
Why does it have to chop off all phone numbers and didn't chop them off even if it is copied & pasted? It would be a lot more useful if there was simply a Skype button next to the number.
It is also rubbish that there is no help listed anywhere to turn this unrequested feature off.
Thank you jdavidlopez for posting how to turn it off!
jonbowers1 | Friday, Feb 27
Skype is really neat, but it has attached itself to every phone number in my computer, this is a drag, it is hard to see phone numbers now. I need to shut this feature off. We can put in the numbers we wish to use Skype for. Who ever thought of this is wrong..I need to get rid of this feature or Skpe all together. Please help.
casey_robertson | Friday, Apr 3
Skype is really neat, but it has attached itself to every phone number in my computer, this is a drag, it is hard to see phone numbers now. I need to shut this feature off. We can put in the numbers we wish to use Skype for. Who ever thought of this is wrong..I need to get rid of this feature or Skpe all together. Please help.
casey_robertson | Friday, Apr 3
Skype is really neat, but it has attached itself to every phone number in my computer, this is a drag, it is hard to see phone numbers now. I need to shut this feature off. We can put in the numbers we wish to use Skype for. Who ever thought of this is wrong..I need to get rid of this feature or Skype all together. Please help.
casey_robertson | Friday, Apr 3
Thank you to jdavidlopez for your helpful instructions for turning off PN.
My view - it should be an option, not default. And switching on/off should be part of the General Settings.
It confused me initially and then was irritating, but it also then made it impossible when I was creating web pages which became a problem.
Rachel
rachelhenley1 | Monday, Jun 1
CSS trick for Web Developers to DISABLE phone number detection by Skype browser addon (e.g. AVOID "Skype Call" buttons):
Just insert invisible <span> inside phone number:
Simple!
sla.80 | Thursday, Jun 18