I have an Odoo server running behind a proxy server and Nginx. I’m trying to integrate it with Oduist PBX (FreePBX + Agent).
The agent container is starting successfully, connecting to both Odoo and the FreePBX AMI without issues. Logs from the agent show:
agent-1 | 2025-09-01 06:04:42,234 - root:1049 - INFO - Starting the application.
agent-1 | 2025-09-01 06:04:42,234 - root:1049 - INFO - Starting the application.
agent-1 | 2025-09-01 06:04:42,237 - __main__:125 - INFO - Config file loaded.
agent-1 | 2025-09-01 06:04:42,237 - __main__:125 - INFO - Config file loaded.
agent-1 | 2025-09-01 06:04:42,238 - __main__:612 - INFO - Connecting to Odoo at https://example.com
agent-1 | 2025-09-01 06:04:42,238 - __main__:612 - INFO - Connecting to Odoo at https://example.com
agent-1 | 2025-09-01 06:01:15,830 - __main__:620 - INFO - Connected to Odoo.
agent-1 | 2025-09-01 06:01:15,830 - __main__:620 - INFO - Connected to Odoo.
agent-1 | 2025-09-01 06:01:16,214 - __main__:672 - INFO - Downloaded event handlers.
agent-1 | 2025-09-01 06:01:16,214 - __main__:672 - INFO - Downloaded event handlers.
agent-1 | 2025-09-01 06:01:16,215 - __main__:312 - INFO - Connecting to AMI at asterisk_plus@localhost:5038
agent-1 | 2025-09-01 06:01:16,215 - __main__:312 - INFO - Connecting to AMI at asterisk_plus@localhost:5038
agent-1 | 2025-09-01 06:01:16,216 - __main__:543 - INFO - Starting FastAGI server on 0.0.0.0:44574
agent-1 | 2025-09-01 06:01:16,216 - __main__:543 - INFO - Starting FastAGI server on 0.0.0.0:44574
agent-1 | 2025-09-01 06:01:16,217 - __main__:547 - INFO - Register FAGI route: route_did
agent-1 | 2025-09-01 06:01:16,217 - __main__:547 - INFO - Register FAGI route: route_did
agent-1 | 2025-09-01 06:01:16,220 - __main__:166 - INFO - Security rules not enabled.
agent-1 | 2025-09-01 06:01:16,223 - panoramisk.manager:57 - INFO - protocol version: '9.0.0'
agent-1 | 2025-09-01 06:01:16,223 - panoramisk.manager:112 - INFO - Sending awaiting actions
agent-1 | 2025-09-01 06:01:16,223 - __main__:323 - INFO - AMI connected.
agent-1 | 2025-09-01 06:01:16,224 - __main__:336 - INFO - Register AMI event: VarSet
agent-1 | 2025-09-01 06:01:16,225 - __main__:336 - INFO - Register AMI event: UserEvent
agent-1 | 2025-09-01 06:01:16,226 - __main__:336 - INFO - Register AMI event: Newchannel
agent-1 | 2025-09-01 06:01:16,226 - __main__:336 - INFO - Register AMI event: Hangup
agent-1 | 2025-09-01 06:01:16,226 - __main__:336 - INFO - Register AMI event: OriginateResponse
agent-1 | 2025-09-01 06:01:16,228 - __main__:336 - INFO - Register AMI event: Newstate
agent-1 | 2025-09-01 06:01:16,230 - __main__:254 - INFO - Starting HTTP server for AMI actions at 0.0.0.0:48000
However, when I try to ping the agent from Odoo, I receive the following error:
HTTPSConnectionPool(host='example.com', port=48000): Max retries exceeded with url: /app/asterisk_plus/agent (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7206c5653430>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
What I’ve observed so far:
- The agent is successfully connected to the AMI on FreePBX.
- Port 48000 is listening inside the agent container (0.0.0.0:48000).
- The issue appears to be with Odoo being unable to reach the agent when using the proxy/Nginx.
Question:
How should I properly expose or proxy the agent’s HTTP server (running on port 48000) so that Odoo, which is behind Nginx and a proxy, can communicate with it? Do I need to configure a reverse proxy rule in Nginx for port 48000, or should this be handled differently?
Any guidance on the correct network/proxy setup would be appreciated.