# Connect FreePBX

> Install the ActiveLens connector on your FreePBX or Asterisk phone system, and its recorded calls arrive in ActiveLens by themselves.

Source: https://app.activelens.ai/help/connect-freepbx

FreePBX runs on your own server, so ActiveLens connects to it the other way
round: you install a small connector on the PBX, and it sends each recorded
call to ActiveLens over a secure connection. Nothing needs to reach your PBX
from outside — no open ports, no firewall changes.

An admin sets it up once for the whole workspace, from **Integrations →
FreePBX**.

## Before you start

- FreePBX 16 or 17.
- Call recording switched on for the extensions whose calls you want in
  ActiveLens. Only recorded calls can come across.
- SSH access to the PBX as root.
- The PBX can reach the internet over HTTPS.

## Connect your PBX

1. On the FreePBX page, name the PBX and press **Create a connector key**.
2. Copy the key straight away — it is shown only once.
3. Copy the install command from the page, and run it on the PBX as root.
4. When the installer asks for the connector key, paste it. The key is never
   typed on the command line, so it stays out of your shell history.

Within a few minutes the PBX's card on the page says **Connected**, and the
extensions it found appear under **People**. Each PBX has its own card and
its own key; a workspace can connect up to 10.

## Link your people

Each extension's calls go to the ActiveLens user it is linked to. Under
**People**, pick a colleague who is already in the workspace, or invite
someone by email — the email FreePBX holds for the extension is offered
first. One person can hold several extensions. An extension nobody is linked
to brings no calls in.

Each person's **Call sync** switch decides whether their calls come across.

## Import earlier calls

The **Import call history** card gives you a command to run on the PBX. It
sends the recordings of the last 7, 14 or 30 days, oldest first, and skips
calls already in ActiveLens. During a trial, imported calls count toward the
trial's monthly calls; calls past that are left out.

## Switch it off or disconnect

- **Sync calls** on a PBX's card stops new calls arriving at once; switch it
  back on to carry on.
- **Call records** adds every call's outcome — answered or missed, and how
  long callers waited — to the Dashboard, recorded or not.
- **Rotate key** replaces the key. The old one stops working immediately, so
  run the installer again and paste the new key.
- **Disconnect** stops the key working for good. Then remove the connector
  from the PBX with the uninstall command the page shows. Calls already in
  ActiveLens stay.

## Troubleshooting

- **The card keeps waiting for the connector.** Run
  `sudo activelens-freepbx status` on the PBX — it shows the connector's
  settings, its last check-in and the last problem it met.
- **The card says it has not heard from the PBX.** Check that the PBX is
  running and can reach the internet over HTTPS.
- **A call is missing.** Only recorded calls of linked extensions come
  across; very short calls and calls between two extensions are skipped.

## Related

- [Connect an integration](/help/connecting-an-integration)
- [My call did not appear](/help/call-not-showing-up)
