All Collections
Asterisk Plus
Automatic SIP users provisioning
Automatic SIP users provisioning

How to enable and manage SIP users from Odoo

Max Li avatar
Written by Max Li
Updated over a week ago

Introduction

Creating SIP (Session Initiation Protocol) users is a foundational step in setting up a robust and efficient communication system within organizations. Traditionally, this process involves a detailed, manual configuration at both the server level, typically on an Asterisk PBX (Private Branch Exchange) system, and on the individual phones themselves. For system administrators, this can be a time-consuming and complex task, requiring precise coordination to ensure that each SIP user is correctly set up to make and receive calls seamlessly.

However, the advent of the SIP users auto-provision feature marks a significant leap forward in simplifying this process. This innovative feature automates the creation of SIP accounts, eliminating the need for manual input at every step and significantly reducing the setup time. In this article, we explore how the SIP users auto-provision feature transforms this task, offering a streamlined, efficient, and error-free method. By automating the provisioning of SIP accounts, organizations can now enjoy a faster, more reliable setup process, allowing system administrators to focus on other critical aspects of their communication infrastructure.

Enabling SIP users auto provision

PBX -> Settings -> Server

How it works

  • When Auto create PBX users feature is enabled, PBX users are automatically created or removed in the following cases:

    • New Odoo account is created, and PBX User group is selected -> User will automatically get next free extension number.

    • Odoo account is deleted -> PBX user is also deleted. Actually, the PBX user is always deleted when the corresponding Odoo user is deleted.

    • Odoo account is added to the PBX User group -> a new PBX User record is created for this Odoo account.

    • Odoo account is removed from the PBX User group -> the corresponding PBX record is deleted.

  • When Generate SIP peers record is enabled, Asterisk can fetch SIP peers from Odoo.

    • SIP peer template is used to generate SIP peer data.

    • Security token is used to protect unauthorized access to SIP peers. Make sure it is passed secretly to the Asterisk side.

Asterisk side configuration

In oder to fetch SIP peers download the following script and save it in your /etc/asterisk/ folder, and make it executable:

chmod +x get_odoo_conf.sh

Then edit your pjsip_wizard.conf and put the following record at the end:

#exec /etc/asterisk/get_odoo_conf.sh

Replace your-agent-token to the real security token from the server settings form.

Also make sure you have execincludes = yes in your asterisk.conf [options] section.

Finally, connect to your Asterisk CLI, reload the configuration and see if your SIP peers appeared.

If Odoo is temporary down when you reload the configuration, the previous version of the SIP accounts is still available!

Did this answer your question?