Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Providers/Resgrid.Providers.Number/OutboundVoiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public async Task<bool> CommunicateCallAsync(string phoneNumber, UserProfile pro
var options = new CreateCallOptions(new PhoneNumber(profile.GetPhoneNumber()), new PhoneNumber(number));
options.Url = new Uri(string.Format(Config.NumberProviderConfig.TwilioVoiceCallApiUrl, profile.UserId, call.CallId));
options.Method = "GET";
options.MachineDetection = "Enable";
//options.IfMachine = "Continue";

var phoneCall = await CallResource.CreateAsync(options);
Expand All @@ -51,6 +52,7 @@ public async Task<bool> CommunicateCallAsync(string phoneNumber, UserProfile pro
var options = new CreateCallOptions(new PhoneNumber(profile.GetHomePhoneNumber()), new PhoneNumber(number));
options.Url = new Uri(string.Format(Config.NumberProviderConfig.TwilioVoiceCallApiUrl, profile.UserId, call.CallId));
options.Method = "GET";
options.MachineDetection = "Enable";
//options.IfMachine = "Continue";

var phoneCall = await CallResource.CreateAsync(options);
Expand Down
5 changes: 4 additions & 1 deletion Web/Resgrid.Web.Services/Controllers/TwilioController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,17 @@ public async Task<ActionResult> VoiceCall(string userId, int callId, [FromQuery]
return CreateVoiceContentResult(response);
}

// For outbound calls, allow a brief pause for the audio bridge to
// stabilize after the callee answers before attempting playback.
response.Pause(length: 1);

// For dispatch playback, attempt to fetch (or pre-warm) the TTS URL
// within a short timeout so that the TwiML response is returned before
// Twilio's 15-second webhook timeout expires. If the dispatch text is
// not yet cached, we play a brief "please wait" prompt and redirect
// back to this endpoint, giving the TTS service time to complete
// generation in the background.
var dispatchReady = await TryAppendDispatchPlaybackAsync(response, call);

if (!dispatchReady)
{
// Parse and increment the retry counter from the incoming request.
Expand Down
Loading
Loading