> For the complete documentation index, see [llms.txt](https://docs.dorg.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dorg.pro/install-dorg/optional-configurations/phone-calls-via-sip.md).

# Phone calls via SIP

This chapter explains how to enable phone-call access to Dorg through a SIP provider. SIP phone calls are optional: Teams, Email, the browser voice interface, and the Console can operate without this configuration.

SIP configuration is managed from the Console and is intended for the HOS, IT administrators, or deployment operators responsible for telephony and voice infrastructure.

***

### What SIP Enables

When SIP is configured, users can call a SIP number associated with the Dorg deployment. The SIP Gateway receives the call, verifies the caller, opens an Azure OpenAI Realtime voice session, and routes the spoken request to the same orchestrator, tools, permissions, and conversation history used by the other Dorg channels.

This is separate from the browser voice page. The browser voice page uses WebRTC from a signed-in browser session; SIP phone calls use a telephony provider and identify the caller by phone number.

***

### Prerequisites

Before configuring SIP in the Console, make sure the following are available:

* A SIP account from your telephony provider.
* The SIP server or registrar address, for example `sip.provider.example`.
* The SIP number or username assigned to Dorg.
* The SIP password or registration secret.
* The UDP listen port expected by the deployment, usually `5060`.
* A running SIP Gateway service that can reach the orchestrator internally.
* Azure OpenAI Realtime configured for the voice channel.
* Caller phone numbers stored on the corresponding users in Keycloak, using the `phoneNumber` user attribute.

Inbound calls are fail-closed. If the caller phone number cannot be resolved to an enabled Keycloak user, the call is rejected instead of being handled as an anonymous session.

***

### Open the SIP Configuration Page

1. Open the Console URL provided by your IT team.
2. Sign in with an account that has Console administration access.
3. In the left-hand sidebar, open **SIP Configuration**.
4. Check the status banner at the top of the page.

The page shows two kinds of status:

* **Configured / Not configured** indicates whether SIP credentials are saved in the Console.
* **Service online / offline / degraded** indicates whether the SIP Gateway health check is currently reachable and healthy.

If the configuration is saved but the gateway remains offline or degraded, the problem is usually deployment, network, or SIP provider connectivity rather than a missing Console value.

***

### Configure the SIP Server

In the **SIP Server** section, fill in the provider connection details.

**SIP Server** The SIP registrar or server address provided by the telephony provider, for example `sip.messagenet.it`.

**UDP Listen Port** The local UDP port used by the SIP Gateway. The default is `5060`. Change it only if the deployment was configured to listen on a different port.

**SIP Number / Username** The SIP username or phone number assigned to Dorg by the provider.

**SIP Password** The registration password or secret. After saving, the Console does not display the password again. To keep the existing password during a later edit, leave the field blank.

**Outbound phone number** Optional destination number used for outbound SIP calls where supported by the deployment. Use international format when possible, for example `+393391234567`.

***

### Configure Realtime Voice Behavior

The **Azure OpenAI Realtime** section controls voice-session behavior for SIP calls.

**Voice** Select the Realtime voice used by Dorg during phone calls. Leave empty to use the deployment default.

**VAD Type** Select the voice activity detection mode. `semantic_vad` uses semantic turn detection; `server_vad` uses server-side audio activity detection. Leave empty to use the deployment default.

**VAD Eagerness** Controls how eagerly the system decides that the caller has finished speaking. Higher eagerness can make responses faster but may interrupt users who pause mid-sentence. Leave empty to use the deployment default.

These values affect the phone-call experience only. They do not change Teams, Email, or non-voice tool behavior.

***

### Configure the Voice Session Prompt

The **Voice session** section contains **Custom system prompt**.

Use this field only when phone calls require a different speaking style or operational instruction from the standard Dorg profile. For example, you may ask Dorg to be concise, to avoid long lists by phone, or to always confirm critical data before acting.

If the field is left blank, Dorg generates the system prompt from the standard Dorg configuration and the caller's group context.

***

### Save or Reset the Configuration

Click **Save configuration** to store the SIP settings. The orchestrator saves the configuration in the database; the SIP Gateway reads it from the orchestrator and uses it before falling back to environment variables.

Click **Delete configuration** to remove the Console-managed SIP configuration. After deletion, the deployment may still use SIP environment variables if they are present. If neither Console configuration nor environment variables are available, SIP remains not configured.

***

### Caller Identity and Permissions

SIP callers do not pass through a browser login flow. Dorg identifies them by the phone number presented by the SIP provider.

For a caller to use SIP:

* The incoming caller number must match a `phoneNumber` attribute on a Keycloak user.
* The user must belong to the groups required for the tools or competencies requested during the call.
* The caller's group membership is resolved from Keycloak and applied to the voice session.

The same oversight rules apply by phone as in other channels. If an action requires human confirmation, Dorg asks for confirmation verbally and executes only after an unambiguous approval.

***

### Operational Checks

After saving the configuration:

1. Confirm the page status changes to **Configured**.
2. Wait for the gateway status to show **Service online**.
3. Place a test call from a phone number already associated with a Keycloak user.
4. Verify that Dorg answers and recognizes the caller context.
5. Ask for a low-risk action first, such as a knowledge-base question, before testing tools with side effects.

If the call is rejected, first verify the caller's `phoneNumber` in Keycloak and the caller ID format delivered by the SIP provider. Some providers send numbers with or without `+`, spaces, or national prefixes; align the stored phone number with the provider format used in your deployment.

***

### Troubleshooting

**The page says Not configured.** Fill in at least SIP Server and SIP Number / Username, and provide a SIP password if none is already saved.

**The page says Configured but the service is offline.** Check that the SIP Gateway container or service is running, can reach the orchestrator, and exposes its status endpoint to the Console status check.

**The gateway cannot register with the SIP provider.** Verify SIP server, username, password, network egress, firewall rules, UDP port configuration, and provider-side account status.

**Calls are rejected immediately.** Check that the caller phone number exists in Keycloak as `phoneNumber` for the intended user and that the provider sends a caller ID format your deployment can normalize.

**Dorg answers but uses the wrong permissions.** Review the user's Keycloak group membership. SIP sessions resolve groups from Keycloak because they do not have a browser session token.

**Dorg speaks too quickly, too slowly, or interrupts the caller.** Adjust Voice, VAD Type, and VAD Eagerness in the Azure OpenAI Realtime section, then test again with a real call.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.dorg.pro/install-dorg/optional-configurations/phone-calls-via-sip.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
