4

I am facing a small problem while using Twilio conference.

My API gets incoming call and puts caller to new and empty conference room:

<Response>
    <Dial>
        <Conference waitUrl="http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient">Conf 1</Conference>
    </Dial>
</Response>

So I got caller waiting in an empty conference room and listening music.
I want to dial some other number and to add it to this confrence room.
That number is non-twilio.
How can I do this?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Bogdan Burym
  • 5,482
  • 2
  • 27
  • 46

1 Answers1

11

You could use the Twilio REST API to make an outbound call, and direct that call into your conference room. In PHP this can be done like this:

(This is from the twilio-php helper library)

require('/path/to/twilio-php/Services/Twilio.php');

$client = new Services_Twilio($sid, $token);
$call = $client->account->calls->create(
  'some-twilio-number', // From a valid Twilio number
  'other-number-to-call', // Number to call
  'http://example.com/some_twiml'
);

The URL you use here should serve TwiML that puts the caller into the same room as your original call (exactly as you have in your question). In effect, one person called you, then you called the other person and put them into the same room.

(In the interests of full disclosure, I worked for Twilio.)

xmjw
  • 3,154
  • 21
  • 29
  • Excellent idea! And is there a way to record the conference talk? – Bogdan Burym Apr 23 '13 at 13:54
  • There is a [Twilio FAQ](http://www.twilio.com/help/faq/voice/is-there-a-more-flexible-way-to-record-conference-calls) on this. I think the approach would work for you? Don't forget to set an action="" URL so Twilio knows where to send your recording. You also probably only want to have the record on one of the calls, or you'll be recording it twice! – xmjw Apr 23 '13 at 14:03
  • From android side can i do same using follwoing code? resp.dial(callerId=from_value).client('SOME NUMBER').conference('room name'); Please guide me – Khizar Hayat Aug 17 '16 at 10:42
  • @KhizarHayat did you find a solution on that conference call I have the same problem – Martin May 09 '17 at 06:56
  • @Martin no i am not calling thirdparty from mobile end , my server guy dialing third party . – Khizar Hayat May 09 '17 at 07:00
  • @KhizarHayat I did lot's of search on that problem and every twilio question you where there can I tack 5 min of you time? – Martin May 09 '17 at 07:04
  • I am trying to handle that with the server – Martin May 09 '17 at 07:06
  • What is the exactly issue if you are trying to handle that with the server ? @Martin – Khizar Hayat May 09 '17 at 07:40
  • can you please ping me here @MatinShoaib at twitter – Martin May 09 '17 at 09:41
  • http://stackoverflow.com/questions/43885628/adding-multiple-people-to-a-conference-call-from-caller-twilio/43950460#43950460 @KhizarHayat check this link I found a solution for that – Martin May 13 '17 at 07:37
  • what will be the twiml @xmjw – NomanJaved Feb 23 '21 at 19:25
  • You made my day! I was looking for a way to make an outgoing conference call to an external number and seemed like no one knew, including Twilio support. This is a perfect answer. I would add a TWIML for an argument for create call: twiml: "conference_id" – Dominik Myszkowski Oct 15 '21 at 10:36