user3931314
user3931314

Reputation: 119

Twilio Queue turn into a conference call to add new client's to the call

Having a live twilio infrastructure where I have agents and clients. Client call the twilio number and are enqueued . Once the user is enqueued he the client waits for an agent. On my server a cron job calls all available agents with a twilio number on the server side using php twilio helper library

calls->create(...)

and after the agents pick up they are asked to answer the clients call by pressing any number. Agent is then connected with to client.

This is how the system is and should not be changed. Can't make big changes on this code.

My problem is that I need to add members to a call with an ios application that I'm developing.

Or rather the specification is that the client can in someway while connecting to the agent, and while in the call with the agent can in someway add another client(friend) to the call with that agent.

Can this be achieved. I know about adding members to a conference call. As i said the code can't be changed, that's on the website. I am developing a ios client app for the client's easier access to the service and the serer backend(Twiml and Php).

Is there a workaround, maybe once the agent and client are connected in a queue i can redirect them somehow to a call. Maybe on connection i can transfer them out of the queue with the REST API and put them into a conference call.

Upvotes: 1

Views: 801

Answers (1)

philnash
philnash

Reputation: 73027

Twilio developer evangelist here.

If you need to get more people into the one call, then you are going to need to send them into a <Conference> somehow.

If you can get hold of the Call Sids of the two calls (inbound from the caller and outbound to the agent) then you can indeed redirect them into a conference by updating the live calls. You'd do this with the REST API and it would look a bit like this:

$sid = "your_account_sid"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

$call = $client->account->calls->get("CALL_SID");
$call->update(array(
    "Url" => "http://example.com/your_conference_handler"
));

The URL you supply would return the TwiML to start the <Conference>.

Let me know if that helps at all.

Upvotes: 0

Related Questions