Dynamic Variables in Call Sessions
Variables are pieces of data that can be dynamically inserted during call sessions. They can now be embedded within different parts of a call flow, including prompts, agent messages, webhook parameters, and function calls. This flexibility allows developers to build richer and more responsive interactions for their agents.
In every call, there are predefined variables like FromPhone
and ToPhone
(representing the originating and receiving phone numbers for phone calls). Additionally, you can utilize any key-value pairs from the metadata that you provide for the call.
For example, if you include custom information like customerID
, appointmentTime
, or any other data that you may want to reference throughout the call, these can now be easily used.
Millis supports a simple syntax for using variables. Just wrap the variable name in curly braces like {<variable>}
, and our system will automatically replace it with the corresponding value during the call. Here are a few examples:
{FromPhone}
as the description of the function’s param.”{userName}! How can I assist you today?
.”phone_number={FromPhone}
.Millis offers both default variables and dynamic variables for customizing call sessions:
FromPhone
and ToPhone
, which represent the caller’s phone number and the receiving phone number, respectively, when the call is made via a phone network.{<variable>}
in the description of the parameter. For instance, if the parameter name is phone_number
, you can set the parameter description to {FromPhone}
to automatically include the caller’s phone number.
{userName: <real user name>}
to metadata, then set the agent’s greeting line to: Hi {userName}! How can I help you?
. This can also be applied to the agent’s prompt.