Receiving calls
This guide walks you through answering an inbound call and building a simple menu for it. It assumes you have a phone number on your account. See the dashboard if you do not yet have one.
Configure a voice URL
Every number on your account has a voice URL: the address PressOne requests whenever a call arrives for that number. In your dashboard, open the number's configuration and set the voice URL to a route on your server, along with the HTTP method used to request it (POST by default).
Once configured, every inbound call to that number follows the same sequence:
- A call arrives at the number.
- PressOne requests the voice URL, sending call parameters such as
CallSid,From, andTo. See webhooks for the complete parameter set. - Your server returns a OneML document, and PressOne executes it on the call.
Answer with a greeting
The following server answers every inbound call with a spoken greeting. It is complete and runnable. Point your number's voice URL at it to try it.
Note: Responses must be served with a
Content-Typeoftext/xml.res.type("text/xml")andResponse(..., mimetype="text/xml")set it explicitly in the examples above.
Build a two-option menu
Extend the same server into a menu that branches on caller input. The voice URL route returns a <Gather> that collects one digit and sends it to an action route, which returns a different document for each option.
A real menu would dial an agent instead of hanging up. See Forwarding calls for connecting the caller to another number.
Next steps
- Webhooks: standard parameters, transport, and signature verification for every request PressOne sends your server.
- Gather: the full set of attributes for collecting DTMF and speech input.
- OneML overview: every verb available for scripting a call.