How to Direct SIP Dialing
In scenarios where your telephony provider does not offer elastic SIP trunking or if you have a more complex telephony setup unsuitable for elastic SIP trunking, you can use direct SIP dialing to our endpoint.
In this scenario, Synthflow does not directly place or receive calls. Rather, your telephony system manages the dialing process to connect with the specified SIP endpoint. You will need to develop the integration logic tailored to your telephony provider’s requirements. From Synthflow’s standpoint, all call interactions will be treated as incoming, so your integration must explicitly define call direction handling.
The process involves three primary steps:
- Importing a custom phone number
- Creating the agent and linking it to the phone number
- Dialing to the SIP Endpoint
Step 1: Import a Custom Phone Number
Register the number Synthflow should answer for in your workspace. This creates a custom number record your telephony system can dial into, without elastic SIP trunking on the Synthflow side. If your carrier or PBX requires outbound SIP registration before it routes calls, set uac_enabled to true and provide trunk credentials.
Expand the endpoint below to send a test request, then use the table for the fields most relevant to direct SIP dialing.
Step 2: Create an agent
Create an inbound agent and attach the custom phone number from Step 1. Synthflow treats every call that reaches that number as incoming, so set type to inbound. Wait until Step 1 succeeds before you send this request.
Expand the endpoint below to try the call, then use the table for the minimum fields needed in this flow.
Step 3: Configure Twilio
After the trunk is set up on SynthFlow, redirect Twilio calls to it using TwiML commands. Be sure to include the GHL unique call ID or Twilio Call SID in the SIP header using the X-EI key.
Javascript Example:
Python Example:
Pre-actions with pre-call variables
You can use Pre-Actions to fetch pre-call variables via API and incorporate them into the agent prompt for more personalized responses by using the <twilio_call_sid> verb in API request.
Note: The transfer call will work the same as before.