Agents on phone calls can take three actions:
EndConversation
: allows the agent to end the call, e.g. if the user says “Goodbye!”
vocode_client.actions.create_action(
request=CreateActionRequest(
type=ActionType.ACTION_END_CONVERSATION
)
)
DTMF
: allows the agent to hit dial tones during a call, e.g. navigating a phone tree
vocode_client.actions.create_action(
request=CreateActionRequest(
type=ActionType.ACTION_DTMF
)
)
TransferCall
: allows the agent to transfer the call to another phone number
vocode_client.actions.create_action(
request=CreateActionRequest(
type=ActionType.ACTION_TRANSFER_CALL,
config=TransferCallActionUpdateParamsConfig(
phone_number="11234567890"
)
)
)
You can attach these as IDs to your phone number agent as follows:
vocode_client.numbers.update_number(
phone_number="11234567890",
inbound_agent=UpdateNumberRequestInboundAgent(
actions=["<ACTION UUID>"]
)
)
You can also add these as actions as raw payloads as follows:
vocode_client.numbers.update_number(
phone_number="11234567890",
inbound_agent=UpdateNumberRequestInboundAgent(
actions=[TransferCallActionUpdateParams(
type=ActionType.ACTION_TRANSFER_CALL,
config=TransferCallActionUpdateParamsConfig(
phone_number="11234567890"
)
)]
)
)