Introducing Facebook Telephone

October 16th, 2010 by cmatthieu

What would a new platform be without a few new preview applications to demo?  Using Voxeo Lab’s PhonoSDK, we were able create a real telephone integrated with Facebook that allows you to call your Facebook friends online without needing to know their actual phone numbers (and they can call you)!

Try it out today at http://apps.facebook.com/telephone!

Here’s how Facebook Telephone works.  You can direct your Web browser to http://apps.facebook.com/telephone and authorize the application.  Once approved, you can add your phone number privately to the site.  From here you can either “Launch” the telephone to place and receive real phone calls for free to any US or Canadian telephone number.  You can also click on the “Friends with Telephone” to see all of your friends that have also authorized the Facebook Telephone application.  You can call any of these friends by clicking on their photo and confirming your call.

When calling your friends on Facebook, Telephone rings their browser window first provided they have also launched their Facebook Telephone window.  If there is no answer from their browser, Facebook Telephone elevates the call to their real telephone number provided at registration.  This phone number is not visible to the caller.

In addition to placing real outbound telephone calls from Facebook Telephone, you can call any SIP-based VoIP Internet address.  To call another Internet address, simply Launch Facebook Telephone and enter the Internet address in the text box at the top of the softphone in the following format: sip:address@provider.com i.e. sip:chrismatthieu@sip2sip.info to ring Chris’ Blink phone!

Facebook Telephone is a Ruby on Rails (Rails3) application running on Heroku that uses Facebook’s latest Open Graph API to authorize Facebook users and pull in their friend data.  PhonoSDK is embedded in the Rails application and launched as a pop-up window to allow the user to continue using Facebook while maintaining access to the telephone on the desktop.  Since PhonoSDK dynamically creates a new SIP address each time the jQuery object is instantiated, the softphone invokes an AJAX call passing the current softphone’s SIP address back to Facebook Telephone to be temporarily stored in the database.  When another Facebook user calls you, this temporary SIP address is returned as the first “number” to dial as we attempt to establish a browser-to-browser Facebook Telephone call.  If the softphone’s SIP address is not answered by the user, we dial the number on file for that user and bridge the call (browser-to-PSTN).

Facebook Telephone interfaces with Tropo (http://tropo.com) to facilitate the browser-to-PSTN real telephone calls.  The Tropo script to achieve this functionality couldn’t be any easier.  Below is the server-side Javascript code running on Tropo’s Scripting API:

answer();
wait(2000);
say("Please hold while Facebook Telephone connects your call.");
transfer(currentCall.getHeader("x-sbc-numbertodial"), { playvalue: "http://hosting.tropo.com/13539/www/audio/prefetch2.mp3", playrepeat: "5"});

This four line Tropo script basically answers the SIP call from the PhonoSDK and pauses 2 seconds to allow the media to connect.  Next it uses the text-to-speech engine to inform the caller that we are transferring the call.  Finally, we use the Tropo transfer method to pass both the SIP address of the PhonoSDK user to be called along with their telephone number comma delimited in a SIP header called numbertodial.  The Tropo transfer tag will call these numbers sequentially while the MP3 is played to the caller in the background looping up to 5 times.  The first number to answer the call stops the MP3 and connects the call.

Get your free copy of PhonoSDK today at http://phono.com/download.

No related posts.

Tags: , , , ,

Leave a Reply

Please note: By submitting a comment you agree to comply with our Comment Policy. We welcome all comments, positive or negative, but do reserve the right to remove all or part of blog comments that do not comply with our policy.

Additionally, the first time you leave a comment on this blog, it will be held for moderation. After that first comment has been approved, future comments will be posted without delay.