u:p:
Extreme Support > Support Forums

  TICKET INFORMATION
Ticket Home  >  All Tropo Scripting - PHP Development  >  #1432094 - Opening Multiple Sessions to Call Multiple RecipientsSearch
Author/Date
Account Ticket #1432094:  Opening Multiple Sessions to Call Multiple Recipients
Owned by:  sulee11
sulee11

Posted on:
5/15/2011 9:06 PM (EDT)
Hi, I have been trying to create a script to call multiple recipients using the WebAPI.
For each person contacted, the call should not hang up until the specific person picks up or rejects it.

After reading this thread,https://www.tropo.com/bizblog/viewer?&bb-name=tropo_support&bb-q=multiple+sessions+webapi&&bb-cid=155&bb-tid=1395824#bb,
I am under the impression that this could be possible if I simply manipulate the Session object to create a new session each time I generate the json code to send to one recipient. And say, if I wish to make 800 individual calls to recipients, I would just have to loop around the code and create 800 new sessions.

This is what I have so far, and my code would always only call the first person of the array...

<?php   
ini_set('display_errors', 1);

require 'tropo.class.php';

$calls = array("+11111111111","+12222222222");
$tropo = array();
$counter = 0;
$session = array();
foreach ($calls as $key)
{
$session[$counter] = new Session();
$tropo[$counter] = new Tropo();
$tropo[$counter]->call($key);
$tropo[$counter]->say("Hi, how are you?");

$tropo[$counter]->RenderJson();
$counter++;
}

?> 


Thanks for your help,
Sulee11
voxeoadam

Posted on:
5/16/2011 1:03 AM (EDT)
Hello,

Thanks for contacting our Voxeo support team!

Yes, you should be able to call multiple recipients using the WebAPI. For it the call destination numbers can be placed to the "to" attribute of "call" function with comma separated. For more you can refer below doc:

https://www.tropo.com/docs/webapi/call.htm

In the meantime, if there is any other questions that we can further help just feel free to let us know.

Regards
Adam Kong
Voxeo Support
Tropo News: http://blog.tropo.com/ | @Tropo
Change log: http://changes.tropo.com/ | @TropoChanges
Service status announcements: http://status.tropo.com/
sulee11

Posted on:
5/16/2011 10:09 AM (EDT)
Hi Adam,

Thanks for the response.

I have already tried calling multiple people using an array in the call() method before, but once one person picks up the call and hangs up, the call also hangs up for all the other recipients.

Is there any way to prevent that from happening?

Thanks,
Sulee11
voxeoTonyT

Posted on:
5/16/2011 1:50 PM (EDT)
Hello,

It seems like you want to have a tropo application place multiple outbound calls and then conference them in.  Is this correct?  If yes then unfortunately you could not do this with one tropo application you would essentially have to have a tropo application for each outbound call you want to make and then place them into the conference. 

Let me know if I have misunderstood your intentions and we would gladly provide you with more assistance.  In the meanwhile if there is anything else we can assist you with please let us know.

Regards,

Tony Taveras
Customer Engineer
Voxeo Support
sulee11

Posted on:
5/16/2011 2:02 PM (EDT)
Hi Tony,

I simply want to make multiple calls - not necessarily to conference them in.
But once one person takes the call and hangs up, I don't want all the other calls that I have made to also hang up, which seems to be the case if I were to simply plug an array with all the numbers I want to contact into the call method.


Thanks,
Sulee11
voxeoJeffK

Posted on:
5/16/2011 5:24 PM (EDT)
Hello,

You would be best served to use the RestAPI to spawn an individual session for each call, passing in the number to be dialed:

  https://www.tropo.com/docs/rest/rest_tutorials.htm#session_tutorials

This insures you have a separate execution context for each call. This will cause each call session to be completely separate from others. This also takes advantage of our failover mechanisms. Should a network problem occur, then having one session generate multiple calls will cause all of the calls to fail. Separate sessions allows for routing around failures.

regards,
Jeff Kustermann
Voxeo Support
sulee11

Posted on:
5/17/2011 3:41 PM (EDT)
Hi Jeff,

Thanks for the suggestion to use the RESTAPI. I have succeeded in using a script to spawn multiple sessions to make multiple calls.

However, for each additional session that I wish to spawn, the script also seems to take longer to load. I am looking to make a call to around 800 people, and I believe that making the session spawn loop around 800 times would take ages.

Is there any way to do this process faster?

Thanks,
Sulee11
smorgan

Posted on:
5/17/2011 5:29 PM (EDT)
Hello Sulee,

The delays you are seeing are due to the load you are placing on our development environment.  It is not designed to handle 800 simultaneous calls in rapid fire as you are doing.  For that sort of load your application would need to run in our production environment.  Do you have an idea of how quickly you want all 800 calls placed and how long each call is expected to last?

Regards,

Steven Morgan
Voxeo Labs
sulee11

Posted on:
5/17/2011 6:49 PM (EDT)
Hi Steven,

I wouldn't want to switch away from the development environment if not needed, but would be glad to use the production environment if it could significantly speed up the calling process.

For each call, I only wish to say something and hang up right afterwards, so it should take no longer than 10 seconds.

In total, I am hoping that the process of calling the 800 people take less than 2.5 minutes before everyone receives it.

Thanks for helping out,
Sulee11
MattHenry

Posted on:
5/17/2011 7:33 PM (EDT)


Hello Sulee,

Call concurrency of this magnitude, implies commercial usage, and this is NOT something that we would consider supporting without the calls being paid for: Our development environment is not at all intended to be used for a cost-free commercial solution for developers to make money on, as I'm sure you can understand, and to this effect, I'd like to ask that you refrain from sending additional calls until we can sort out what we can do to help you with your nee4ds, and how we can collect revenue.

To move things along, I think the best step to take at this juncture would be to contact [email protected], and they can help on all fronts: Please let me know if you have any further questions.

Regards,

~Matthew Henry


sulee11

Posted on:
5/17/2011 7:53 PM (EDT)
Hi Matthew,

Thus far, I have only been using the system for testing purposes.
Later in the month, I plan to use the system to send bulk calls, as you have noted.
If need be, I will be glad to pay for the service.

The question is simply whether I can call everyone in time, because that is my top priority here. I am well aware that the development environment is for non-commercial usage only.


Sulee11
MattHenry

Posted on:
5/19/2011 1:22 PM (EDT)


Hello Sulee,

Thank you for your reply. I'd again suggest that the best way to proceed with ensuring that we can meet your concurrency demands is by contacting [email protected] so that we can get a better feel for your real-world business case as a precursory step to providing you with the levels of service that you require.

If you need any technical assistance in the meantime, please feel free to log a new account ticket with us so that we can help.

Regards,

~Matthew Henry
shobhitsahay007

Posted on:
8/17/2011 6:31 AM (EDT)
Hi,

In earlier posts you wrote,

"It seems like you want to have a tropo application place multiple outbound calls and then conference them in.  Is this correct?  If yes then unfortunately you could not do this with one tropo application you would essentially have to have a tropo application for each outbound call you want to make and then place them into the conference.".

Can we (say A) make two outbound calls (to X and Y) and bridge them together such that all the
three( X, Y and A) can hear each other. We can't make X and Y to call A.

If not, as you mentioned earlier can we do with two tropo applications? How?


Thanks,

Shobhit
kbond

Posted on:
8/18/2011 2:33 PM (EDT)
Hello Shobhit,

You are able to connect two calls that you make into a conference. Using php webAPI, I made a little sample of how this would be done.


<?php

include 'tropo-webapi-php/tropo.class.php';

$session = new Session();
$tropo = new Tropo();

$phoneNumber = $session->getParameters("numberToDial");
$tropo->call('+1'.$phoneNumber);

$tropo->say("Welcome, You are about to enter conference call 1, 2, 3, 4...Thank you!");
$tropo->conference(null, array("name"=>"conference", "id" => "1234"));

return $tropo->RenderJson();

?>


This app will rely on using the REST-API which will be launched by using this url:

https://api.tropo.com/1.0/sessions?action=create&token=THE_APP_TOKEN&numberToDial=12345678


Since you are using php, you can apply this url via cURL request. An example of that can be found here.

To test this, you can actually drop that url into the web browser. If you put this into the browser two different times with two different phone numbers, the two calls should be connected into the conference.

On a side note, I am not sure what you want to do with this functionality but 200 is the capacity of a conference. However, if you just want to join a couple of people, you should be fine.

I hope this helps and if you have any other questions, please don't hesitate to ask.

Regards,

Kevin Bond
Voxeo Labs