DIDfarm
  • Numbers
  • Trunks
  • Messaging
  • Connect
  • Pricing
  • Coverage
  • Help
🇬🇧 EN 🇳🇱 NL 🇩🇪 DE 🇫🇷 FR 🇪🇸 ES 🇧🇷 PT 🇸🇦 AR 🇨🇳 ZH 🇯🇵 JA 🇮🇳 HI
Sign in Get a Number
← Help Center
On this page
Overview Testing Use Cases 1 — Get Test Numbers 2 — IVR Testing 3 — SMS Verification 4 — Voice Pipeline QA CI/CD Integration Release When Done Best Practices FAQ

Dev & Testing Numbers

Numbers · 8 min read Testing API Dev
What this guide covers: How to spin up real phone numbers for development and testing. Use real DIDs for IVR testing, SMS verification flows, voice pipeline QA, and end-to-end integration tests. Activate in seconds, release when done.

Overview

Testing telephony with fake numbers doesn't catch real-world issues: carrier routing, codec negotiation, SMS delivery quirks, regulatory filtering. You need real numbers on real carrier networks.

DIDfarm makes test numbers practical:

  • Activate in under 60 seconds — no procurement forms or carrier lead times
  • From €0.50/month — cheaper than most test accounts on other platforms
  • Release when done — no minimum term, cancel from the portal in one click
  • Multi-country — test with numbers from DE, FR, US, JP, BR — all from one account

Testing Use Cases

Test scenarioNumber typeFeatures needed
IVR flow testingLocalSIP trunk, inbound calls
SMS verification (2FA)MobileSMS enabled
Voice quality / codec QALocalSIP trunk, HD voice
International routingLocal (multi-country)Numbers in 3-5 countries
WhatsApp template testingMobileWhatsApp enabled
CNAM / Caller ID displayLocalCNAM setting

Step 1 — Get Test Numbers

1Provision numbers for your test environment

Via portal

  1. Go to Browse Numbers
  2. Pick numbers in the countries you need to test
  3. Enable SMS if testing SMS flows
  4. Create a SIP trunk if testing voice

Via API (recommended for CI/CD)

NODE.JS — PROVISION TEST NUMBERS
async function provisionTestNumbers(countries = ['US', 'DE', 'GB']) {
  const numbers = [];

  for (const country of countries) {
    // Search for a cheap local number
    const search = await fetch(
      `https://didfarm.com/api/v1/numbers/search?country=${country}&type=local&limit=1`,
      { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
    );
    const available = await search.json();

    if (available.data.length > 0) {
      // Order it
      const order = await fetch('https://didfarm.com/api/v1/numbers/order', {
        method: 'POST',
        headers: {
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({ numbers: [available.data[0].number] }),
      });

      const result = await order.json();
      numbers.push(result);
      console.log(`Provisioned ${country}: ${result.number}`);
    }
  }

  return numbers;
}

Step 2 — IVR Flow Testing

2Test your IVR with real inbound calls
  1. Assign your test number to a SIP trunk connected to your dev PBX
  2. Call the number from your mobile phone
  3. Walk through every IVR menu path, DTMF input, and queue
  4. Verify recordings, hold music, and transfer flows
Tip: Test from different countries using numbers from those countries. Carrier routing behavior can differ based on the originating network. A call from a German mobile to a German DID takes a different path than a call from a US mobile.

Step 3 — SMS Verification Testing

3Test your OTP/2FA flow with real SMS delivery
NODE.JS — END-TO-END SMS TEST
const { test, expect } = require('@jest/globals');

test('OTP delivery and verification', async () => {
  // 1. Trigger OTP send to test number
  const otpResponse = await fetch('https://your-app.com/api/auth/send-otp', {
    method: 'POST',
    body: JSON.stringify({ phone: TEST_PHONE_NUMBER }),
  });
  expect(otpResponse.status).toBe(200);

  // 2. Wait for SMS delivery (check via DIDfarm API)
  await new Promise(resolve => setTimeout(resolve, 5000));

  // 3. Fetch the latest inbound SMS on the test number
  const messages = await fetch(
    `https://didfarm.com/api/v1/sms/messages?direction=inbound&limit=1`,
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const latest = (await messages.json()).data[0];

  // 4. Extract OTP code from message body
  const code = latest.body.match(/\d{6}/)[0];

  // 5. Verify the code
  const verifyResponse = await fetch('https://your-app.com/api/auth/verify-otp', {
    method: 'POST',
    body: JSON.stringify({ phone: TEST_PHONE_NUMBER, code }),
  });
  expect(verifyResponse.status).toBe(200);
});

Step 4 — Voice Pipeline QA

4Test voice quality, codecs, and call handling

Things to verify in a voice QA test:

  • Codec negotiation — verify G.722 (HD) and G.711 work correctly
  • DTMF handling — test in-band and RFC 2833 DTMF tones
  • Call duration — verify calls don't drop after 30 minutes (common SIP timer issue)
  • Hold/transfer — test music on hold and attended/blind transfers
  • Recording — verify call recording captures both sides
  • NAT traversal — test from behind different NAT configurations

CI/CD Integration

For automated testing pipelines, provision numbers at the start of your test run and release them at the end:

GITHUB ACTIONS — TELEPHONY TEST JOB
telephony-tests:
  runs-on: ubuntu-latest
  steps:
    - name: Provision test number
      run: |
        NUMBER=$(curl -s -X POST https://didfarm.com/api/v1/numbers/order \
          -H "Authorization: Bearer $DIDFARM_API_KEY" \
          -H "Content-Type: application/json" \
          -d '{"country":"US","type":"local"}' | jq -r '.number')
        echo "TEST_NUMBER=$NUMBER" >> $GITHUB_ENV

    - name: Run telephony tests
      run: npm test -- --grep "telephony"

    - name: Release test number
      if: always()
      run: |
        curl -s -X DELETE "https://didfarm.com/api/v1/numbers/$TEST_NUMBER" \
          -H "Authorization: Bearer $DIDFARM_API_KEY"

Release When Done

When testing is complete, release numbers from the portal (My Numbers → click number → Release) or via API. You stop paying immediately — no minimum term, no cancellation fee.

Keep staging numbers: For persistent staging environments, keep a small set of numbers long-term. For ephemeral test runs (CI/CD), provision and release per run to minimize cost.

Best Practices

  • Use separate numbers for dev, staging, and production — never test on production numbers
  • Tag test numbers with labels (e.g., "staging", "ci-test") in the portal for easy identification
  • Provision multi-country numbers to test international routing edge cases
  • Enable SMS on test numbers to test both voice and messaging in one flow
  • Automate provisioning via API for CI/CD — don't manually manage test numbers
  • Set up wallet balance alerts so test environments don't run out of credit

FAQ

How much does a test number cost?

From €0.50/month for a local number. If you provision for a CI/CD run that takes 30 minutes and then release, you pay for one month minimum. For high-frequency testing, keep a persistent staging number.

Can I use test numbers in my automated test suite?

Yes. Provision via API, run your tests, then release. The DIDfarm API supports full CRUD operations on numbers, making it ideal for test automation.

Are test numbers real carrier numbers?

Yes. DIDfarm numbers are real DIDs on real carrier networks. They receive real calls and SMS from any phone worldwide. This is what makes them valuable for testing — you're testing the same infrastructure your production traffic will use.

Get test numbers in seconds

Spin up real DIDs for your dev and staging environment.

Browse Numbers →
© 2026 DIDfarm · didfarm.com
About Blog Partners Coverage API Docs Status Privacy Terms Cookies Help

We use essential cookies to make DIDfarm work. With your consent, we also use analytics cookies to improve our service. Cookie Policy