You can start a call from your own telephony system (e.g., Asterisk) and seamlessly transfer it to a Synthflow AI agent after the customer answers. This is useful if you want to handle your own voicemail detection or apply custom logic before handing off to the AI.
You can also pass pre-call variables into the conversation.
Before transferring the call, you must prepare it in Synthflow by making a POST request to:
This request returns a JSON response containing the synthflow_call_id that you’ll use in the next step.
Note: Extract the
synthflow_call_idfrom this response to use in the SIP transfer header.
Once your call is connected to the customer (and your custom logic has completed), you can transfer the call to Synthflow via SIP.
When initiating the SIP INVITE, include the X-EI header with the Synthflow Call ID and transfer to the Synthflow SIP endpoint:
<SYNTHFLOW_CALL_ID> with the synthflow_call_id you received from the /v2/prepare_inbound API call.<NUMBER> with the number associated with your inbound Synthflow AI Agent (must be in +E.164 format, e.g., +1234567890).X-EI header format must be exactly S.<SYNTHFLOW_CALL_ID>; (note the semicolon at the end).sip.synthflow.ai:32681 (port 32681).For Asterisk systems, you can implement the transfer like this:
This will initiate a SIP INVITE to Synthflow, carrying the context of the original call.
X-EI must include the Synthflow Call ID and the format S.<SYNTHFLOW_CALL_ID>;