RonanCraft
RonanCraft

Reputation: 13

Twiml Connect method issue

So i'm trying to make it so an outbound call gets redirected to my Autopilot system, but my Twiml does seem to recognize the connect function built into the voice response method

I've tried to have the account sid be provided, call, and even load the link in a browser, it just gives the same error

Heres the code im using

exports.handler = function(context, event, callback) {
    let res = new Twilio.twiml.VoiceResponse();
    console.log(res.toString());
    res.connect().autopilot(context.AI_SID);
    console.log(res.toString());
    callback(null, res);
};

It should return the code below, but seems like this doc is not accurate: https://www.twilio.com/docs/voice/twiml/connect

<Response>
  <Connect>
    <Autopilot>#####</Autopilot>
  </Connect>
</Response>

Upvotes: 0

Views: 118

Answers (1)

Alan
Alan

Reputation: 10781

Update the Twilio helper libraries under your Twilio Functions, Configure, to use a release that added this verb.

https://github.com/twilio/twilio-node/blob/master/CHANGES.md

Upvotes: 1

Related Questions