I am new to Twilio's API, and for that matter, Twilio as a whole.
I'm using python to make an automated system in which, when an event happens, a call is placed to a particular number. Below is what I'm running (in Python):
from twilio.rest import Client
account_sid = 'ACxx...'
auth_token = 'xx...'
client = Client(account_sid, auth_token)
call = client.calls.create(
url='my/twilio/function'
to="+11111111111",
from="+12222222222",
)
print(call)
And the following is my function in my Twilio account:
exports.handler = function(context, event, callback) {
let twiml = new Twilio.twiml.VoiceResponse();
twiml.say("A call was placed on the following extension.");
callback(null, twiml);
};
This will successfully make the call to my test number, and plays the message "A call was placed on the following extension". However, what I would like is to be able to pass parameters to say on which extension the call was made, e.g., "A call was placed on extension 100". How do I accomplish passing this custom parameter?