> ## Documentation Index
> Fetch the complete documentation index at: https://docs.famulor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 3CX Integration

> Connect your 3CX phone system with Famulor AI voice agents via SIP trunking. Step-by-step setup for inbound and outbound calls handled by an AI assistant.

<Warning>
  **Done for you — any region, any country (our EU partner carrier)**

  If you prefer not to configure a SIP trunk or import numbers yourself, our **EU partner carrier** can supply **local numbers in any region and any country**, set up the **SIP trunk**, and **import the connection into Famulor** for you. Provisioning runs **end-to-end through the partner** (carrier-side), so you skip DIY trunk and number import in Famulor.

  * **Custom number region / full-service onboarding:** [Famulor Custom Number Region form](https://tally.so/r/w4bN2Y)
  * **More detail or bespoke options:** [support@famulor.de](mailto:support@famulor.de)
</Warning>

# 3CX

> How to connect your 3CX system with Famulor

<Info>
  **Important:** 3CX systems include many hosting-level and carrier-level settings that can affect the connection.

  We do our best to support you at [support@famulor.io](mailto:support@famulor.io), but due to limited settings available on our side, we cannot guarantee every setup.
</Info>

### Create a trunk in 3CX

In the 3CX admin interface, go to **"Trunks & Chat"** and create a new trunk using **+Trunk**.

<Frame>
  <img src="https://mintcdn.com/famulor/03UTAw3BSJi71Kav/images/famulor_3cx_trunk_create_new_en.png?fit=max&auto=format&n=03UTAw3BSJi71Kav&q=85&s=e2feec0e6025bb306ed1f3b3fdd08762" alt="Create 3CX trunk" width="1024" height="1024" data-path="images/famulor_3cx_trunk_create_new_en.png" />
</Frame>

Choose **"Generic SIP Trunk (IP Based)"**.

<Warning>
  **Plan tier:** Generic SIP Trunk (IP Based) is exposed on hosted 3CX **StartUP Pro** and self-managed/Dedicated installs. The entry-level **StartUP** tier does not expose this template — you'll need to upgrade or use 3CX's SBC.
</Warning>

<Frame>
  <img src="https://mintcdn.com/famulor/03UTAw3BSJi71Kav/images/famulor_3cx_trunk_creation_en.png?fit=max&auto=format&n=03UTAw3BSJi71Kav&q=85&s=e7f326ba4a49d4b80898b5ce419ec65a" alt="Select Generic SIP Trunk" width="1024" height="1024" data-path="images/famulor_3cx_trunk_creation_en.png" />
</Frame>

### Configure the 3CX trunk

1. Choose any trunk name.
2. Add the number through which Famulor should be reachable internally (you will use a prefix in routing later).
3. Set **Registrar** to your individual Famulor SIP address.

<Note>
  **Where to find your SIP address in Famulor:**\
  `Phone Numbers` → `Integrate SIP Trunk` → `Our SIP Address`
</Note>

<Frame>
  <img src="https://mintcdn.com/famulor/03UTAw3BSJi71Kav/images/famulor_3cx_trunk_config_en.png?fit=max&auto=format&n=03UTAw3BSJi71Kav&q=85&s=41801cc67a890945fd47ec295e1c8e2c" alt="Configure 3CX trunk" width="1024" height="1024" data-path="images/famulor_3cx_trunk_config_en.png" />
</Frame>

### Restrict transport protocol to TCP

<Frame>
  <img src="https://mintcdn.com/famulor/03UTAw3BSJi71Kav/images/famulor_3cx_tcp_protocol_en.png?fit=max&auto=format&n=03UTAw3BSJi71Kav&q=85&s=a085d983105855b54af0c7042166a816" alt="Set TCP transport protocol" width="1024" height="1024" data-path="images/famulor_3cx_tcp_protocol_en.png" />
</Frame>

<Note>
  TCP is the safe minimum for LiveKit-based SIP. If your Famulor project advertises a TLS endpoint (`*.sip.livekit.cloud:5061`), you can use TLS for encrypted signaling — but UDP should be avoided because Opus/ICE INVITEs frequently fragment.
</Note>

### Required trunk settings

A few non-default settings on the 3CX side are critical for the trunk to work reliably with Famulor:

* **Type of Authentication:** `Do not require - IP based` (no SIP REGISTER).
* **Disable Registration:** ON. Famulor never sends REGISTER — leaving registration enabled produces silent retries and confuses the trunk state.
* **Audio Codecs:** `PCMA`, `PCMU`, plus RFC2833 / `telephone-event` for DTMF. **Disable Opus and G.722** on this trunk — LiveKit's SIP gateway handles G.711 cleanly, and Opus through 3CX commonly causes one-way audio.
* **No SRV record needed.** A standard A-record resolution of `xxx.sip.livekit.cloud` is sufficient.
* **Self-hosted 3CX behind NAT:** set **Public IP** + **STUN** under SBC settings and forward the RTP UDP range (default `9000–10999`) — even when signaling uses TCP, RTP is UDP.

### Optional: Ensure the correct caller number reaches Famulor

If Famulor is used behind a 3CX phone system, the assistant may receive the 3CX system number instead of the real caller number.\
To avoid this, set **"From: Display-Name"** and **"Remote-Party-ID"** to `OriginatorCallerID` in the SIP trunk.

<Frame>
  <img src="https://mintcdn.com/famulor/03UTAw3BSJi71Kav/images/famulor_3cx_caller_id_settings_en.png?fit=max&auto=format&n=03UTAw3BSJi71Kav&q=85&s=601302596fd8fea3a0b4ac07ee24a885" alt="Set OriginatorCallerID" width="1024" height="1024" data-path="images/famulor_3cx_caller_id_settings_en.png" />
</Frame>

### Create the SIP number in Famulor

After the trunk is set up with your 3CX configuration, you need to import the number into Famulor so we know how to route the call.

1. Open your Famulor.ai Dashboard

2. Navigate to **Phone Numbers**

3. Click on "Integrate SIP trunk"

   <Frame>
     <img src="https://mintcdn.com/famulor/0jdDsYrozVcJpi_3/resources/twillio-import-famulor-sip1.png?fit=max&auto=format&n=0jdDsYrozVcJpi_3&q=85&s=553731c8f0bacc61785083cd0828c3b7" alt="Import numbers into Famulor" width="1482" height="684" data-path="resources/twillio-import-famulor-sip1.png" />
   </Frame>

4. Enter your details according to your 3CX configuration:

   ```
   Number / Name: Use exactly the same number as in your 3CX configuration (e.g., +49 151 12345678).
   Termination URL: The address of your 3CX system, if you want to make outbound calls.
   Username: Leave blank if no username was configured.
   Password: Leave blank if no password was configured.
   ```

   <Frame>
     <img src="https://mintcdn.com/famulor/bEgpS1VdTsHHB0ze/images/famulor_sip_number_integrate.png?fit=max&auto=format&n=bEgpS1VdTsHHB0ze&q=85&s=90ad8f7abe045612e62039f36bee931c" alt="Integrate SIP trunk in Famulor" width="634" height="745" data-path="images/famulor_sip_number_integrate.png" />
   </Frame>

If the number is already taken, choose another one.

### Create an outbound rule in 3CX

Now create an outbound rule that defines when this trunk should be used.\
For example, you can use `999` as a prefix; just make sure those digits are stripped before dialing.

<Frame>
  <img src="https://mintcdn.com/famulor/03UTAw3BSJi71Kav/images/famulor_3cx_outbound_rule_en.png?fit=max&auto=format&n=03UTAw3BSJi71Kav&q=85&s=d012a2d0c5dbab5dd92027a098fe959f" alt="Create outbound rule" width="1024" height="1024" data-path="images/famulor_3cx_outbound_rule_en.png" />
</Frame>

**Important:** Place this outbound rule above other rules that could otherwise override it.

<Frame>
  <img src="https://mintcdn.com/famulor/CpwTmIkB47OlJiyb/images/famulor_3cx_outbound_rule_order.png?fit=max&auto=format&n=CpwTmIkB47OlJiyb&q=85&s=9012df2a303a09e63a54e99b7f809d60" alt="Outbound rule order" width="1024" height="1024" data-path="images/famulor_3cx_outbound_rule_order.png" />
</Frame>

### Inbound DID routing

To make an external call to a 3CX-hosted DID actually reach Famulor, route the DID through the outbound trunk you just created. In 3CX:

1. Go to the DID's **Inbound Rule** (or the user/queue that owns the DID).
2. Set **"Office Hours"** and **"Out of Office"** routing destinations to **"External"** with the dial string `999<your-famulor-number>` (using the prefix from the outbound rule above).
3. The outbound rule strips the `999` prefix and sends the call to Famulor.

This is what actually closes the loop — without it, the outbound rule exists but no inbound traffic ever uses it.

### Outbound from Famulor → 3CX

When Famulor places an outbound call (for example a Make-phone-calls assistant), it talks to your 3CX trunk over the same SIP host. Make sure 3CX accepts those INVITEs:

* Either add Famulor's current SIP egress IP ranges to the trunk's allow-list (request the list from Famulor support), or
* Provision Digest credentials on the 3CX side and enter them in Famulor's **Username / Password** fields when importing the number.

### Using the number

You can now use this number, for example, in absence routing or other 3CX routing rules.

<Frame>
  <img src="https://mintcdn.com/famulor/CpwTmIkB47OlJiyb/images/famulor_3cx_number_usage.png?fit=max&auto=format&n=CpwTmIkB47OlJiyb&q=85&s=161bbd56dd58ee0b8f9120c5c7c627b4" alt="Use number in 3CX" width="1024" height="1024" data-path="images/famulor_3cx_number_usage.png" />
</Frame>

<Tip>
  Related pages: [SIP Integration](/en/provisioning/sip-ai/sip-integration) and [SIP Troubleshooting](/en/provisioning/sip-ai/sip-troubleshooting).
</Tip>
