How to access Twilio Add-Ons from TwiML, Functions, Studio?
Asked Answered
H

0

7

I have a relatively simple application, but I think I may have outgrown TwiML. The application receives an incoming call, get some data from several Twilio Add-Ons based on the call, sends an SMS message with Add-On data included, then forwards the voice call.

I'm currently using the REST API, with server code hosted on my server and a TwiML response to forward the call, but the speed and reliability advantages of all-Twilio hosting is compelling.

Keeping in mind this uses both voice and message elements, can this be done in a Function? In Studio? This answer indicates that mixing voice and SMS in TwiML is deprecated, but it can be done in a Function. However, I've watched the 2017 Signal video, and checked the documentation pages for the Add-Ons, Functions, and Studio, but don't see how to access Add-Ons from these contexts.

The context parameter to the Function is a static value.

Maybe there's a way to pass in "?AddOns="... but I don't seem to be able to affect the event parameters if I invoke the Function directly from configuring an active number in the UI. If I try to add it to the path in the function properties, I get an error, "Only URL safe characters are allowed."

In the Add-on Configure screen, maybe I could check the "Use in incoming voice call" box and the add-on data would be available somehow to the function?

But ideally, I want to be able to dynamically include specific add-ons based on logic within the function.

I'm not a Node developer and maybe that's why it's not obvious to me. Any guidance on integrating Add-Ons access within functions, all within the Twilio UI?

Hepsibah answered 9/8, 2018 at 17:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.