Dev & Testing Numbers
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 scenario | Number type | Features needed |
|---|---|---|
| IVR flow testing | Local | SIP trunk, inbound calls |
| SMS verification (2FA) | Mobile | SMS enabled |
| Voice quality / codec QA | Local | SIP trunk, HD voice |
| International routing | Local (multi-country) | Numbers in 3-5 countries |
| WhatsApp template testing | Mobile | WhatsApp enabled |
| CNAM / Caller ID display | Local | CNAM setting |
Step 1 — Get Test Numbers
Via portal
- Go to Browse Numbers
- Pick numbers in the countries you need to test
- Enable SMS if testing SMS flows
- Create a SIP trunk if testing voice
Via API (recommended for CI/CD)
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
- Assign your test number to a SIP trunk connected to your dev PBX
- Call the number from your mobile phone
- Walk through every IVR menu path, DTMF input, and queue
- Verify recordings, hold music, and transfer flows
Step 3 — SMS Verification Testing
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
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:
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.
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.