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:
Use the Create a custom phone number API endpoint to import a custom phone number into your workspace.
You will need to provide:
workspace_id: Your workspace IDphone_number: The phone number to importfriendly_name (optional): A human-readable name for the phone numbertrunk_username (optional): SIP trunk username for authenticationtrunk_pwd (optional): SIP trunk password for authenticationUse the Create an agent API endpoint to create an agent and link it to the custom phone number created in Step 1. Ensure the phone number is successfully created before proceeding.
You will need to provide:
type: Set to inbound for receiving callsname: A name for your agentphone_number: The custom phone number created in Step 1voice_engine_version: Set to 2.0 for V2 agentsagent: Agent configuration including llm, language, prompt, greeting_message, and voice_idAfter 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:
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.