2

I had read Twilio documentation about call transfer twilioDoc, StackOverflow and a lot of other stuff related to call transfer too. What I had tried is:

Step 1. Dial Call from web browser to phone number via javascript params. (call working fine)

params = {
    "PhoneNumber": number,
    "CallerId": "+1863201xxxx",
    "AgentName": "admin",
    
};
var connection = Twilio.Device.connect(params);

Step 2. Click the call transfer button and point it to the conference twiml

$conferenceId = $_REQUEST['callsid'];
$statusCallbackUrl = "https://example.net/Welcome/conference_control";
<Response>
    <Dial> 
        <Conference beep="false" statusCallback="<?php echo $statusCallbackUrl; ?>" 
          statusCallbackEvent="start end join leave mute hold" endConferenceOnExit="true" 
          startConferenceOnEnter="true"> 
            <?php echo $conferenceId; ?>
        </Conference>
    </Dial>
</Response>

Note: conferenceId is callID, the call already connected to the client

Step 3. I dial a participant to dial a conference

$participant = $twilio->conferences($_REQUEST['callsid'])
    ->participants
    ->create($caller_id, "+9230641xxx55"); 
// caller_id is the agent:admin (web client) and the phone number

The call rings to the phone number when he picks only the music plays.

Twilio conference call has only 1 participant don't know why? Why the first active call not converted to a conference call, if not possible then how it will be?

NomanJaved
  • 1,324
  • 17
  • 32
  • @philnash can you look into it. – NomanJaved Feb 25 '21 at 10:13
  • Further define: Step 2. Click the call transfer button and point it to the conference twiml. What transfer button? You need to make a REST API call to modify a call in progress, you can't just use TwiML by itself. – Alan Feb 25 '21 at 13:14
  • @Alan how can I update a call to a conference? – NomanJaved Feb 25 '21 at 13:59
  • You modify the call and point it to new TwiML to add it to the conference - https://www.twilio.com/docs/voice/tutorials/how-to-modify-calls-in-progress. If the call is already communicating with another party, you are better off starting the call in a conference to begin with, so the other leg doesn't drop when you modify the call. – Alan Feb 25 '21 at 14:57
  • @Alan You mean I dial the first call, in the beginning, it should start in the conference and if need to transfer then can easily transfer without dropping (add new participant)? Will the agent and phone number will be able to communicate via this conference method as these two are only in the call??? – NomanJaved Feb 25 '21 at 15:23
  • @Alan can you share an example how can i make simple call to a conference call? – NomanJaved Feb 25 '21 at 16:09

0 Answers0