All guidesTutorial · Voice

Build an IVR in 10 minutes

Answer incoming calls with a menu ("Press 1 for sales, 2 for support") and route callers to the right team.

10 min
  1. 1

    Buy a phone number

    Pick a local or toll-free number in the dashboard or with the API.

    covebyte numbers buy --country US --type local
  2. 2

    Point the number at your app

    Set the voice webhook so Covebyte asks your server what to do when a call arrives.

    covebyte numbers update +18885550100 \
      --voice-url https://your-app.com/ivr
  3. 3

    Return the menu

    Respond with TeXML that plays a greeting and collects a key press.

    <Response>
      <Gather numDigits="1" action="/ivr/route">
        <Say>Press 1 for sales, 2 for support.</Say>
      </Gather>
    </Response>
  4. 4

    Route the caller

    Read the digit and dial the right team, or send callers to voicemail after hours.

    app.post('/ivr/route', (req, res) => {
      const team = req.body.Digits === '1' ? SALES : SUPPORT;
      res.type('xml').send(`<Response><Dial>${team}</Dial></Response>`);
    });
  5. ✓

    You’re done

    Need help taking this to production? Our engineers can review your setup.