title: Can you use the Dial and Gather verbs together in Twilio?
body: <p>I'm building an app where I have Twilio make a call, 'gather' the response from the callee and keep calling my backend because of the <code>&lt;Gather&gt;</code>.</p>
  
  <p>However, I also want to be on the call live to hear what's happening in realtime. I was wondering if I can do this by using the Dial verb in conjunction.</p>
  
  <p>This is what my flow looks like:</p>
  
  <ol>
  <li>Twilio calls my server to get TwiML for a call it just made</li>
  <li>Server returns a <code>&lt;Gather&gt;</code> response</li>
  <li>Twilio calls server again with the data it 'gathered'</li>
  <li>Server returns another <code>&lt;Gather&gt;</code> in response
  ...and so on.</li>
  </ol>
  
  <p>This is what I'm trying to do:</p>
  
  <ol>
  <li>(NEW:) I use webhooks to dial into a conference call 'C1'</li>
  <li>Twilio calls server to get TwiML for a call it just made</li>
  <li>Server returns a <code>&lt;Dial&gt;</code> followed by the gather  response as earlier. I wanted the <code>&lt;Dial&gt;</code> to put the active call in the same conference C1 that I've already joined from another phone so I can listen to what's happening on the call.</li>
  <li>Twilio calls server again with the data it 'gathered'</li>
  <li>Server returns another <code>&lt;Gather&gt;</code> in response
  ...and so on.</li>
  </ol>
  
  <p>So, what I'm trying to do here is to be on the conference before any of this happens so I can listen to Twilio interact with callee. </p>
  
  <p>But looks if I try to append <code>&lt;Gather&gt;</code> to a <code>&lt;Dial&gt;</code> in a TwiML response, Twilio doesn't start 'gathering' from the conference call, but instead, waits for the conference call to finish first and only then execute the 'gather'.</p>
  
  <p>PS: The closest approximation to what I want to do is set the record flag on beforehand when Twilio makes the call to the callee, and then listen to the entire conversation later to figure what happened but that's incredibly inefficient.</p>
  
  <p>How can I help myself?</p>
  
  <p>This is what my code looks like:</p>
  
  <pre><code>Gather g = new Gather.Builder().input("speech")
                      .action(BASE_URL + "/processSpeech?")
                      .timeout(4)
                      .build();
  Conference.Builder conferenceBuilder = new Conference
                          .Builder("confie")
                          .startConferenceOnEnter(true)
                          .endConferenceOnExit(true)
                          .waitUrl("");
                  tmlb.dial(new Dial.Builder().conference(conferenceBuilder.build()).build());
  
  VoiceResponse.Builder tmlb = new VoiceResponse.Builder();
  TwiML tml = tmlb.gather(g).build();
  </code></pre>