Install mod_realtime_ai, create a provider profile and connect a FreeSWITCH call to realtime AI in just a few steps.
Install the module package for your FreeSWITCH platform, then make sure
mod_realtime_ai is loaded by FreeSWITCH.
Create conf/autoload_configs/realtime_ai.conf.xml and define at least one
realtime AI profile. This example creates an OpenAI profile named sales.
<configuration name="realtime_ai.conf" description="Realtime AI">
<profiles>
<profile name="sales">
<param name="provider" value="openai"/>
<param name="api-key" value=""/>
<param name="config" value="sales.json"/>
<param name="model" value="gpt-realtime-2.1"/>
</profile>
</profiles>
</configuration>
Add your provider API key to api-key. A single configuration file can
contain as many provider profiles as you need.
Create conf/realtime_ai/sales.json. The JSON uses the native configuration
format required by the selected provider.
{
"type": "session.update",
"session": {
"type": "realtime",
"instructions": "You are a helpful voice assistant.",
"output_modalities": ["audio"],
"audio": {
"input": {
"format": {
"type": "audio/pcma"
},
"turn_detection": {
"type": "server_vad",
"threshold": 0.7,
"prefix_padding_ms": 300,
"silence_duration_ms": 500,
"create_response": true,
"interrupt_response": true
}
},
"output": {
"format": {
"type": "audio/pcma"
},
"voice": "marin"
}
}
}
}
Start realtime AI on an active FreeSWITCH channel using the profile name.
mod_realtime_ai now handles realtime audio between the FreeSWITCH call and the selected AI provider.
The same profile-based workflow is used with OpenAI, Google Gemini, ElevenLabs and Azure Voice Live.
Explore the complete API, provider configuration, profiles, audio handling, session control and troubleshooting.
Read the Documentation