0

When i make a call as voice content to that call, can i send a dynamically generated twiml message rather pointing to a URI that contains twiml message ?

If not is there a a workaround to accomplish this , cause I see DIAL and SAY APIs which get used during call response, so would it be possible to make use of those when creating a new call and passing twiml messages using these APIs ?

https://www.twilio.com/docs/api/twiml/dial https://www.twilio.com/docs/api/twiml/say

1 Answers1

0

Twilio evangelist here.

Its not possible to send TwiML to the REST API. If you don't want to host the TwiML on your own URL there are a few options:

  • Use TwiML Bins which lets you host relatively static (there is some templating support) TwiML on Twilios servers.

  • Use Twilio Functions which let you write, store and execute Node on Twilios servers

  • Use Twilio Studio to define your call flow. A flow in studio can be triggered via an HTTP request to it, so you can take the flows URL and pass it to the REST API when you start your outbound call.

Hope that helps.

Devin Rader
  • 10,260
  • 1
  • 20
  • 32
  • Hi @Devin, I have an ASP.net Core application in which I am starting the call on the page via Javascript command Twilio.Device.Connect(). Initially, the token is generated from the backend. And while generating that token, I am using the appSid of the TwimlApp which has the Request url returning an xml as +9AAAABBB My question is how can I pass the CallerID and the Number to this TwiML while calling from the Javascript call? – Hemant Sisodia Sep 08 '21 at 10:36