I believe I might not quite understand the process flow for Twilio calls. I have two scenarios - one where I make a call from my browser to a phone (outgoing), and the second where I make a call from my phone to the browser(client) (incoming).
For both of these calls, I log the post data sent by twilio in a log file when that request reaches my Twilio Voice URL.
And in both cases, the "direction" post variable says "inbound". I would expect one to say "inbound" and the other "outbound", or "outbound-dial" (according to the docs).
Yet they both say "inbound". So I'm probably misunderstanding how this value gets set by Twilio. Can someone please explain what I've gotten wrong?
I was hoping to use this "direction" variable to determine in my app whether a call was going out from the client to a phone, or coming in from a phone to the client. i.e. when a request reaches my twilio voice url, my code can determine whether it's an incoming call to the browser, or an outgoing call to a phone or another client.
More details about the two scenarios.
(1) I have a simple Twilio client that exists on a web page. When I enter a phone number and click connect, it calls the Twilio.Device.connect javascript function which passes the connection to my Twilio Voice Url at Twilio.
I would expect the "direction" data to say "outbound" or "outbound-dial" in this case, but it says "inbound".
(2) I make a call from my phone to the browser client, using the twilio registered phone number to look up the client info.
I would expect the "direction" data to say "inbound", which it does.
Any help would be appreciated. Thanks!