Ways to use the Call Control Feature
# support
s
https://docs.vapi.ai/calls/call-features#call-control-feature Could you please share a documentation link or a list of all the possible actions that can be performed during a call using the
/control
endpoint? I’d love to learn more about the possibilities and the scenarios where this feature can be applied.
@Vapi Support Bot
@Vapi
@User
v
Hi there! 👋 I found information about Vapi's Call Control Feature and the
/control
endpoint. Here's what I can share: ## Documentation You can find the documentation for the Call Control Feature here: [Vapi's Call Features Documentation](https://docs.vapi.ai/calls/call-features) ## Actions with the
/control
Endpoint Based on the documentation, the primary action you can perform is message injection into an ongoing call:
Copy code
bash
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control' \
-H 'content-type: application/json' \
--data-raw '{
  "type": "say",
  "message": "Welcome to Vapi, this message was injected during the call."
}'
This allows you to dynamically inject a text message to be spoken during the call. ## Use Cases & Scenarios The
/control
endpoint can be useful in several scenarios: 1. Injecting real-time information into ongoing calls 2. Live adjustments and real-time responses to modify conversation flow 3. Dynamic interactions based on call status - triggering different conversation paths based on caller responses For example, in customer support scenarios, you could inject pre-defined answers live to reduce call handling time and improve support efficiency. ## Getting Started To use this feature, you first need to obtain the
controlUrl
by sending a POST request to the
/call
endpoint. The response will include this URL in the
monitor
object. I should note that the documentation doesn't explicitly list other specific commands or actions beyond the "say" action for injecting messages. If you need more advanced functionality, you might want to explore the documentation further. Sources: - [Vapi's Call Features Documentation](https://docs.vapi.ai/calls/call-features) - [Vapi's Call Control Feature](https://docs.vapi.ai/changelog#advanced-call-control)
s
@Shubham Bajaj could you please support me?
s
The
/control
endpoint allows you to dynamically control ongoing calls. Here's a list of the possible actions you can perform: ## Basic Call Control Actions 1. Say a Message - Type:
say
- Purpose: Inject a message to be spoken during the call - Example:
Copy code
json
     {
       "type": "say",
       "message": "Welcome to Vapi, this message was injected during the call."
     }
2. Control Assistant State - Type:
control
- Actions: - `mute-assistant`: Mute the assistant - `unmute-assistant`: Unmute the assistant - `say-first-message`: Say the first message (used when video recording is enabled) - Example:
Copy code
json
     {
       "type": "control",
       "control": "mute-assistant"
     }
3. Phone Call Control - Type:
phone-call-control
- Actions: - `forward`: Forward the call to another number - `hang-up`: End the call - Example:
Copy code
json
     {
       "type": "phone-call-control",
       "request": "forward",
       "destination": {"number": "+1234567890"}
     }
4. Add Message to Conversation - Type:
add-message
- Purpose: Add a message to the conversation context - Example:
Copy code
json
     {
       "type": "add-message",
       "message": {
         "role": "assistant", 
         "content": "content"
       },
       "triggerResponseEnabled": true
     }
## How to Use Call Control 1. First, obtain the
controlUrl
by making a call to the
/call
endpoint 2. Once you have the
controlUrl
, you can make POST requests to it with the appropriate action payload 3. The actions will be applied in real-time during the ongoing call ## Example Use Cases - Inject information or instructions during a call - Mute/unmute the assistant for certain portions of a call - Forward calls to human agents when necessary - Hang up calls programmatically - Add context to the conversation that wasn't provided by the user ## Enabling Call Control To enable live call control: 1. Set
monitorPlan.controlEnabled
to
true
in your assistant configuration 2. Obtain the
controlUrl
from the call response 3. Send your control commands to that URL
s
Tks so much
How can I use this approach to add more callers' context?
Copy code
json
{
  "type": "add-message",
  "message": {
    "role": "assistant", 
    "content": "content"
  },
  "triggerResponseEnabled": true
}
Something like
Copy code
json
{
            "firstName": "Seygi",
            "lastName": "Alberto",
            "fullName": "Seygi Alberto"
}
My goal is to enrich inbound calls by adding more information about the caller. I don’t want to use
assistant-request
because we don’t want to delay the call while retrieving the caller’s information. Instead, we want to collect and add this information during the ongoing call.
s
Use message.role = "system" and add instructions on how to use it in the content.
s
what is the difference between
triggerResponseEnabled
true or false?
k
Hey Seygi, That boolean value decides if the agent generates a response or not. Feel free to shoot any other questions over!
4 Views