0

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.

avayer
  • 61
  • 3
  • While I've not tried, I don't believe a voice call will wait 4 hours (the [documentation says that happens for messaging channels](https://www.twilio.com/docs/autopilot/actions/listen)). Is that what you have encountered on a voice call? – philnash Aug 11 '22 at 07:31
  • Yes, I'm having an issue where a user calls our numbers and doesn't respond to any of the options. The calls get disconnected after 4 hours which is the maximum Timelimit for a call. For now, I'm completing the call by updating the call resource after 5 mins using [update call resource to end call](https://www.twilio.com/docs/voice/api/call-resource). Timelimit documentation for outbound calls says, calls that reach configured time limit will disconnect with an error, but my current implementation just updates the call status to completed and ends the call. – avayer Aug 11 '22 at 10:16
  • A user called your number and waited silently on the line for 4 hours? That's some dedication! But it also doesn't seem right, so I'd recommend contacting [Twilio support](https://www.twilio.com/help/contact) and providing some CallSids where this happened. – philnash Aug 12 '22 at 02:56
  • yea, some one is trying to mess up with our twilio number. This happened 4-5 times till now. They call with different numbers and just wait till call drops after 4 hrs. We were able to recognize this as our account was being recharged every day once its below the minimum limit. Twilio studio has more options like loop, drop after no response, etc. are there any equivalent in autopilot? – avayer Aug 14 '22 at 09:58
  • Honestly, it doesn't sound right to me that autopilot will just hang like that. Please contact Twilio support. – philnash Aug 15 '22 at 01:45

0 Answers0