﻿
# Controlling Cloud Softphone Features with the ACROBITS_CONFIG UI Config (NetSapiens)

If your Cloud Softphone runs on NetSapiens, you can control which platforms and features each user
gets. You do this with a NetSapiens UI config named `ACROBITS_CONFIG`.

## How it works

UC Connector reads the `ACROBITS_CONFIG` that applies to a user when the user first signs in and
again at every reprovisioning. It uses the config to **restrict** what your Cloud Softphone settings
allow. It can also attach your own labels to the user (see [Labels](#labels-customkeys)).

!!! warning

    `ACROBITS_CONFIG` can't enable a feature that isn't enabled for your Cloud Softphone.
    For example, `"messagingEnabled": true` has no effect if Linkup Messaging isn't enabled for your Cloud Softphone.

## Options

| Option | Type | Default | Description |
|---|---|---|---|
| `mobileAllowed` | boolean | `true` | Whether the user can sign in on iOS and Android. |
| `desktopAllowed` | boolean | `true` | Whether the user can sign in on macOS and Windows. |
| `messagingEnabled` | boolean | `true` | Whether Linkup Messaging is available to the user. |
| `conferencingEnabled` | boolean | `true` | Whether Linkup conferencing is available to the user. |
| `customKeys` | object | – | Your own labels for the user. See [Labels](#labels-customkeys). |
| `additionalParameters` | object | – | Custom values added to the user's account configuration. See [Account parameters](#account-parameters-additionalparametersaccount). |

You can leave out any option. An omitted option keeps its default.

## Labels (customKeys)

`customKeys` is an optional object. Use it to define labels for your users. Write each label name
and value as a JSON string, for example:

```json
"customKeys": {"tier": "basic", "team": "sales"}
```

Labels have no effect on their own. Acrobits can use them to:

- apply account settings or app preferences to matching users
- tailor access to selected features available for your Cloud Softphone

For example, Acrobits can apply a different setting for users with the label `"tier": "basic"`.
To get started, contact Acrobits support with your label names and values, and the behavior you want.

!!! warning

    Write each label value as a quoted JSON string. If a value is an object or array, the whole
    `ACROBITS_CONFIG` counts as missing, including any other options in it.

## Account parameters (additionalParameters.account)

Use the optional `additionalParameters.account` object to add custom values to the user's account
configuration. UC Connector adds `acrobitsConfig_` to the start of each key. For example:

```json
"additionalParameters": {"account": {"region": "eu"}}
```

sets `acrobitsConfig_region` to `eu`.

Use key names made of letters, digits and underscores only, such as `region` or `sales_team`. Other
characters, such as spaces, can break provisioning. If your account configuration already has a
key with the same prefixed name, the values collide, so choose names whose prefixed form is unique.

Once the app has applied the account configuration, you can reference a value in fields that support
account placeholders. For example, use `%account[acrobitsConfig_region]%` as a query parameter value
in a supported web service URL. See [Placeholders](../frameworks/placeholders.md).

If you remove a parameter from `ACROBITS_CONFIG`, users who are already signed in may keep its
previous value in the app.

!!! warning

    Write each value as a quoted JSON string, and don't use sensitive data. If a value is an object
    or array, the whole `ACROBITS_CONFIG` counts as missing, including any other options in it.

## What users see

- **Disallowed platform:** a new user can't finish setup on that platform. A user who is already
  signed in is signed out at the next reprovisioning.
- **Disabled feature:** the feature isn't available in the app.

Changes to the config, and to any label-based rules, can take effect without a new sign-in. They
apply once NetSapiens returns the updated config on a reprovisioning request and the app applies the
response.

## When no config applies

By default, if no `ACROBITS_CONFIG` applies to a user, the user isn't restricted by it. Your Cloud
Softphone settings apply as usual.

Acrobits can also set up your Cloud Softphone to **require** `ACROBITS_CONFIG`. Then a user with no
config can't sign in, and a user who is already signed in is signed out at the next reprovisioning.
To turn this on, contact Acrobits support.

!!! note

    A config with invalid JSON in its value counts as missing.

## Setting the UI config

Create a UI config on your NetSapiens server:

- **Config name:** `ACROBITS_CONFIG`
- **Config value:** the options as JSON text. When you send the UI config as a JSON payload, as in
  the example below, escape the quotes inside that text (`"` → `\"`).
- **Scope:** the NetSapiens UI config fields `reseller`, `domain`, `user`, `role`, `login_type` and
  `hostname`. NetSapiens decides which configs match a user.

!!! warning

    Make sure only one `ACROBITS_CONFIG` matches each user. If NetSapiens returns more than one
    matching config, for example one for a domain and one for a user in that domain, UC Connector
    doesn't merge them or pick the most specific one. It uses the first one returned, so you can't
    rely on which one is used.

### Example: desktop disabled, no conferencing, labelled as a sales user

```json
{
  "config_name": "ACROBITS_CONFIG",
  "config_value": "{\"mobileAllowed\":true,\"desktopAllowed\":false,\"conferencingEnabled\":false,\"customKeys\":{\"team\":\"sales\"}}",
  "domain": "example-domain",
  "user": "1001",
  "reseller": "*",
  "role": "*",
  "login_type": "*",
  "hostname": "*",
  "description": "Sales user, desktop disabled"
}
```

