### Precedence Rules

When handling events in call flows, the Voice API applies the following precedence rules to determine which SVAML commands are executed:

- **Command-Level Event Handlers:**
If an event handler (e.g., `on_answer`, `on_machine`) is defined directly within a SVAML command, the commands specified in that handler are executed first for that event.
- **Service Configuration Fallback:**
If the event handler is not defined in the SVAML command, the API falls back to the event handler defined in the service configuration. This allows default behaviors for events to be set at the service level.
- **Execution Order:**
  - Command-level event handlers always take priority over service-level handlers.
  - If neither is defined, the event is ignored and no commands are executed for that event.


**Best Practice:**
Define event handlers in SVAML commands for custom, per-call logic. Use service configuration event handlers for default or global behaviors across all calls.