# Essential Use Cases
## Voicebots / Virtual Agents
Let your voicebot increase self-service rates of standard queries, transactions and business processes.
The core of a voicebot is a text-based chatbot. But the environment of a chatbot and a voicebot is very different. If you just simply turn your chatbot into voice without adjusting your product, some users will be disapointed by their voicebot experience.
Please be aware that there are no visual elements like menu buttons, lists, quick replies or carousels like the GUI provided by text chatbots. Instead, voicebot just provide a voice user interface (VUI). Producers have to carefully consider how users could understand what particular services a voicebot can offer.
The general sequence diagram of a voicebot looks like this:
```mermaid::
sequenceDiagram;
Caller->>CVG: Phone Call
CVG->>Bot: POST /session
loop dialog between Caller and Bot
Bot->>CVG: POST /call/say
note left of Bot: text
CVG->>Caller: audio announcement
note right of Caller: speech
alt something is said
Caller->>CVG: some utterance
note right of Caller: speech
CVG->>Bot: POST /message
note left of Bot: text
else nothing is said
note right of Bot: inactivityTimeout
defined in CVG project
CVG->>Bot: POST /inactivity
end
end
Bot->>CVG: POST /call/say
note right of Bot: final words of Bot
in this dialog
Bot->>CVG: POST /call/drop
CVG->>Caller: Phone Call on CVG dropped
```
### Call-Transfer from 3rd party IVRs/ACDs to your Voicebot
The following sequence diagram shows the general flow for handling a call that
* is first accepted by a 3rd party ACD/IVR system and processed there (e.g. for greetings, notes on data protection, classic IVR features)
* is then passed on to CVG - and thus the bot - for further processing (e.g. for pre-qualification, automatic processing of standard requests or outside hotline opening hours)
* and finally returned to the 3rd party IVR/ACD (after case completion by the bot or for transferring the call to a hotline with human agents)
```mermaid::
sequenceDiagram;
Caller->>ACD/IVR: Phone Call
ACD/IVR->>CVG: POST /provision/call
CVG-->>ACD/IVR: Response with CVG phone number
ACD/IVR->>CVG: Forward Phone Call
CVG->>Bot: POST /session
loop dialog between Caller and Bot
Bot->>CVG: POST /call/say
alt something is said
CVG->>Bot: POST /message
else nothing is said
note right of Bot: inactivityTimeout
needs to be defined
in initial
POST /provision/call
request
CVG->>Bot: POST /inactivity
end
end
Bot->>CVG: POST /call/say
note right of Bot: final words of Bot
in this dialog
note right of CVG: set EndReason
to handover control
to ACD/IVR
Bot->>CVG: POST /dialog/.../data
Bot->>CVG: POST /call/drop
CVG->>ACD/IVR: Phone Call on CVG dropped
ACD/IVR->>CVG: GET /dialog
CVG-->>ACD/IVR: Response includes dialog and EndReason
ACD/IVR->>CVG: DELETE /dialog
note over Caller, ACD/IVR: Depending on EndReason either
call termination
(case-closing processing by the bot)
or caller gets connected
with relevant skill group
of ACD (bot2agent transfer)
```
The beginning of the dialog and the actual dialog between Caller and Bot does not differ from the bot's point of view from a caller who was directly accepted by CVG and is processed by the bot.
However, at the end of the bot's dialog it is now absolutely necessary for the bot to give ACD/IVR a hint on how to proceed with the caller. For this purpose, appropriate key/value pairs must be agreed upon between the bot developer and IVR/ACD, e.g. routing/skill group. These key value pairs can be transferred between bot and ACD/IVR via CVG's [Dialog API](/specs/?urls.primaryName=Dialog%20API).
When the bot calls the end point /call/drop, in conjunction with an ACD/IVR, this does not automatically mean that the call is hung up. In interaction with the IVR/ACD, the call is terminated on the CVG side and the call is returned to the IVR. The ICR/ACD uses the information provided by the bot to decide how to handle the call, e.g. whether it should be transferred to a hotline with human agents or whether it should actually be terminated.
### Adding information when transferring a Call
In some use cases ACD/IVR already has more detailed information about the call that should be transmitted to the bot so that it can target the call processing accordingly.
Note
A simple example is that the caller wants to change a subscription. ACD/IVR already knows which of the subscriptions offered by the company is concerned via the called ACD/IVR number or a classic IVR dialog.
Tip
Contact us to enable outgoing calls for your CVG project. Initiating outgoing calls is disabled by default.
Transfer Custom Data from Bot to Called Party
Use SIP Custom headers to transfer some custom data from your bot to the called party when initiating the call via the SIP protocol. In the [Call API](/specs/?urls.primaryName=Call%20API), endpoints that initiate outgoing calls ([`dial`](/specs/#/call/dial), [`forward`](/specs/#/call/forward) and [`bridge`](/specs/#/call/bridge)) can specify `customSipHeaders`. The called SIP application can read these SIP headers. One possible use case is to route the call to the right skill-group based on the content of the custom header fields. Also the `Start` entry in the [Dialog API](/specs/?urls.primaryName=Dialog%20API) includes the `customSipHeaders`.