Reputation: 95
I am going to integrate twilio Voice for making outbound calls and receiving incoming calls to my web Application. When someone calls from traditional phone to one of twilio powered phone number, twilio receive the incoming connection through twilio device and send Asynchronous HTTP request to voice URL configured for that particular number and execute the expected Twiml Instructions. But here, the question is when i want to integrate this functionality of receiving incoming calls or connections to twilio number into my web application for multiple users , then how my application will distinguish that call is receiving on a particular number alongwith the registered client.
Upvotes: 3
Views: 1462
Reputation: 17624
I believe you have the process a bit backwards:
When someone calls from traditional phone to one of twilio powered phone number, twilio receive the incoming connection through twilio device and send Asynchronous HTTP request to voice URL configured for that particular number and execute the expected Twiml Instructions.
When a call is placed to a Twilio number, that call is routed directly to the voice URL (not through one of the device clients). The only time what you're describing happens (a new 'connection' creating a request from the device to the voice URL), is when the device makes a call.
the question is when i want to integrate this functionality of receiving incoming calls or connections to twilio number into my web application for multiple users , then how my application will distinguish that call is receiving on a particular number
Since all incoming calls go directly to your voice URL, the script/application/whatever that processes that request can route the call on whatever criteria is needed.
For example, if you point multiple virtual numbers to the same voice URL, just check the incoming 'To' number, and map that to the correct device (using <Dial><Client>name</Client></Dial>
).
Upvotes: 3