Dial Multiple Phone and SIP Numbers & First to Answer Wins
May 19th, 2010 by Jason Goecke
In order to support @zlu‘s OpenVoice project release for Google I/O we have introduced a new feature to Tropo that allows you to dial multiple phone numbers at once. Multiple number dialing not only supports phone numbers, but SIP addresses as well. The first endpoint to answer, whether a phone or SIP device, will get the call and your application will move onto the next step in your WebAPI session (coming to scripting soon).
To take advantage of this new feature, the call object in WebAPI now takes an array of addresses (‘tel:’ or ‘sip:’) in the ‘to’ parameter. A Ruby Sinatra example:
%w(rubygems sinatra tropo-webapi-ruby).each { |lib| require lib }
post '/dial-numbers' do
tropo = Tropo::Generator.new do
call :to => [ 'tel:+14155551212', 'tel:+15105551212' ]
say 'Hello, happy you were the first phone to answer!'
end
tropo.response
end
The corresponding JSON that is generated:
{
"tropo":[
{
"call":{
"to":[
"tel:+14155551212",
"tel:+15105551212"
]
}
},
{
"say":[
{
"value":"Hello, happy you were the first phone to answer!"
}
]
}
]
}
Thats it, now of those two numbers the first to pick up will get the phone call. Enjoy!
Related posts:


This is very interesting! I’ve been reading the Tropo documentation with one application in mind which is kind of similar to this example.
For a 24×7 support system we would like to be able to specify a list of phone numbers which are dialed (either simultaneously or in sequence). In order to make sure the call is not aswered by a voicemail system we would like to have a small IVR requesting the callee to press a digit to answer the support call. When one of the callees in the list anwers the call and presses the digit the call is bridged to the caller. Is this possible without (ab)using a conference?
Tom,
Using a conference would be the only reasonable way to accomplish this. The alternative would be for the system to hang up on the callee after they indicated they were around and then transfer the caller to them directly.
So the support guy’s phone would ring, he’d say he was there, hang up, and then it would ring again with the caller on the line.
Otherwise, using a conference would be the way to go.
I have another question to ask. can we make multiple calls from a sip to different numbers?
If not,I have to make an application which makes simultaneous calls to diff numbers at a same time through java code.what is the possible solution for this?
I cant even make 2 diff sipstacks as its identity is its id which will be same for both of my sipstacks(my local host).
Thanks
I’m not sure I follow entirely – your Tropo app can make multiple calls to PSTN numbers or SIP numbers, and an inbound SIP call can be transferred to multiple numbers as well (though as noted in the blog, it’s a “first to answer wins” situation). Could you elaborate a bit?