The Twilio node is not needed to handle voice requests as this can be accomplished using regular HTTP input and output nodes. The way it works is that when a call is received on your Twilio number, the Twilio server will pass the information to you via the Voice URL you define in your number setup. The Twilio requests require a response that is the TWiML payload. This forms the basis of the outgoing message. Full details of the TWiML markup are found in the Twilio help pages. The example flows use the HTTP input and output nodes to provide the link to Twilio.
My Node-RED flow listens for a /twiliovoice url. This must be accessible from outside of your local network. I did this using my DuckDNS account. My router then uses port forwarding to redirect the incoming request to my linux server running Node-RED . The external URL uses different ports to Node-RED and this is all catered for in the port forwarding on the router.
Your Twilio number needs to be have the correct Request URL and method setting up. This flow uses the POST method. You can also set a fallback URL by selecting the Optional settings. This ideally would be a simple TWiML file located on an externally hosted URL to respond when your Node-RED system fails to respond for any reason. At present I've not set this up.
The flows here demonstrate a simple voice menu with two choices, one to read a global context value and return the current power usage. The second is to control a device, in this case publish a value to a MQTT topic that is picked up by another subscriber to ring a bell.
The final part of the flows is to convert the created JSON body to the XML based TWiML response. This is done using the handy Json2XML node.
The flows can be further extended to handle more commands by adding more conditions to the switch node. The main thing to remember is that the flows must return a valid TWiML response in the payload.
To aid in debugging this functionality, use the Twilio dev-tools menu to show any failures.
Your Twilio account has a lot of information that includes the dev tools plus what requests and responses have been processed.
For the json2xml node this is what i get.
This node is a type unknown to your installation of Node-RED.
If you deploy with the node in this state, it will lose all of its configuration.
See the Info side bar for more help
Any ideas on how to deploy this?