Twilio inbound SMS options - cloud?

Here is how I set it up. We will start with the local node red instance first.

The top set of nodes deals with messages coming in from twilio, trying to get to the server. It is an HTTP node, and the top just pipes the request through a web socket to the local node instance. The other nodes deal with storing the incoming message to a list, as we will need it after we get a response from the server. We are keying it with the sid of the message.

The bottom set of nodes deals with the response coming from the ignition server, going back to Twilio. We convert the payload to json, inject the payload from the web socket as the originating requests payload, and use an http response node to respond to the originating request.

Ok, this is the local flow. We are accepting a message through the web socket, converting the original payload to json, while, in parallel, sending the original message from twilio to the local server, then packaging the response into a msg to then rejoin with the original message, and firing back down the web socket, which then responds to the original request.

Its all like black magic, and it works. We are probably going to modify our Twilio module to allow us to use web sockets, just have not had time. This is all my proof of concept work.

Kyle

2 Likes