> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oduist.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Automatic SIP users provisioning

> Auto-create PBX users and generate SIP peers for Asterisk from Odoo.

# Automatic SIP users provisioning

## Enable auto provision

PBX → Settings → Server:

* Turn on **Auto create PBX users** to create/delete PBX users when Odoo users are added/removed from the PBX User group.
* Turn on **Generate SIP peers** to let Asterisk fetch SIP peers from Odoo (uses a SIP peer template and a security token).

## How it works

* New Odoo account in PBX User group → gets next free extension; PBX user created.
* Odoo account removed/deleted → PBX user deleted.
* SIP peers are generated from the template; protect access with the security token.

## Asterisk side

1. Download `get_odoo_conf.sh` (from [https://gist.github.com/asteriskauto/698b78e34eb44a2b43367223886e57c3](https://gist.github.com/asteriskauto/698b78e34eb44a2b43367223886e57c3)) to `/etc/asterisk/` and `chmod +x get_odoo_conf.sh`.
2. In `pjsip_wizard.conf`:

```
#exec /etc/asterisk/get_odoo_conf.sh
```

3. In `asterisk.conf [options]` ensure:

```
execincludes = yes
```

4. Reload Asterisk; SIP peers should appear. If Odoo is down during reload, the previous SIP accounts remain.
