> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt. # 3CX > Connect 3CX to Synthflow via SIP so 3CX call traffic can be routed through AI agents and back to your system. 3CX connects to Synthflow over a SIP trunk. This setup covers two call directions: from 3CX to a Synthflow agent, and from a Synthflow agent to the PSTN. 3CX only lets you add trunks from the approved providers listed under **SIP Trunk** in its settings. Synthflow is not a telephony provider, so it is not on that list. Instead, you create a trunk from a listed provider's template, in this guide Twilio, and point it at Synthflow. ## Prerequisites * An Enterprise plan. * An external number and a SIP trunk with your telephony provider. * Access to the 3CX Admin Console. * A Twilio account. This guide uses Twilio as the trunk template and as the provider for outbound calls. ## SIP trunk to Synthflow 1. In the 3CX Admin Console, open **Add Trunk** and choose Twilio (Auto) as the provider. ![](https://files.readme.io/ee30f5efb6351813c0307780688b5312f89cf8d3d557cd7a68c87b3961b4a7cc-image.png) 2. Connect your Twilio account. ![](https://files.readme.io/e06ed7e953c88cb532cea5d33159ec7070b848c09e6a243aa288a3742fed7281-image.png) 3. Open **Edit trunk** and replace Twilio's URI with Synthflow's. ![](https://files.readme.io/d012332a92fbb368328132e6ee56b7acd304ec802bcb6d93e41546c15d561623-image.png) 4. Set **Server** to `sip.synthflow.ai` and **Port** to `32681`. If your workspace is in the US or EU region, use your region's [SIP address](/connect-over-sip#sip-addresses) instead. 5. Save the changes. 3CX can now send calls to Synthflow through this trunk. ## Outbound rule To reach a Synthflow agent through the new trunk, 3CX dials a real E.164 PSTN number that is attached to that agent. Buy the number from your SIP provider and assign it to an outbound rule in 3CX. You attach the same number to the agent [in Synthflow](#synthflow-number-and-agent) later. Create a new outbound rule. This example routes calls to extension **5555** as an external number through the Twilio trunk. Prepend the rule with the real E.164 number that you attach to the agent. ![](https://files.readme.io/85c0d72ed1de13c5a26e06a1b1cc4abb6101eca2b2f7e4df706269ec1b072a58-image.png) With this rule, calls from an IP phone on 3CX to extension **5555** go to `sip.synthflow.ai:32681` and dial the number `+14155550123`. The call only reaches an agent once that number is attached to it in Synthflow. ## Outbound calls from Synthflow Calls from Synthflow to the PSTN need a termination point and SIP credentials. We recommend using your SIP provider as the terminator. This guide uses Twilio, the same provider the 3CX trunk was created from. You can also terminate calls on your 3CX PBX's IP address, but that setup is more complex. If your 3CX setup requires routing outbound calls through the PBX, contact Synthflow support. ### 3CX PBX IP address In Twilio, find the IP access control lists. ![](https://files.readme.io/5f46f637d2da2a82ce9a27f53a7a73dfecacfd8e4fcb8a1c15ad85a014884b98-image.png) Open the 3CX access list, which 3CX created automatically when you connected your Twilio account. Note your 3CX PBX IP address. ![](https://files.readme.io/e220be3acb404ba3dd8f5b404862559ab3c46cc8d26dda7403a7260a7bb82b08-image.png) ### Twilio termination credentials 1. In Twilio, open the Elastic SIP Trunk section. ![](https://files.readme.io/30ef17646eae50c13f52c2f9a0ee5253682a555f33ae63fd028cc4d66ed9b170-image.png) 2. Open the trunk and go to **Termination**. Under **Authentication**, add a new **Credential List** with a new SIP username and SIP password. ![](https://files.readme.io/123ff22a5bddd3a0ab1f08be3e50a7c60e02a5a18d0c580cb876ef5982e40de7-image.png) 3. Note the **Termination URI**. This is the SIP address Synthflow sends outbound calls to. ![](https://files.readme.io/d99b4cb5b9ed9eefdf4c0e7f9d21783b8711de4d6a8a1a62a4115a34b24fc806-image.png) 4. Save the credentials. ![](https://files.readme.io/c9dcbf86e54f2fe2a4200c3a5cdc762f69416818a4718fa56b86201841488f19-image.png) ## Synthflow number and agent 1. In Synthflow, select **Phone Numbers** → **New Phone Number** → **Import a Custom Number**. Enter the number from your outbound rule, the Twilio **Termination URI** as the **SIP Domain**, and the credential list's username and password. [Add a custom number](/phone-numbers#adding-custom-numbers) explains each field. ![](https://files.readme.io/fddfab686a09c9903e0d7698f00ab0dbdc7d886c84a56cda679ae8e01e18aa66-image.png) 2. Send your 3CX PBX IP address to Synthflow support. 3. Create an inbound agent and an outbound agent, and attach the number to them. > Route calls between 3CX and Synthflow agents over a SIP trunk.