avayer
avayer

Reputation: 71

Twilio Autopilot call Set Timelimit

I'm using twilio Auto pilot Bots and Services(previously used functions classic). When a user calls the number, I have a auto greet initiation which gives them options to choose and based on response there is a set of questions with actions. As of now if the user doesnt respond to the options the bot indefinitely waits for user response(4 hrs, which is max time for a call). I want to either limit the call duration to 5 mins or retry 3 times before disconnecting the call. I didn't find any option like loop n times before disconnecting in autopilot actions. I found another Twilio article configurable call time limits and tried to call an api to set time limit on active call, but this doesn't stop the call after set timelimit.

var twilioRestClient = new RestApiClient("https://api.twilio.com/");
var requestUrl = $"2010-04-01/Accounts/{TWILIO_ACC_SID}/Calls/{callSid}.json";
var request = new RestRequest(requestUrl, METHOD.POST);
var token = twilioRestClient.BuildBasicAuthString(TWILIO_ACC_SID, TWILIO_AUTH_TOKEN); // this will return "Basic <base64string>"
request.AddHeader("Authorization", token);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("timeLimit", "300", "application/x-www-form-urlencoded", ParameterType.RequestBody);
var response = twilioRestClient.Execute(request);

I get a 200 response from api but call doesn't stop after set Time limit

I tried with 24-Hour Maximum Call Duration enabled and disabled.

It would be better if there is any option to retry n times rather than disconnecting the call after y minutes.

Upvotes: 0

Views: 89

Answers (0)

Related Questions