# Get Extension Presence Status

Get Extension Presence Status is one of the Internal Data Ops operations. Point it at an extension and it looks up that extension's live state, its presence profile, whether it is on a call, and whether it is ringing, then saves the answers in variables. Downstream components can read those variables to decide how the call should continue.

## What it does

The component returns the current status of a single extension, covering:

- The extension's presence profile.
- Whether the extension is on a call.
- Whether the extension is ringing.

You can select the extension from a list, or supply an expression so the target is worked out while the call is running. The lookup results are written to variables, ready to feed into a following component or to test in a **Condition**.

## Configure the component

1. Drag the **Internal Data Ops** component onto the canvas, then click it to open its settings.

   ![The Internal Data Ops block placed on the call flow canvas](/images/pbx/developer-component-cfd.png)

2. In the **Component Type** drop-down list, choose **Get Extension Presence Status**.

   ![Choosing Get Extension Presence Status from the Component Type list](/images/pbx/get-extension-presence-status-cfd.png)

3. Point the component at an extension using one of these methods:

   ![Selecting the target extension for the lookup](/images/pbx/developer-select-ext-cfd.png)

   - **Extension**: pick an extension from the drop-down list.
   - **Expression**: click the *fx* icon and enter an expression to resolve the extension at runtime.

     ![Entering an expression that resolves the target extension](/images/pbx/get-extension-presence-status-expression.png)

     For example, `$Session.ani` uses the caller's own number (Caller ID) as the extension to look up.

   :::tip
   Pick **Extension** when you always want to check the same, fixed extension. Use an **Expression** when the extension to check depends on the call, for example when it should match the caller's own number or a value collected earlier in the flow.
   :::

   :::note
   For the variables and functions you can use in an expression, see [Variables and Functions in Cloud Voice Expression](/pbx/call-flow-designer-guide/constants-and-variables-in-cloud-voice-cfd-expression/).
   :::

4. Click **Confirm** in the bottom-right corner.

## Variables

When you add a Get Extension Presence Status component, it writes the extension's state into the variables below. Read them from any expression-aware component, **Condition**, for instance, to act on what the lookup returned.

:::note
A call flow can hold more than one Get Extension Presence Status component, so each is numbered in the order you add it (Get Extension Presence Status 1, Get Extension Presence Status 2, and so on). Include the matching index in the variable name so you read from the right component.
:::

| Variable | Type | Description | Example |
|----------|------|-------------|---------|
| `$GetExtensionStatus{index}.currentProfileName` | String | The name of the extension's current presence profile. | `"Available"` |
| `$GetExtensionStatus{index}.currentProfile` | String | The name of the current presence profile plus any extra detail attached to it. | `"Available,work"` |
| `$GetExtensionStatus{index}.isUnavailable` | Boolean | Whether the extension is unregistered, meaning no device is currently logged in to it. | `False` |
| `$GetExtensionStatus{index}.isInCall` | Boolean | Whether the extension is on a call. `True` means at least one endpoint registered to the extension is on a call; `False` means none are. | `True` |
| `$GetExtensionStatus{index}.isInRing` | Boolean | Whether the extension is ringing. `True` means at least one endpoint registered to the extension is ringing; `False` means none are. | `False` |

:::note
When you test `currentProfileName` in a function or condition, match one of the presence status names defined under **PBX Settings > Preferences > Presence**.

![The presence profiles available under PBX Settings, Preferences, Presence](/images/pbx/ext-presence-status-cfd.png)
:::

## What it can connect to

A Get Extension Presence Status component leads to **exactly one** downstream component. Any of the following can follow it:

| Component | Purpose |
|-----------|---------|
| [Prompt](/pbx/call-flow-designer-guide/prompt/) | Play an audio file or a text-to-speech message to the caller. |
| [Business Hours](/pbx/call-flow-designer-guide/business-hours/) | Route the call to different destinations depending on the time of day. |
| [Menu](/pbx/call-flow-designer-guide/menu/) | Offer callers a set of options and route them by the key they press (a DTMF, or Dual-Tone Multi-Frequency, tone: the sound a phone makes when a key is pressed). |
| [User Input](/pbx/call-flow-designer-guide/user-input/) | Collect DTMF digits from the caller, usually paired with **Condition** to act on what was entered. |
| [Language](/pbx/call-flow-designer-guide/language/) | Change the system prompt language for the rest of the flow. |
| [Record](/pbx/call-flow-designer-guide/record/) | Start recording once the caller connects to another party, with optional notification prompts, or turn recording off for a call that would otherwise be recorded. |
| [Dial by Number](/pbx/call-flow-designer-guide/dial-by-number/) | Let callers dial a number directly to reach their destination. |
| [Dial by Name](/pbx/call-flow-designer-guide/dial-by-name/) | An end component that lets callers reach a user by typing the first three letters of their name. |
| [Transfer](/pbx/call-flow-designer-guide/transfer/) | An end component that sends the caller to a chosen destination, with optional prompts announcing the transfer. |
| [Hang Up Call](/pbx/call-flow-designer-guide/hang-up-call/) | An end component that disconnects the call. |
| [Condition](/pbx/call-flow-designer-guide/condition/) | Route the call based on logical expressions. |
| [Loop](/pbx/call-flow-designer-guide/loop/) | Repeat a group of components a set number of times or until a condition is met. |
| Internal Data Ops | Read from and write to the Cloud Voice system's own database. See [Get Extension Presence Status](/pbx/call-flow-designer-guide/get-extension-presence-status/), [Set Extension Presence Status](/pbx/call-flow-designer-guide/set-extension-presence-status/), [Get Queue Agent](/pbx/call-flow-designer-guide/get-queue-agent/), [Get Queue Info](/pbx/call-flow-designer-guide/get-queue-info/), [Get Agent Status](/pbx/call-flow-designer-guide/get-agent-status/), [Set Agent Status](/pbx/call-flow-designer-guide/set-agent-status/), [Get System Info](/pbx/call-flow-designer-guide/get-system-info/), [Get System Capacity](/pbx/call-flow-designer-guide/get-system-capacity/), [Get Extension Info](/pbx/call-flow-designer-guide/get-extension-info/), and [Get Company Contact Info](/pbx/call-flow-designer-guide/get-company-contact-info/). |
| [Email Sender](/pbx/call-flow-designer-guide/email-sender/) | Send an email for real-time notifications, alerts, or user-specific information. |
| [Database Access](/pbx/call-flow-designer-guide/database-access/) | Run a SQL operation against an external database during the call flow. |
| [HTTP Request](/pbx/call-flow-designer-guide/http-request/) | Send an HTTP request to an external server to exchange data with a third-party service. |
