Enums & Constants
This reference documents all enums and constants used throughout the SFVoPI API.
App Status
Controls whether an SFVoPI application is active and can receive calls.
| Value | Description | Used In |
|---|---|---|
ACTIVE | Application is active and can receive inbound calls | Apps, Numbers |
INACTIVE | Application is inactive and will not receive calls | Apps |
Set app status to INACTIVE to temporarily disable call routing without deleting the app configuration.
HTTP Method
Specifies the HTTP method used for webhook callbacks.
| Value | Description | Used In |
|---|---|---|
POST | Send webhook as HTTP POST request with JSON body | Apps, Outbound Calls |
GET | Send webhook as HTTP GET request with query parameters | Apps, Outbound Calls |
POST is recommended for webhooks as it supports larger payloads and is more secure.
Call Direction
Indicates whether a call is inbound (to your number) or outbound (from your number).
| Value | Description | Used In |
|---|---|---|
INBOUND | Call received on your VoIP number | Webhooks |
OUTBOUND | Call initiated from your VoIP number | Outbound Calls, Webhooks |
Call Status
Represents the current state of a call throughout its lifecycle.
| Value | Description | Used In |
|---|---|---|
RINGING | Call is ringing at the destination | Webhooks |
IN_PROGRESS | Call has been answered and is active | Webhooks |
COMPLETED | Call ended normally | Webhooks |
BUSY | Destination was busy | Webhooks |
FAILED | Call failed to connect | Webhooks |
NO_ANSWER | Destination did not answer within timeout | Webhooks |
CANCELED | Call was canceled before completion | Webhooks |
Monitor call status in webhook payloads to track call outcomes and implement retry logic for failed calls.
Recording Status
Indicates the upload/availability state of a call recording, returned in the recording_status field.
| Value | Description | Used In |
|---|---|---|
UPLOADING | Recording is still being uploaded; recording_url is null | Get Call Details |
EARLY_MEDIA_ONLY | Call was never answered by the callee, but a recording of only pre-answer audio (ringback, IVR, etc.) is uploaded and available at recording_url | Get Call Details |
OK | Recording is uploaded and available at recording_url | Get Call Details |
DELETED | Recording was explicitly deleted and is no longer available | Get Call Details |
EXPIRED | Recording is no longer available (past recording_expire_at) | Get Call Details |
Poll Get Call Details or wait for the hangup_url webhook, then re-fetch until recording_status moves to OK or EARLY_MEDIA_ONLY before using recording_url — both indicate a recording is available, not just OK.
Audio Codec
Specifies the audio codec used for streaming audio during calls.
| Value | Description | Used In |
|---|---|---|
PCMU | G.711 µ-law codec (North America, Japan) | Stream Response |
PCMA | G.711 A-law codec (Europe, most of world) | Stream Response |
PCMU is standard in North America and Japan. PCMA is standard in Europe and most other regions. Choose based on your deployment region.
Stream Direction
Controls the direction of audio streaming for real-time audio processing.
| Value | Description | Used In |
|---|---|---|
INBOUND | Receive audio from the caller only | Stream Response |
OUTBOUND | Send audio to the caller only | Stream Response |
BOTH | Bidirectional audio (send and receive) | Stream Response |
Use BOTH for interactive voice applications. Use INBOUND or OUTBOUND for one-way streaming scenarios.
Sample Rate
Audio sample rate in Hz for streaming audio.
| Value | Description | Used In |
|---|---|---|
8000 | 8 kHz sample rate (standard for telephony) | Stream Response |
16000 | 16 kHz sample rate (wideband audio) | Stream Response |
8000 Hz is the standard for VoIP and telephony. 16000 Hz provides higher quality audio but requires more bandwidth.