Dial Multiple Phone and SIP Numbers & First to Answer Wins

May 19th, 2010 by Jason Goecke

Courtesy of Mark Hillary

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:

  1. 2 Lines of Code To Enable Calling 1 Phone Number And Ringing Multiple Phone Numbers (like Google Voice)
  2. Meet Phono – Tropo’s Web Phone
  3. Auto-Returning Phone Calls with Tropo
  4. Canadian voice and SMS numbers, improved rate limit, and shortcodes
  5. Dial and SMS your APIs with Tropo

Tags: , , , ,

4 Responses to “Dial Multiple Phone and SIP Numbers & First to Answer Wins”

  1. Tom van der Geer says:

    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?

  2. Adam Kalsey says:

    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.

  3. SHEENA says:

    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

  4. Justin Dupree says:

    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?

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.

Additional comments powered by BackType