# WSI: Pub/Sub

PortSIP PBX provides a Publish/Subscribe (Pub/Sub) mechanism over WebSocket, known as PortSIP WSI. This mechanism allows applications written in any programming language to subscribe to PBX events.

When a subscribed event occurs, PortSIP PBX automatically pushes event notifications to the client in JSON format, enabling real-time, event-driven integrations without polling.

***

### Supported Versions

* PortSIP PBX v16.0 or later

***

### Service Port

PortSIP PBX (including UCaaS deployments) exposes the WSI service using **secure WebSocket (WSS)**:

* **Port:** `8887`
* **Protocol:** WSS (WebSocket over TLS)
* **Firewall Requirement:**\
  The server firewall must allow **TCP traffic on port 8887**.

***

### Server URL

The WSI server URL depends on the PortSIP PBX version:

* **v22.0 or later**

  ```
  wss://pbx.portsip.com:8887/wsi
  ```
* **v16.x**

  ```
  wss://pbx.portsip.com:8885
  ```

> **Note:** Replace `pbx.portsip.com` with your **actual PBX domain or IP address** when configuring your WebSocket client.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.portsip.com/development-portsip/going-real-time-with-portsip-pbx-pub-sub.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
