def connect_call(): """ Connects the call to autopilot """ app.logger.info("Connecting call to autopilot task.") response = VoiceResponse() connect = Connect() connect.autopilot(ASSISTANT_SID, TargetTask="conduct_interview") response.append(connect) response = make_response(str(response)) response.headers['Content-type'] = 'text/html; charset=utf-8' return response
from twilio.twiml.voice_response import Connect, VoiceResponse, Room response = VoiceResponse() connect = Connect() connect.autopilot('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') response.append(connect) print(response)