GETTING STARTED

Your First Realtime AI Call

Install mod_realtime_ai, create a provider profile and connect a FreeSWITCH call to realtime AI in just a few steps.

FreeSWITCH 1.11.x · Debian 12/13 · EL9
01
INSTALL

Install mod_realtime_ai

Install the module package for your FreeSWITCH platform, then make sure mod_realtime_ai is loaded by FreeSWITCH.

Packages: Debian 12, Debian 13 and EL9 builds are available. Detailed installation instructions are provided with each distribution package. View Downloads →
02
CREATE A PROFILE

Create the FreeSWITCH Configuration

Create conf/autoload_configs/realtime_ai.conf.xml and define at least one realtime AI profile. This example creates an OpenAI profile named sales.

XML conf/autoload_configs/realtime_ai.conf.xml
<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.

03
PROVIDER CONFIGURATION

Create the Provider Configuration

Create conf/realtime_ai/sales.json. The JSON uses the native configuration format required by the selected provider.

JSON conf/realtime_ai/sales.json
{
  "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"
      }
    }
  }
}
Provider-native configuration. The JSON file follows the configuration format defined by the selected AI provider. mod_realtime_ai does not introduce a proprietary session configuration format. Refer to your provider's documentation for available options.
04
START A SESSION

Connect the Call

Start realtime AI on an active FreeSWITCH channel using the profile name.

$ uuid_realtime_ai <uuid> start sales
+OK Success
05
TALK

Your Call Is Connected

mod_realtime_ai now handles realtime audio between the FreeSWITCH call and the selected AI provider.

FreeSWITCH⇄mod_realtime_ai⇄Realtime AI
$ uuid_realtime_ai <uuid> stop

The same profile-based workflow is used with OpenAI, Google Gemini, ElevenLabs and Azure Voice Live.

NEXT STEPS

Go Deeper with the Documentation

Explore the complete API, provider configuration, profiles, audio handling, session control and troubleshooting.

Read the Documentation