title: Can we call a number in middle of a conference call in Twilio?
body: <p>I am new in this field. coming to question. I want to call a number during the conference call and add that participant to the current conference.
  I have tried a sample code for the conference given <a href="https://www.twilio.com/docs/guides/how-to-create-conference-calls-in-java" rel="nofollow noreferrer">here</a> in <strong>Java</strong>. Is there any way to gather the input then call the number and add the participant to the same conference.</p>
  
  <p>here is what I tried. I have created a conference and which will return the following response</p>
  
  <pre><code>&lt;Response&gt;
  &lt;Dial hangupOnStar="true"&gt;
  &lt;Conference startConferenceOnEnter="true" endConferenceOnExit="true"&gt;My Conference&lt;/Conference&gt;
  &lt;/Dial&gt;
  &lt;Gather timeout="10" action="/twilio-tut/add/participant?confName=My%20Conference" finishOnKey="#"&gt;
  &lt;Say&gt;Please enter the number you want to connect followed by hash key.&lt;/Say&gt;&lt;/Gather&gt;
  &lt;/Response&gt;
  </code></pre>
  
  <p>Now One of the participants in conference say <strong>A</strong> press <code>*</code> and dialed a number of another person to whom he wants to add to the conference.</p>
  
  <p>Now on action of <code>Gather</code> verb, I am dialing a number the code as shown below</p>
  
  <pre><code>Number number = 
                      new Number.Builder(some_valid_phone_number)
                      .statusCallback("https://xxxxxxx.ngrok.io/twilio-tut/to/conference")
                      .statusCallbackMethod(Method.POST)
                      .statusCallbackEvents(Arrays.asList(Event.ANSWERED))
                      .build();
  
              Dial dial = new Dial.Builder()
                      .number(number)
                      .conference(new Conference.Builder(conferenceName).build())
                      .build();
  
              twiml = new VoiceResponse.Builder().dial(dial)
                      .build();
  </code></pre>
  
  <p>On statusCallback, I am updating the call to redirect to conference for both caller and callee where caller is the one who left the conference by pressing <code>*</code> i.e. <strong>A</strong> and callee is <strong>some_valid_phone_number</strong>. Code is as shown below</p>
  
  <pre><code>Call callee = Call.updater(callSid)
                      .setUrl("https://xxxxx.ngrok.io/twilio-tut/voice").setMethod(HttpMethod.POST).update();
              Call caller = Call.updater(parentCallSid)
                      .setUrl("https://xxxxx.ngrok.io/twilio-tut/voice").setMethod(HttpMethod.POST).update();
  </code></pre>
  
  <p>above code transfer the callee and disconnect the caller with Exception</p>
  
  <pre><code>com.twilio.exception.ApiException: Call is not in-progress. Cannot redirect.
  </code></pre>
  
  <p>What I want to do is <strong>A</strong> call some other number and finally they will connect to same conference. And <strong>A</strong> should be capable of calling other numbers and add them in same conference. I am using mobile phone to connect the numbers.</p>
  
  <p>Thanks in advance.</p>