Handling an inbound call requires an endpoint to be set up on your side to handle a URL POST or GET that Ytel sends information to every time a call is made to your API number. InboundXML must be the response to our webhook request to that endpoint.
Every number purchased is pre-configured to receive and handle an inbound call and play a default message. Ytel populates the Voice Request URL with a default url that plays a welcome message. Replacing this url can be done under the number management menu clicking the edit button.
The Voice Request URL collects information about the inbound call and sends the information to your specified endpoint. The data below contains all the information sent to that URL via POST or GET depending on your configred settings:
From: +19492223333 zipcode: 92604 carrier: T-Mobile USA Inc To: +13026661111 AccountSid: 456c6f7f-c911-f823-fb2d-a13e4780c122 city: Irvine CallSid: c770956-bd29-410c-a7b7-2e1af8c69123 wireless: True
|From||string||E164 formatted phone number of the inbound caller. The "Caller ID".|
|zipcode||string||5 digit zip code of the customer based on the NPA-NXX.|
|carrier||string||The registered carrier for the "From" phone number.|
|To||string||E164 formatted phone number of the number being called. The "Ytel" number.|
|AccountSid||string||The account sid of the "To" number owner.|
|city||string||The registered city of the customer based on the NPA-NXX.|
|CallSid||string||The unique UUID of this specific call. It can be used for future reference.|
|wireless||string||Returns whether the "From" number is a registered wireless number or not.|
Once the Voice Request URL sends over the data and it is consumed a response is required to continue. A typical scenario is parse out the various pieces of information, use that date to look up items in a database and then forward on the call to an external phone number. This will require use of the tag. We will focus on that tag for this example. Other tags that can be used in InboundXML can be found in our InboundXML Documentation.
Sample Response (More Information on the tag):
<Response> <Play>http://YourURL.com/ytel_lead/trans.wav</Play> <Dial timeout="60" callerId="+14012001234">+19496826543</Dial> </Response>
Updated almost 2 years ago