Activating openaigateway

From MiRTA PBX documentation
Revision as of 20:15, 25 April 2026 by Admin (talk | contribs)
Jump to navigation Jump to search

To run OpenAIGateway you need python 3.12 installed. It can be installed only from CentOS 9

 dnf install python3.12 python3.12-pip python3.12-devel
 pip3.12 install poetry
 pip3.12 install uvicorn
 pip3.12 install "uvicorn[standard]"
 pip3.12 install fastapi
 pip3.12 install aiohttp

The OpenAIGateway will be located in /usr/local/openaigateway and will run over port 9088

 poetry run uvicorn src.main:app --host 0.0.0.0 --port 9088

On asterisk, you need to configure the websocket_client.conf

 [openaibridge]                ; The connection name
 type = websocket_client       ; Must be "websocket_client"
 connection_type = per_call_config  ; "persistent" or "per_call_config"
                               ; Default: none
 uri = ws://127.0.0.1:9088     ; The URI needed to contact the remote server.
                               ; If you've enabled tls, use "wss" for the scheme.
                               ; Default: none
 protocols = media             ; The websocket protocol expected by the server.
                               ; Default: none