Posts Tagged ‘Tropo’

Tropo Drinkup San Francisco

Wednesday, January 25th, 2012

Join us Friday January 27th for our Tropo Drinkup in San Francisco at our SOMA headquarters office and enjoy some complimentary drinks while entertained by future rockstars letting loose on our piano and guitars.

We like to get our happy hours on early so be ready to break some New Year’s resolutions with us at 3:58pm.  Yep, 3:58pm.  Because two minutes can make the world of a difference for your weekend.

End your work week early and shimmy by the Tropo office for some beers, bites and a lil’ rock jam session if you are so inclined.

Tropo Drinkup San Francisco

When: Friday January 27th

Where: 28 2nd Street 3rd Floor San Francisco, CA 94123

Time: 3:58pm- 6:00pm

Meet Phono – Tropo’s Web Phone

Monday, January 23rd, 2012

Have you heard about Phono, our open source Javascript Phone API project?

Phono is a free HTML5 jQuery-based web phone that you can add to any web page to place or receive open SIP-based VoIP calls to/from any web browser (or iOS/Android mobile device using Phono Mobile)!

Phono can be connected to Tropo to place or receive phone calls to/from real telephone numbers! Phono can also interact with Tropo voice applications directly from a web page using Tropo’s speech recognition and text-to-speech in 24 languages as well as record and play media such as WAV or MP3 files or conduct conference calls, call transfers, call recording, etc.

To make things even better, Phono and Tropo both support SIP headers which are basically key/value pairs of data that you can sent along with calls. SIP headers are very common in call center applications and enterprise screen-pop implementations. Using SIP headers allows Phono to place a call into a Tropo application and pass along data instructing Tropo to transfer the call to another telephone number. This is how all of the click-to-call demo applications work on phono.com. These demo applications are also limited to 10 minutes in length so that you can experience the quality of a Phono call and write your own Tropo application for longer calls.

Because we have had a few questions lately on this topic, I wanted to provide some sample code for both Phono and Tropo to make this easier for you to apply to your application. This demo application allows you to enter a phone number on a web page and call it using Phono and Tropo. The web page has a simple form that asks for a phone number and has a call button that initiates a SIP VoIP call to Tropo app:9996182316. Reviewing the Phono code below, you will find that it uses jQuery to pass the phone number value in the textbox to Tropo as a SIP header.

<html>
  <head>
    <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
    <script src="http://s.phono.com/releases/0.3/jquery.phono.js"></script>
  </head>
  <body>
	<input id="phonenumber" type="text">
    <input id="call" type="button" disabled="true" value="Loading..." />
    <span id="status"></span>
    <script>
    $(document).ready(function(){
      var phono = $.phono({
        apiKey: "your secret key",
        onReady: function() {
          $("#call").attr("disabled", false).val("Call");
        }
      });

      $("#call").click(function() {
        $("#call").attr("disabled", true).val("Busy");
        phono.phone.dial("app:9996182316", {
		  	headers: [
			             {
			               name:"x-numbertodial",
			               value:$('#phonenumber').val()
			             }
			           ],
          onRing: function() {
            $("#status").html("Ringing");
          },
          onAnswer: function() {
            $("#status").html("Answered");
          },
          onHangup: function() {
            $("#call").attr("disabled", false).val("Call");
            $("#status").html("Hungup");
          }
        });
      });
    })
    </script>
  </body>
</html>

You could write a Tropo transfer application using the Scripting API in one line of Ruby code that transfers the call to the phone number in the SIP header like this:

transfer $currentCall.getHeader("x-numbertodial")

What if you wanted to add a timer that ends the call after 10 minutes like we do on phono.com for demo purposes? This feature is also simple but it requires multithreading your Ruby application and using our REST API for sending a signal to interrupt the transfer method once your timer reaches its alarm.

require "net/http"

# Create second thread for timer and announcements
Thread.new do
  sleep 600 # Note: Sleep is in seconds so 600 = 10 minutes

  http = Net::HTTP.new "api.tropo.com"

  request = Net::HTTP::Get.new "/1.0/sessions/#{$currentCall.sessionId}/signals?action=signal&value=limitreached"
  response = http.request request
end

say "hold please while we transfer your call."
transfer $currentCall.getHeader("x-numbertodial"), :allowsignals => "limitreached"
say "your limit has been reached."

That’s cool but what if you wanted to block certain phone numbers or limit the demo calls to North America? You could add area codes or phone numbers to a regex array and check the desired phone number against the list of regexes to see if you should allow the call to transfer or not like this example:

phone = $currentCall.getHeader "x-numbertodial"

# Blocked North American area codes
blocked = [
  /^\+?1?8[024]9/,
  /^\+?1?26[48]/,
  /^\+?1?24[26]/,
  /^\+?1?34[05]/,
  /^\+?1?[62]84/,
  /^\+?1?67[10]/,
  /^\+?1?78[47]/,
  /^\+?1?8[024]9/,
  /^\+?1?86[89]/,
  /^\+?1?441/,
  /^\+?1?473/,
  /^\+?1?664/,
  /^\+?1?649/,
  /^\+?1?721/,
  /^\+?1?758/,
  /^\+?1?767/,
  /^\+?1?876/,
  /^\+?1?939/
]

block_call = blocked.any? { |x| phone =~ x }

You could add this code immediately above your transfer and add a conditional statement that says something like this example:

if block_call
  say "calls to this area code are blocked."
else
  say "hold please while we transfer your call."
  transfer phone, :allowsignals => "limitreached"
  say "your limit has been reached."
end

You could also add billing functionality to the Tropo script by applying a rate based on country code and multiply it times the number of seconds that the call was in progress. To accomplish this goal, you would add a timestamp at the beginning of the script and a timestamp directly following the transfer method. When either party hangs up, the Tropo script will continue running with the line immediately following the blocked method such as transfer in this case.

If necessary, you could also check to see if the Phono caller is still on the call by interrogating the $currentCall.isActive property or by wrapping your entire application in a while loop like this example:

while $currentCall.isActive
  # Do Stuff
end

I think that should get you started! You can now build your next-generation click-to-call application using Phono and Tropo! Please let us know how you are using Phono with your Tropo applications :)

Voice Texting With Tropo Speech & SMS Technology

Wednesday, December 21st, 2011

We all agree that texting while driving is very dangerous, right? Fred Wilson, VC and principal of Union Square Ventures thinks so too. He recently wrote a blog post that starts like this:

“As a parent of two young adult drivers and a third soon to hit the road, nothing scares me more than texting while driving.”

Fred continued his blog post envisioning a Voice Texting application as follows:

“Being an engineer at heart and by training, I’ve been looking for a solution to the problem. I know that the buzz of the phone and the unread/unresponded message is like a drug to many and that the best solution would be a “hands free” way to read and respond. And the bluetooth/hands free voice solution works so well on most cars and most phones now, so why can’t we do the same with texting?”

Having two kids of my own (1 already driving and 1 studying for a drivers permit) and having access to the Tropo API and platform, I felt compelled to build a quick Voice Texting application to share with Fred Wilson! Here is what Fred had to say upon me sharing it with him…

Here is how it works:

To send a text, call (415) 349-3120 and using Tropo speech recognition say the phone number that you would like to text and then speak your message. Tropo then transcribes the message and sends your text message to phone number you spoke without taking your eyes or hands off the road.

Disclaimer: We are not promoting texting while driving even with the proper tools that would keep your eyes on the road such as a bluetooth earpiece and autodial features.

The source code for this project is written in Ruby and open sourced on GitHub in case anyone would like to extend it or perhaps even create a new business around this idea and have a head start! Here’s a video of me demonstrating the technology in action:

Drive safely!

Tropo Customer Spotlight: Babelverse

Tuesday, December 20th, 2011

Babelverse founders Mayel de Borniol and Josef Dunne were working out of the Tropo HQ office in San Francisco when they received the call that they had been accepted to compete among 15 other startups in the Le Web 2011 Startup Competition.

With over 600 applicants and only two weeks to prepare for the competition in Paris, France, we were able to sit down with them over a few beers and discuss their game plan to win, their experience in the San Francisco and Silicon Valley for the first time, being a part of the  Start-Up Chile Program and how they used Tropo for Crisis Response to help victims of the Japan Earthquake in March 2011.

Our Babelverse boys won 3rd place in the Le Web 2011 Startup Competition and we couldn’t be more proud.  Clearly their motto of including alcoholic beverages to help their inspiration and creativity along with their faith in always somehow being in the right place at the right time helped them win in Paris.  Congratulations!

WebPulp.TV Interviews Tropo

Tuesday, December 20th, 2011

Jose de Castro, our Chief Architect, was recently interviewed by Josh Owens from WebPulp.TV on the interworkings of Tropo’s Webscale cloud communications platform.

Topics covered include:

  • scripting languages (ruby, python, php, groovy, and javascript)
  • scaling our data centers and APIs
  • message queues (rabbitMQ and activeMQ)
  • media server technology
  • VoIP and SIP QoS
  • redundant telco carriers and networks
  • speech recognition and text-to-speech in 24 languages
  • human vs. answering machine detection
  • virtualization
  • using DNS as key value stores
  • splunk logging
  • sponsorship of adhearsion, the ruby telephony framework
  • rayo, Voxeo Labs’ new realtime communication protocol

Webpulp.tv – Tropo – Jose De Castro from Gaslight Software on Vimeo.

Tropo SMS Wolfram Alpha Mashup

Tuesday, December 13th, 2011

Tim Strimple joined us at the LA Holiday Hackathon to get in on the competition of building Tropo applications for prizes and won a $50 Tropo Production credit for his Tropo SMS and Wolfram Alpha mashup!

You can ask the application virtually any question via SMS using the following phone number 661-206-2681 and it responds to your inquiry via SMS using Wolfram Alpha’s search results. Here’s a video of Tim demonstrating his application in action!

Here’s the code behind Tim’s Tropo SMS Wolfram Alpha mashup! It’s written in PHP and uses the Tropo Scripting API.

<?php  

function CheckForShortcut($request)
{
    if(stripos($request, "siri") !== false)
    {
        return "I don't like to talk about her.";
    }

    if(stripos($request, "remind") !== false)
    {
        return "I am not your personal assistant.";
    }

    if(stripos($request, "tropo") !== false)
    {
        return "Tropo is great, I love it!";
    }

	return false;
}

function ParseResponse($response)
{	
	//	Replace with real XML parsing
	$min = strpos($response, "</plaintext>");    
	$startPos = strpos($response, "<plaintext>", $min) + 11;
    $endPos = strpos($response, "</plaintext>", $startPos);
	$length =  $endPos - $startPos;

	if($min > 0)
	{
		return substr($response, $startPos, $length);	
	}
	else
	{
		return "Go ask Siri...";
	}
}

function GetResults($request)
{
    $shortcut = CheckForShortcut($request);

    if($shortcut)
    {
        return $shortcut;
    }

    $request = str_replace (" ", "%20",$request);
	$wolframApiKey = "XXXXXX-XXXXXXXXXX";
    $url = "http://api.wolframalpha.com/v2/query?appid=" . $wolframApiKey . "&input=" . $request;
    $response = file_get_contents($url);

	return ParseResponse($response);
}

if($currentCall->channel == "TEXT")
{
    $result = GetResults($currentCall->initialText);
    say($result);
}
else
{
    say("I do not support voice currently. Try sending me a text message instead.");
}
?>

Happy Hacking!

LA Holiday Hackathon :: Results

Monday, December 12th, 2011

Approximately 30 Los Angeles .NET, Ruby, PHP, and Javascript developers attended this Saturday’s LA Holiday Hackathon at Outlook Amusements sponsored by RightNow Technologies and Tropo. The theme of the event consisted of building a Voice, SMS, or Instant Messaging holiday application based on the Tropo Scripting or Web API. Here is a photo of everyone hard at work hacking on their holiday Tropo application.

I love the sound of phones ringing in the morning! By noon, the applications were starting to take shape with some definite front runners in the competition. In addition to Tropo APIs, many of the teams also used Phono, SMSified, RightNow, Wolfram Alpha, and Google’s Shopping APIs to deliver their new applications.

Here are the winners of the LA Holiday Hackathon listed in order:

First place goes to Gift Finder winning an iPad2 compliments of RightNow Technologies. This application allows the user to enter a phone number, name, and email address to place an outbound call to someone to recommend gifts for loved ones. Speech recognition was used to ask the user for their zip code, gender, price range range, and category of the gift. The application uses the Google Shopping API to find gifts in their area for the gender and age of the recipient and reads them off one by one using text to speech. This application was built using Ruby and Sinatra and hosted on Heroku as well as using the Javascript Tropo Scripting API.

Second place goes to Santa’s Book winning a Kindle Fire compliments of RightNow Technologies. This application asks for two phone numbers and starts by calling the first number to ask a series of five questions using speech recognition to determine if the person is naughty or nice along with asking them to record the present that they would like to receive. The application proceeds to call the second number to relay the naughty/nice determination and playback their gift recording. The application also sends an SMS text message to the second number with the naughty/nice determination along with the transcribed gift request. This application also used RightNow’s CRM API to log the call and data related to the surveys. This application was built using PHP and the Tropo WebAPI along with RightNow’s CRM API.

Third place goes to Santa Hack winning a $75 Fry’s Electronics gift card compliments of Outlook Amusements. This application used Phono and Tropo to schedule and bridge appointments to speak with Santa. This application was built using C# and the Tropo WebAPI.

Fourth place goes to Tropo WA (Wolfram Alpha) winning a $50 Tropo production credit. This application was a Wolfram Alpha and Tropo SMS mashup written in PHP using the Tropo Scripting API. You can ask the application various questions via SMS on the following number 661-206-2681.

Tropo + Ushahidi = Awesome

Friday, December 9th, 2011

Ushahidi is a platform for crowdsourcing information. Members of the public submit reports that are geo-located and then put on a map. The platform is used in disaster relief, election monitoring and just about any other situation where people need to learn things from one another quickly and concisely. Out of the box, Ushahidi allows people to submit reports via the web, mobile applications, Twitter, Facebook with support for a few SMS APIs as well.

We have created an easy-to-use application that lets people use Tropo to input data into Ushahidi via SMS. We’ve put the code up on Github and you’re welcome to submit pull requests if you find bugs or add features.

To use the code, you don’t have to install anything on Ushahidi. Here are the steps:

  1. In Ushahidi, create a user with “Admin” privileges.
  2. check out the code from Github
  3. edit the configuration lines at the top with your Ushahidi credentials and URL
  4. create a new Scripting API Application on Tropo.com.
  5. Once your Tropo app is created, you can add an SMS-enabled number (US and Canada currently) and optionally configure it to talk on any IM networks or Twitter.

Now, when you send a message to any of your configured numbers the application will attempt to geo-locate the message based on its contents. The app then submits a report via the Ushahidi API in an unverified state. Admins of the site can then verify the reports and publish them to the web.

In our example here, we simulated a flood in Milwaukee. The instance pulls in feeds from local media and disaster response community, accepts reports via the web and accepts reports from a Tropo app I created. We sent a message to the number configured in the app with the following content:

 

Columbia St. Mary’s Hospital Milwaukee WI is flooded. Power is out.

This was submitted to Ushahidi in an unverified state. The reviewer then added text to flush out the report based on other incoming data and then published the report:

Columbia hospital has been without power for the past 16 hours. Two of the three emergency diesel generators are operating normally. Generator number 2 is scheduled to be functional within the next 6 hours. Fuel supplies are at nominal levels with an estimated 48 hours remaining. Inundation levels are currently low but may begin rising at high tide.

This sort of crowdsourced data, gathered at the source, is valuable for many reasons. It gets the word to responders and the public more quickly so that people can act appropriately (e.g. by not going to that hospital, go to another one.) First responders become aware of the weight of a problem when more people report the same thing or when the first report comes in of a very big event.

Watervoices.ca, developed this past weekend at RHoK, will be going live with this application soon and we hope to see others using it to help the world soon. Over time, we will be adding support for Voice, PhoneGap within Ushahidi and many other features.

The People’s Skype for the #Occupy Movement

Monday, December 5th, 2011

This is a guest blog post by Jonathan Baldwin showcasing an application that he wrote using Tropo called The People’s Skype. It’s phone-powered, distributed voice and voting system for the #Occupy Movement!

As the Occupy Wall Street movement grew in popularity at Zucotti Park in NYC, and other occupations in North America, Jonathan noticed a problem with the primary method occupiers used to communicate in large groups. The People’s Mic, a method of augmenting a speaker’s voice by having listeners repeat their words, didn’t scale up when huge numbers of people attended rallies and General Assemblies. In these cases, the audience had to repeat the speaker’s words multiple times before it reached the far edges of the crowd – it became gradually harder to understand the original speaker’s words the further you are from the inner circle.

Motivated by this, Jonathan was determined to find a simple solution that anyone had access to. There were similar talks amongst the OWS Tech groups about ways to solve this problem, but those ideas never panned out (they included handheld radios and VoIP systems). He also wanted to address another problem of General Assemblies – hand signals are used to communicate consensus with ideas. In a massive crowd, it is hard to express opinion through visual cues, so he wanted to integrate this problem into a one package solution.

Thus, Jonathan created a one-way conference call solution, called The People’s Skype, through the Tropo phone system. Using PHP, MongoDB and Tropo, he created a simple interface that anyone with any kind of phone, no matter how old, could dial in and create a unique mic with. Upon mic creation, the speaker is given a 4 digit PIN to distribute to others that want to listen in (by holding up a sign or word of mouth). Anyone can call to the original number and listen by typing the unique PIN. Only the speaker is able to talk, while listeners can vote on issues by using their dial-tone, phone keypad (1 for Yes, 0 for No, etc.).

As the Tropo conference call system is able to support hundreds of people, audience members can either turn their speakerphones on to create a distributed PA system, or listen directly on their handsets. Due to the applications flexibility, it could potentially help fragmented occupiers communicate across police barriers or kettled areas.

Try out The People’s Skype yourself: http://www.peoplesskype.org! You can also download a copy of Jonathan’s source code from Github.

Customer Spotlight: Speak2Leads

Friday, November 18th, 2011

We are proud to feature Speak2Leads on this week’s Tropo Customer Spotlight. I sat down with Sammy James, the Founder and CEO of Speak2Leads, to discuss their business and how they are using Tropo (and Phono).

You have probably heard the old proverb, “the early bird catches the worm”. This phrase was first recorded in John Ray’s A collection of English proverbs from the 17th century. The saying holds true for the first person to speak with a lead.

Speak2Leads’ technology is perfect for connecting the right lead with the right agent over the phone and the right time. Neither party needs to dial the other. Once a web form is submitted or a document is opened, Speak2Leads can place two calls and bridge the two together in a matter of seconds!

Sammy and his team continue to iterate on new features coming to Speak2Leads that improve both customer experience and lead closing rates. Their new feature in the works is a proactive voice call (similar to a proactive chat but better). Using Phono, our Javascript Phone API, an agent will receive a call if someone sits on a webpage for a given amount of time. If the agent would like to speak to the person on their website, an incoming phone call to the webpage is placed allowing the viewer to answer or reject the call for help. I am eagerly looking forward for this amazing idea to launch!

To learn more about Speak2Leads, visit their website at http://speak2leads.com.