0

How do I stop the async update call from completely interrupting the call? I would like response.Say("Let me think about that.") to finish before the async call is made, currently it just stops the Say() verb mid sentence.

    [HttpPost]
    public ActionResult Intermediate(string RecordingUrl)
    {
        recordingUrl = RecordingUrl;
        var response = new VoiceResponse();
        response.Say("Let me think about that.");
        //Asynchronously POST
        var call = CallResource.UpdateAsync(
            method: Twilio.Http.HttpMethod.Post,
            url: new Uri("http://123456789/voice/show"),
            pathSid: sessionIdentifier, fallbackUrl: new Uri("http://123456789/voice/Fallback"));
        return TwiML(response);
    }
Harry Stuart
  • 1,781
  • 2
  • 24
  • 39

1 Answers1

0

Twilio developer evangelist here.

Rather than updating the call with a request to the API, why not just use the <Redirect> TwiML element. You could achieve your redirect after the <Say> with:

[HttpPost]
public ActionResult Intermediate(string RecordingUrl)
{
    recordingUrl = RecordingUrl;
    var response = new VoiceResponse();
    response.Say("Let me think about that.");
    response.Redirect(new Uri("http://123456789/voice/show"));
    return TwiML(response);
}

Let me know if that helps at all.

philnash
  • 70,667
  • 10
  • 60
  • 88