# Activating openaigateway

This page reorganizes the operational steps for **Activating openaigateway**.

To run OpenAIGateway you need python 3.12 installed. It can be installed only on 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
pip3.12 install aiomysql
pip3.12 install webrtcvad-wheels
```

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
```

You need to configure /usr/local/openaigateway/.env with the MySQL details. If you are running the MySQL server on the default installation, just rename .env.sample in .env

## Current Verification

After applying the change, verify the related MiRTA PBX page, the Asterisk logs, and the relevant Status menu entry. Recheck tenant selection before testing tenant-specific behavior.