```python
call.set_voicemail_action(
    hangup: bool = False,
    message: str | None = None,
)
```

```typescript
await call.setVoicemailAction(
  action: { hangup: true } | { message: string },
): Promise<void>
```

### Example in Python

```python
@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.",
    )
```

### Example in TypeScript

```typescript
agent.onCallStart(async (call: guava.Call) => {
  await call.setVoicemailAction({
    message: "Hi, this is Alex from Bright Smile Dental. Please call us back at 555-0100 to confirm your appointment.",
  });
});
```

## set_voicemail_action()

`set_voicemail_action()` tells the agent what to do if it reaches an answering machine.

**Warning:** `set_voicemail_action()` and `reach_person()` both handle voicemail and **cannot be used together**. If you are using `reach_person()`, set voicemail behavior there via its `voicemail_message` or `voicemail_hangup` parameters instead. Using both raises an error.

### Tips
You must specify exactly one of `hangup` or `message` — passing both or neither raises an error.
