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
API Base URL: https://api.synthflow.ai
Step 1: Import a Custom Phone Number
Endpoint:
POST /v2/custom-numbers
Headers:
Request Body:
trunk_usernameandtrunk_pwdare optional and can be omitted unless required for your configuration.
Step 2: Create an agent
This step creates an agent and links it to the custom phone number created in Step 1. Ensure the phone number is successfully created before proceeding.
Endpoint:
POST /v2/agents
Headers:
Request Body:
For additional fields and configurations, refer to the official API documentation.
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 Custom Variables
You can use Pre-Actions to fetch custom 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.