# Voice calling configuration

The Calling module uses the browser voice client configured by `VOICE_PROVIDER`. Phase 1 ships with the `twilio` implementation, while application services only depend on `VoiceProviderInterface`.

Configure these environment values before enabling Start Call:

```dotenv
VOICE_PROVIDER=twilio
VOICE_WEBHOOK_BASE_URL=https://your-public-application-url
VOICE_DEFAULT_COUNTRY_CODE=+61
TWILIO_ACCOUNT_SID=AC...
TWILIO_AUTH_TOKEN=...
TWILIO_API_KEY_SID=SK...
TWILIO_API_KEY_SECRET=...
TWILIO_TWIML_APP_SID=AP...
```

In the Twilio TwiML App, set the Voice URL to:

```text
https://your-public-application-url/voice/twiml
```

The URL must be publicly reachable over HTTPS. Twilio signs requests to the Voice and webhook endpoints; the application rejects unsigned or invalidly signed requests. Configure the TwiML App's status callback to the public webhook endpoint if account-level status tracking is required:

```text
https://your-public-application-url/voice/webhooks/twilio
```

The web app passes the `voice_call_id` when initiating the browser call. Recording and dial callbacks carry this correlation value, allowing each attempt to be recorded independently.

`mystery_status` is intentionally not changed by any provider callback. A successful recording only updates the latest successful attempt and the existing `mystery_assignment_calls.audio_path` compatibility field. The shopper must still use the existing Submit action to complete the mystery-shopping assessment.
