Diagnosis Overview

Note

AI Context

  • Complexity: Medium

  • Cost: Scenarios static, signal and inbound are free. Scenario invite_probe can be billed if the destination number exists and answers. Scenario real_call places a real call that is excluded from VoIPBin billing (no billing record, no account balance needed). The carrier can still charge the call.

  • Async: Yes. POST /providers/{id}/diagnoses returns 202 with a running report. Poll GET /providers/{id}/diagnoses/{diagnosis_id} until status is completed or failed.

  • Permission: ProjectSuperAdmin only. Direct-access tokens are refused.

A provider that is configured but does not carry calls is hard to debug from the outside. The provider diagnosis runs a set of checks against one provider, step by step, and returns a report that names what failed and why.

The health status of a provider (see Health Status) only tells whether the provider answers SIP OPTIONS. A diagnosis goes further: it checks the configured fields, the dial string that would be sent, the network path, the inbound path, and optionally one INVITE or one real call.

Scenarios

A diagnosis runs one or more scenarios. If scenarios is omitted or empty, the default is static, signal and inbound, which cost nothing.

Scenario

Billing

What it checks

static

Free

The provider fields (empty hostname, hostname with a port, characters that are not allowed in a hostname, invalid codec names, tech headers that cannot be sent). If destination is given, it also shows the SIP request URI and the headers that would be sent, and the position of this provider in the route order of the requesting customer for that destination.

signal

Free

A DNS lookup of the hostname and SIP OPTIONS requests from the platform’s external SIP edge. 401, 403, 407, 5xx and no response are failures. Any other response, 6xx included, passes. Mixed results are reported as intermittent.

inbound

Free

Whether the carrier addresses are on the platform’s allow list for inbound traffic, and whether the inbound number (inbound_number_id) exists and has a call flow. With observe_inbound it also waits for a real incoming call (see below).

invite_probe

Can be billed

Sends one SIP INVITE to destination and reports how the provider answered. No call record, flow or media is created. If the number exists and the provider answers the call, the answer can be billed by the provider.

real_call

Carrier cost

Places a real call from source to destination through the provider, plays a prompt, waits for one DTMF digit, echoes audio and hangs up. It reports the connect result, the digit and the RTP packet counters per direction. VoIPBin does not bill the call; the carrier can still charge it.

Warning

invite_probe and real_call send traffic to a real number. Use a number you own and expect charges from the carrier (real_call is not billed by VoIPBin). The platform cannot prove that the number is yours. destination must be a valid E.164 number with at least 6 digits in the national part, and some premium-rate prefixes are refused. real_call also needs source in E.164 format.

Asynchronous run and polling

POST /providers/{id}/diagnoses answers 202 at once with a report in the running state. A background runner then fills the report step by step. A step is appended with status running when it starts and replaced with its final status when it ends. Poll the report by id, or use GET /providers/{id}/diagnoses/latest.

The whole run is limited to 7 minutes. A step starts only when enough time is left for it, otherwise it is skipped with hint_code budget_exceeded. A report that has not changed for more than 8 minutes is shown as failed with hint_code runner_lost. Reports are kept for 7 days.

The latest report is kept per provider, so another ProjectSuperAdmin of the project sees the same report, including the destination and source numbers that were typed.

Limits

  • One running diagnosis per provider. A second request answers 409 with reason diagnosis_running. A lost runner can keep a provider locked for at most 8 minutes.

  • invite_probe and real_call are each limited to 5 runs per provider per hour. The window is fixed, so a burst at the border of two windows can reach 10 runs within one hour. A refused request answers 429 with reason rate_limit_invite_probe or rate_limit_real_call and no report is stored.

  • A run counts against the limit when it is accepted. It is given back only when nothing was sent (for example the probe was busy or the DNS lookup failed).

  • The limits are per provider. Many providers can still be diagnosed at the same time.

Observing an inbound call

To check the inbound path end to end, send inbound_number_id (a number of your customer, from GET /numbers) with observe_inbound set to true.

  1. The inbound.observe step is added with status running and evidence.observe_until (RFC 3339 time).

  2. For 120 seconds after the start of the step, call the number from your own phone.

  3. If an incoming call to that number is seen, the step passes and reports whether the call flow started and whether the SIP source address is known. If none is seen, the step fails with hint_code no_inbound_seen.

A request with only inbound and observe_inbound starts the observation at once. Combined with other scenarios, it runs last. Any incoming call to that number after the start counts as your call. A call that the carrier edge rejects is also reported as “not seen”.

Report and hint codes

Each step has a status, a one line English summary, evidence with measured values and an optional hint_code. See Diagnosis structure for the fields. A hint_code is a stable machine readable name for a finding. Treat an unknown code as an opaque label, because new codes can be added.

hint_code

Meaning

intermittent

OPTIONS answers were mixed (some good, some failed) without a hard failure.

check_unavailable

The signaling check could not run. The step is skipped. The evidence holds the detail.

probe_busy

The probe component was busy. The step is skipped. Try again later.

allow_list_unreadable

The allow list for inbound addresses could not be read. The step is skipped.

inbound_ip_not_allowed

A carrier address is not on the allow list for inbound traffic. Ask the carrier for its signaling addresses and have them allowed.

no_inbound_seen

No incoming call arrived during the observation window.

source_unavailable

The SIP source address of the incoming call is not known.

answered_billable

The INVITE probe was answered. The provider can bill this call.

auth_or_ip

The provider rejected the INVITE with 403. Check the credentials and that the platform address is allowed by the provider.

number_or_tech_prefix

The provider rejected the INVITE with 404 or 484. Check the number format, the tech_prefix and the tech_postfix.

codec_mismatch

The provider rejected the INVITE with 488. Check the codecs field.

destination_unavailable

The provider answered the INVITE with 480, 486, 600 or 603. The route works, the destination is unavailable or busy. The step is a warning.

provider_rejected

The provider rejected the INVITE with another final code.

no_provisional_response

The provider sent no provisional response to the INVITE.

no_progress

The INVITE got a provisional response but no final answer in time.

probe_input_refused

The input could not be sent as a probe. No verdict on the provider.

budget_exceeded

Not enough time was left to start the step. The step is skipped.

no_inbound_rtp

A real call connected but no RTP arrived from the provider.

no_outbound_rtp

The platform sent RTP but this does not prove that the provider heard it. Check the real_call.dtmf step and whether you heard the echo.

media_stats_unavailable

RTP counters could not be read. The real_call.media step is skipped.

runner_panic

The runner failed unexpectedly. The report is failed.

runner_lost

The report was not updated for 8 minutes and is shown as failed.

shutdown

The platform restarted during the run. The report is failed.

The INVITE probe does not send the internal codec header that a real call uses and sends no caller id override. A provider that checks the caller id or the codec header can answer differently to a real call. real_call is the reference.

Limitations

  • The SIP source address of an inbound call can be empty. The step then reports source_unavailable.

  • RTP direction counters come from the media server. The packet counters are cumulative and the verdict uses the last good snapshot before hangup. The counter format was not verified against every media server version.

  • A real call that is answered late (after about 30 seconds) leaves a short window. The dtmf and media steps are then judged on that window, and the report says so. A real call is cut at 90 seconds after creation.

  • The diagnosis shows the full request URI and header values to the ProjectSuperAdmin. Only the helper view is reduced.

LLM helper

POST /providers/{id}/diagnoses/{diagnosis_id}/interpret asks an LLM helper to explain a report in plain English and to suggest changes to the provider.

  • The helper is not available when the platform has no key configured for it. GET /provider_helper/status returns {"available": false} and the interpret call answers 200 with available false, an empty message and no suggestions.

  • Suggestions are advice only and are never applied automatically. Apply a change yourself with PUT /providers/{id}.

  • Each suggestion has field (hostname, tech_prefix, tech_postfix, codecs or tech_headers), current_value (read from your provider by the platform, not by the model), suggested_value, reason and basis. basis is rule when the suggestion follows a hint_code of the report and inference when it is the helper’s own estimate. For tech_headers the current_value lists header names only.

  • A busy helper or a reached daily limit answers 429 or 503 with a reason code. Try again later.

Privacy of the helper

The helper receives a reduced copy of the report and of the provider:

  • Tech header values are never sent. Only the header names are sent.

  • Full phone numbers (destination, source), the request URI, IP addresses and call ids are never sent.

  • tech_prefix and tech_postfix are sent only as a shape: digits become 9, letters become a, other characters stay and the length is kept. For example ab-4821# is sent as aa-9999#.

  • From each step, only a fixed set of evidence values is sent: codes, counts, delays and flags.

  • The provider hostname, the codec list and the header names are sent, because the suggestions refer to them.