I recently found myself at a conference without WIFI and i wanted to write and deploy a new Tropo voice application to the cloud. Armed with my 3g iPad, this task was a snap! See for yourself…
I recently found myself at a conference without WIFI and i wanted to write and deploy a new Tropo voice application to the cloud. Armed with my 3g iPad, this task was a snap! See for yourself…
Have you ever wanted to set a timer on a conference call and pop-in at a certain time to either:
1) announce something, say, every 15 minutes;
2) let participants know that they have 2 minutes remaining; or
3) ask them a question or survey?
This is easy to do by connecting Tropo applications! I created a quick demo using the Tropo Scripting API that allows people to call into a Tropo phone number, SIP address, or Skype address and after x seconds announce that they have two minutes remaining. The demo code below is written in Ruby and it uses threading to start a timer and wait/sleep until x seconds has transpired. Once the timer expires, it calls and conferences a second Tropo application via its SIP address and simply announces the warning message. You could easily extend the second Tropo application to prompt the user to answer a single question or a take a poll/survey and report their answers back to the main application either via a database or via SIP headers on the transfer back to the application.
Here’s the Ruby source code on the main application:
#Method to create timeStamp as our conferenceID
def get_conference_id()
timeVar = Time.new
returnValue = timeVar.strftime("%Y%H%M%S")
return returnValue
end
conferenceOptions={
:mute=>false,
:playTones=>true,
:leaveprompt=>"beep"
}
begin
#Create conference ID
conferenceID = get_conference_id()
log "@"*5 + "User has answered"
#Create second thread for second for timer and announcements
Thread.new do
log "@"*5 + "Start second tread"
sleep 10
call 'sip:9996137086@sip.tropo.com', {
:onAnswer=>lambda{|event|
log "@"*5+"answered join conference"
newCall = event.value
newCall.conference(conferenceID,conferenceOptions)
}
}
end #thread
say 'You are now in conference.'
conference(conferenceID,conferenceOptions)
end
Here’s the Ruby source code of the announcement application:
say "you have two minutes remaining."
Note the SIP address used in the main application. It’s the SIP address assigned to your second announcement application by Tropo when it’s created. Every Tropo application automatically gets a SIP address, iNum address, Skype address, and Phono address assigned to it upon creation. You can transfer and conference calls app-to-app using SIP addresses and even pass data between them using SIP headers. How’s that for webscale?!
We are always excited to see developers using Tropo to extend GoogleVoice functionality and features by adding things like SIP and Call Forwarding and Call-In enhancements. Terry Swanson (@FunnyBoy243) is one of these cool developers who wrote 2 of these extensions and opensourced them for others to share and contribute:
His Call Forwarding Extender Tropo Script includes the following features that extend/add to the current Google Voice feature-set:
You can have this script call multiple SIP/Telephone numbers at the same time by using an array for the CALL_DEST variable. All numbers will ring and the first to answer the call will take the call.
Example: $CALL_DEST = array(“sip:2233486745@sip2sip.info”, “sip:2233486712@sip2sip.info”);
For step by step instructions, check out Terry’s original post here.
His Google Voice Call In Extender Tropo Script includes the following features that extend/add to the current Google Voice feature-set:
Here are some additional tips and tricks with this extension:
For step by step instructions, check out Terry’s original post here.
Hats off to you, Terry! Keep up the good work!
Two members of the Phono/Tropo team, and soon a third member, have recently added new babies to their families. Congratulations Mark, Justin, and John!
All of this excitement got the hacker in me thinking… What would a modern Baby Monitor look like today? Armed with the Phono and Tropo APIs, I started hacking and 2 hours later had the following example application to share with you! Here’s the link to the demo. Let us know what you think! http://phonophone.heroku.com/babymonitor.html
Phono, the jQuery WebPhone from the Tropo team, runs in the web browser to monitor activity in the room where it is running. Tropo is used to manage the baby monitor’s conference room (based on the access code) and the dial-in numbers to listen to the baby monitor via PSTN, Skype, SIP, or iNum. The Phono side of the conference is unmuted so you can hear activity while the Tropo side of the conference is muted. You can have many people (Mom, Dad, Grandparents, etc.) dialed in listening to the same baby monitor using any combination of the access channels listed above.
Check out the Phono Blog to learn more about this demo and see the source code!
At Google I/O last week, Phil Wolff from the Skype Journal interviewed me about Voxeo Labs and Tropo.
In the 5 minute video, I talk about what Tropo is and why it’s a revolutionary platform helping developers build cross channel communications applications.
Here at the secret layers of Tropo Support we often see similar questions raised by our developer base. We pay attention to these trends, since they often indicate that something may be lacking in our documentation. If we do find something is lacking we of course want to address by expanding on concepts or adding additional examples to help shore up our doc sets and help out our developers.
Recently I have started to notice a trend of developers asking how to determine the source of callers dialing into their applications (Skype, PSTN, SIP, or iNum). We’ll since we are often asked this question I figured I would provide a nice Ruby example for the ‘class’ =), I do hope this help!
Regards,
John Dyer
Customer Engineer
Voxeo Support
# -----------
# route based on DNIS
# John Dyer
# Voxeo Support
# -----------
log "@"*10 + $currentCall.inspect # List some headers
log "@"*10 + $currentCall.getHeader("x-voxeo-to") # log to header
module SipRegex
def evaluate_sip_header(header)
case header
when /^<sip:990/ # SKYPE
"SKYPE"
when /<sip:999/ # SIP
"SIP"
when /^<sip:883/ # iNUM
"INUM"
when /<sip:|[1-9]\d\d/ # PSTN
"PSTN"
else
"OTHER"
end
end
end
include SipRegex
toHeader = evaluate_sip_header($currentCall.getHeader("x-voxeo-to"))
if toHeader == 'PSTN'
answer
log "@"*10 + toHeader
hangup
elsif toHeader == 'SKYPE'
answer
log "@"*10 + toHeader
hangup
elsif toHeader == 'SIP'
answer
log "@"*10 + toHeader
hangup
elsif toHeader == 'INUM'
answer
log "@"*10 + toHeader
hangup
elsif toHeader == 'OTHER'
answer
log "@"*10 + toHeader
hangup
else
log "@"*10 + "SOMETHING BAD HAPPENED"
end
As we roll out Tropo for developing voice applications, we’re also looking at ways to connect developers and help them learn about how to better develop applications on the Tropo platform. To that end, we’re offering several options:
Forums
For those familiar with our Evolution developer portal, you’ll know that we offer a large number of web-based forums where developers can post questions and receive answers from Voxeo staff and other developers. We’re offering the same kind of forums for Tropo at:
http://www.tropo.com/forums/
We encourage you all to post your questions there in the various forums.
IRC
For more real-time assistance, we’ve set up a channel, #tropo on irc.freenode.net that you can access via any IRC client. We have also provided a web-based IRC interface that provides easy access to the chat.
Skype Public Chat
Being avid Skype users, we’re also experimenting with a Skype Public Chat related to Tropo. You are welcome to join the public chat (although users of the new Skype 4.0 for Windows are unable to join through links and will need to skype me and have me add you).
In all cases, we’ll have Voxeo folks in the various channels looking forward to helping you learn all about Tropo and how to build voice apps based on the platform.
Please do join with us!
If you found this post interesting or helpful, please consider either subscribing via RSS or following us on Twitter.
©2010 Tropo.com
Brought to you by Voxeo Corporation
Terms and Policies