Odoo Configuration

This article describes how Odoo must be configured for the Asterisk Plus application

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

Odoo should be configured correctly for Asterisk Plus module.

HTTPS redirect

If you use Nginx or other proxy to automatically redirect from http to https make sure to use “308 Permanent Redirect” and not “301 Moved Permanently” otherwise the Agent will not be able to connect. This issue happens because of request body modification, for details see HTTP / Redirections.

Workers

Workers are Odoo processes that handle requests. Asterisk Plus module handles many short-running requests coming from Asterisk. So your Odoo should be configured with at least 2 workers (but 4 workers is the minimum recommended).

Warning

If you use odoo.sh with 1 worker configured it is possible to get issues related to performance.

Live notifications, popups and automatic form opening

Internal gevent-based server must be enabled (aka long polling) for popup notifications and live channels reload to work.

When you enable workers gevent server is also enabled.

By default port 8072 is used and you can check it with:

netstat -an | grep LISTEN | grep 8072

on your Odoo server.

If you don’t use a proxy (apache / nginx / etc) then you should open Odoo on gevent’s port e.g.: http://127.0.0.1:8072/web.

If you run Odoo behind a proxy be sure to add a different proxy handler for the /longpolling/poll URL (and /websocket starting from Odoo 16.0). Here is a snippet for Nginx:

# Odoo up to 15.0 version
location /longpolling/poll {
proxy_pass http://127.0.0.1:8072;
}

# Odoo from 16.0 versiion
location /websocket {
proxy_pass http://127.0.0.1:8072;
}

For more details see:

If you see Exception: bus.Bus unavailable in your Odoo log then it means you did not set long polling right.

Multi database setup

If your Odoo is limited to just one database (dbfilter configuration option is set and list_db is set to False) then you can skip this step. Otherwise you should add asterisk_plus to server_wide_modules parameter in order to be able to make CURL requests from the Asterisk dialplan (see below). Here is an example of such a configuration line:

server_wide_modules = base,web,asterisk_plus

Prepare a directory for a new addon

Preapare a folder where you will place Asterisk Plus module. Make sure this folder is listed in addons_path configuration option.

Troubleshooting

I don’t get popup notifications.

The most likely you the long polling mode is not enabled or nginx proxy is not correctly setup for long polling. Check workers settings in your odoo.conf.

Did this answer your question?