તમારા પોતાના નંબર લાવો (VoIP, API)

ડેમો નંબર પ્રોટોટાઇપિંગ માટે યોગ્ય છે, પરંતુ પ્રોડક્શન ટ્રાફિક માટે તમારા પોતાના VoIP પ્રદાતા દ્વારા તમારા માલિકીના નંબરોનો ઉપયોગ કરવો જોઈએ. આ માર્ગદર્શિકા તમને ત્રણ-પગલાંની પ્રક્રિયા સમજાવે છે: ક્રેડેન્શિયલ્સ ચકાસો → કનેક્શન બનાવો → નંબરો ઇમ્પોર્ટ કરો → ચકાસો.

સમર્થિત પ્રદાતાઓ

પ્રદાતાprovider idનોંધો
TwiliotwilioAPI કી + સિક્રેટ
TelnyxtelnyxAPI કી; માર્ગદર્શિત ઓનબોર્ડિંગ ઉપલબ્ધ (setup_method: guided_telnyx)
SignalWiresignalwireટૂંક સમયમાં ઉપલબ્ધ — આજે મેન્યુઅલ SIP દ્વારા કનેક્ટ કરો
Vonagevonageટૂંક સમયમાં ઉપલબ્ધ — આજે મેન્યુઅલ SIP દ્વારા કનેક્ટ કરો
મેન્યુઅલ SIPmanualકોઈપણ SIP ટ્રંક — તમારી પોતાની કન્ફિગ લાવો

1. ક્રેડેન્શિયલ્સ ચકાસો

સ્થાયી VoIP કનેક્શન બનાવતા પહેલાં, પ્રદાતાના ક્રેડેન્શિયલ્સ કાર્ય કરે છે તેની પુષ્ટિ કરવા માટે તપાસો. આ verification_evidence_id પરત આપે છે, જેને તમે બનાવવાના પગલામાં આપો છો જેથી ચકાસણી માટે ક્રેડેન્શિયલ્સ પર બેવડો ચાર્જ ન લાગે.

curl -X POST https://api.thunderphone.com/v1/voip-connections/test \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider":    "telnyx",
    "credentials": { "apiKey": "KEY...", "connectionId": "123456" },
    "sip_config":  { "domain": "acme.sip.telnyx.com" }
  }'
{
  "status": "pass",
  "verification_evidence_id": "b9a2...",
  "suggested_connection_name": "Telnyx: Acme Main (+15550001234)",
  "checks": {
    "credentials_valid": true,
    "inbound_reachable": true,
    "outbound_authorized": true
  }
}

જો કોઈપણ ચકાસણી નિષ્ફળ જાય, તો પ્રતિસાદનું status fail હશે અને checks કયું પગલું નિષ્ફળ ગયું તે દર્શાવશે. પ્રદાતા-બાજુની કન્ફિગ સુધારો (ટ્રંક એસાઇનમેન્ટ, IP એલાઉલિસ્ટ, આઉટબાઉન્ડ ઓથોરાઇઝેશન) અને ફરી પ્રયાસ કરો.

2. કનેક્શન બનાવો

હમણાં મેળવેલ verification_evidence_id આપો:

curl -X POST https://api.thunderphone.com/v1/voip-connections \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name":         "Acme Telnyx Main",
    "provider":     "telnyx",
    "setup_method": "api_key",
    "credentials":  { "apiKey": "KEY...", "connectionId": "123456" },
    "sip_config":   { "domain": "acme.sip.telnyx.com" },
    "verification_evidence_id": "b9a2..."
  }'

પ્રતિસાદ status="connected" સાથેનો VoipConnection ઑબ્જેક્ટ છે. ક્રેડેન્શિયલ્સ સર્વર-સાઇડ પર સંગ્રહિત થાય છે અને અનુગામી GET દ્વારા ક્યારેય સાદા ટેક્સ્ટમાં પરત કરવામાં આવતા નથી — રોટેટ કરવા માટે, નવું test ચલાવો અને નવા એવિડન્સ સાથે PATCH કરો.

3. નંબરોની યાદી બનાવો અને ઇમ્પોર્ટ કરો

તમારા ક્રેડેન્શિયલ્સને દેખાતા અને પહેલેથી જ ThunderPhone orgમાં ન હોય તેવા નંબરો તપાસો:

curl https://api.thunderphone.com/v1/voip-connections/5/available-numbers \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"

પછી તમને જોઈતા નંબરો ઇમ્પોર્ટ કરો:

curl -X POST https://api.thunderphone.com/v1/voip-connections/5/import-numbers \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"numbers": ["+15550001234", "+15550009999"]}'

દરેક ઇમ્પોર્ટ તમારા orgમાં source="voip" અને status="provisioning" સાથેનો ફોન નંબર રિસોર્સ બને છે.

4. આયાત કરેલા દરેક નંબરની ચકાસણી કરો

આયાત કરવાથી નંબર ઉપલબ્ધ તરીકે નોંધાય છે; તેના મારફતે કૉલને ખરેખર રૂટ કરવા માટે દ્વિ-માર્ગી ચકાસણી જરૂરી છે (ઇનબાઉન્ડ ડાયલ-ઇન ચકાસણી + આઉટબાઉન્ડ અધિકૃતતા તપાસ).

curl -X POST https://api.thunderphone.com/v1/phone-numbers/{id}/verify-voip \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"

સફળતા મળતાં, voip_verification_status verified માં બદલાય છે અને નંબર status="active" માં જાય છે. નિષ્ફળતા પર, પ્રતિસાદમાં શું નિષ્ફળ થયું તે સ્પષ્ટ જણાવવામાં આવે છે — તેને ઠીક કરો (ઘણીવાર પ્રદાતા ડેશબોર્ડમાં ટ્રંક અસાઇનમેન્ટ ગાયબ હોય છે) અને ફરી કૉલ કરો.

5. એજન્ટ સોંપો અને કૉલ લો

નંબર ચકાસાઈ ગયા પછી, તમે ઇનબાઉન્ડ / આઉટબાઉન્ડ એજન્ટને ડેમો નંબરની જેમ જ સોંપો છો. જુઓ ઇનબાઉન્ડ કૉલ હેન્ડલ કરો અને આઉટબાઉન્ડ કૉલ કરો.

ક્રેડેન્શિયલ્સ રોટેટ કરવું

જ્યારે પ્રદાતાની કી બદલાય, ત્યારે ટેસ્ટ-પછી-અપડેટ પ્રક્રિયા ફરી ચલાવો:

# 1. Test the new credentials
curl -X POST https://api.thunderphone.com/v1/voip-connections/test ...

# 2. PATCH the connection with the new evidence
curl -X PATCH https://api.thunderphone.com/v1/voip-connections/{id} \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "credentials": { "apiKey": "NEW_KEY..." },
    "verification_evidence_id": "fresh-evidence-id"
  }'

કનેક્શન યથાવત રહે છે — નંબરો ફરી આયાત કરવાની જરૂર નથી.


આગળનાં પગલાં