set_voicemail_action()
set_voicemail_action() tells the agent what to do if it reaches an answering machine. Call it before reach_person() so the behavior is set when the machine is detected.
signature
call.set_voicemail_action(
hangup: bool = False,
message: str | None = None,
)Example
example.py
@agent.on_call_start
def on_call_start(call: guava.Call):
call.set_voicemail_action(
message="Hi, this is Alex from Bright Smile Dental. Please call us back at 555-0100 to confirm your appointment.",
)
call.reach_person(
contact_full_name=call.get_variable("contact_name"),
)Tip: You must specify exactly one of hangup or message — passing both or neither raises an error.
Questions? hi@goguava.ai
call.set_voicemail_action(
hangup: bool = False,
message: str | None = None,
)@agent.on_call_start
def on_call_start(call: guava.Call):
call.set_voicemail_action(
message="Hi, this is Alex from Bright Smile Dental. Please call us back at 555-0100 to confirm your appointment.",
)
call.reach_person(
contact_full_name=call.get_variable("contact_name"),
)