﻿# Introduction

When Cloud Softphone apps (both generic Cloud Softphone and white-label apps based on Cloud Softphone) are started for
the first time after installation, they need to be provisioned with graphics theme, configuration data, account
credentials and other parameters.

<iframe width="560" height="315" src="https://www.youtube.com/embed/Rx4hYiRa6Bc?si=xGKaoksUUT-UjIrd" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

## Initial Provisioning

The provisioning process begins when the user enters [Input Parameters for Provisioning](input_params.md) and submits them. There are
several ways how the input parameters may be provided and they are discussed in a separate article about
[Initial Screens](initial_screen_modes.md).

When submitted, the app does a sequence of actions to collect provisioning information from various sources:

1. downloads basic app provisioning from Cloud Softphone portal
2. downloads graphics theme from Cloud Softphone portal
3. optionally, it downloads [Global External Provisioning](global_external_provisioning.md) from a web service given by provider
4. optionally, it downloads account [External Provisioning](external_provisioning.md) from a web service given by provider

**Steps 1) and 2)** download provisioning from Cloud Softphone portal which is common for all users of the same Cloud
Softphone app. It only uses the **cloud ID** as input parameter.

**Step 3)** allows the provider to add or modify some of the provisioned information from step 1) by calling a web
service which receives all input parameters, including the **username** and **password**. and returns a response which
is merged with provisioning from the Cloud Softphone portal. The global exernal provisioning can, for example, set quick
dial items or define new dial actions for the app.

**Step 4)** is another web service implemented by provider. This web service receives all input parameters, including the
**username** and **password** and the response must be [Account XML](../account/account.md) which is merged with common defaults received
from Cloud Softphone portal in step 1). This allows the provider to set user-specific parameters to the account, like
SIP credentials, codec settings, messaging feature etc.

The first two steps run in parallel and they must be executed first, because web service definitions for steps 3 and 4
are returned in the response of Step 1 - they are part of app configuration at Cloud Softphone portal.

When all steps succeed, all the received provisioning information is merged together and saved within the app. The app
is then launched with provisioned settings.

## Reprovisioning

The app keeps the provisioning information up-to-date by periodically checking for changes on Cloud Softphone portal
and optionally also at the web services given by provider. In case the provider changes configuration of the app on
the portal, or via the web service, all the existing apps should get the update within 24 hours by default.

!!! note
    Some providers may request that the app does not contact any 3rd party servers after it has been provisioned, for
    security reasons. In this case, automatic reprovisioning may be disabled completely. It is possible to add a button
    to the app which triggers reprovisioning explicitly.