Skip to main content
SIP (Session Initiation Protocol) Trunking provides a direct connection between your telephony infrastructure and Rapida. This is ideal for organizations that already use a SIP-compatible PBX (such as FreeSWITCH, Kamailio, or hosted SIP providers) and want to connect their existing phone lines to an AI voice assistant without relying on a specific cloud telephony vendor.
SIP Trunk is a bring-your-own-carrier option. Rapida runs a native SIP server that accepts inbound SIP INVITE requests and establishes RTP media sessions directly. This provides the lowest latency path for voice AI interactions.

How It Works


Prerequisites

SIP Infrastructure

A SIP-compatible PBX, carrier, or VoIP provider that can send calls to an external SIP URI

Rapida Account

An active Rapida account with a configured voice assistant
You will need:
  • Your SIP trunk provider’s SIP URI (e.g., sip:trunk.provider.com:5060)
  • Optional SIP Username and Password if your trunk requires authentication

Step 1: Set Up Provider Credentials

Store your SIP trunk credentials in Rapida so the platform can authenticate with your SIP infrastructure.
1

Navigate to External Integrations

Go to Integration > Tools in the Rapida dashboard. You will see a grid of available external integrations.External Integrations Page
2

Select SIP Trunk

Find the SIP Trunk card and click “Setup Credential”.
3

Enter Your SIP Credentials

A modal will appear. Fill in the following fields:
FieldDescriptionRequired
Key NameA friendly name for this credential (e.g., “Office PBX”)Yes
SIP URIThe SIP trunk endpoint (e.g., sip:trunk.provider.com:5060)Yes
SIP UsernameAuthentication username for the SIP trunkNo
SIP PasswordAuthentication password for the SIP trunkNo
Click “Configure” to save.
If your SIP provider uses IP-based authentication (allow-listing Rapida’s IP), you can leave the username and password fields empty.
4

Verify Connection

After saving, the SIP Trunk card should display “Connected”. Click on it to see credential details, last updated time, and management options.

Step 2: Configure Phone Deployment

With credentials saved, configure your assistant’s phone deployment to use SIP.
1

Open Your Assistant

Navigate to Assistants and select the assistant you want to deploy via phone.
2

Go to Phone Deployment

Click “Deploy”“Phone” to open the phone deployment configuration page.
3

Select SIP Trunk as Telephony Provider

In the Telephony section:
  1. Select SIP Trunk from the telephony provider dropdown
  2. Choose the SIP credential you created in Step 1 from the Credential dropdown
  3. Enter the Caller ID — the phone number to display for outbound calls (e.g., +15551234567)
4

Configure Experience Settings

Set up the conversation experience:
SettingDescriptionDefault
GreetingThe first message the AI speaks when answering(optional)
Error MessageMessage spoken when an error occurs(optional)
Idle TimeoutSeconds before prompting an idle caller30
Idle MessageMessage spoken when caller is idle"Are you there?"
Idle Timeout RetriesHow many times to retry before ending call2
Max Call DurationMaximum call length in seconds300
5

Configure Audio Providers

Select your Speech-to-Text (STT) and Text-to-Speech (TTS) providers. These determine how audio is transcribed and synthesized during the call.
6

Save Deployment

Click “Deploy” to save. Your assistant is now ready to handle phone calls via SIP.

Step 3: Configure Your PBX / SIP Provider

Route calls from your PBX or SIP carrier to Rapida’s SIP server.
1

Create a SIP Trunk in Your PBX

In your PBX admin panel (FreeSWITCH, Asterisk, Kamailio, or hosted provider), create a new SIP trunk pointing to Rapida’s SIP endpoint.Rapida SIP Server:
sip:sip.rapida.ai:5060
Configure your trunk with:
  • Outbound Proxy: sip.rapida.ai:5060
  • Transport: UDP or TCP
  • Codec: G.711 μ-law (PCMU) preferred, G.711 A-law (PCMA) supported
2

Create a Dial Plan Rule

Add a dial plan entry that routes specific numbers or patterns to the Rapida SIP trunk.FreeSWITCH example:
<extension name="rapida-ai">
  <condition field="destination_number" expression="^(5551234567)$">
    <action application="bridge" data="sofia/external/sip:sip.rapida.ai:5060"/>
  </condition>
</extension>
Asterisk example (extensions.conf):
[rapida-trunk]
exten => _X.,1,Dial(SIP/rapida-trunk/${EXTEN})
3

Verify Routing

Place a test call to confirm the call reaches Rapida and the AI assistant answers.

Making Outbound Calls

Once your phone deployment is configured, you can initiate outbound calls through your SIP trunk using the Rapida API or SDKs.
from rapida import Rapida

client = Rapida(api_key="rpd-xxx-your-key")

call = client.calls.create(
    assistant_id=123456789,
    to_number="+15551234567",
    metadata={"campaign": "follow-up"},
)

print(f"Call queued: conversation_id={call.conversation.id}")

Features

FeatureDescription
Bring Your Own CarrierUse any SIP-compatible provider or on-premise PBX
Direct SIP ConnectionNative SIP INVITE/BYE handling with RTP media — no intermediary cloud provider
Low LatencyDirect RTP audio path minimizes round-trip delay
Inbound CallsAccept calls routed from your PBX to the AI assistant
Outbound CallsInitiate calls programmatically via SDK or API through your SIP trunk
Call RecordingAutomatic conversation capture for review and compliance
Codec SupportG.711 μ-law (PCMU), G.711 A-law (PCMA)
Flexible AuthDigest authentication or IP-based allow-listing

Supported PBX / Providers

SIP Trunk works with any standard SIP-compliant system, including:
SystemType
FreeSWITCHOpen-source softswitch
AsteriskOpen-source PBX (also has dedicated integration)
KamailioSIP proxy/router
Twilio Elastic SIPCloud SIP trunking
Vonage SIP ConnectCloud SIP trunking
BandwidthCloud SIP trunking
TelnyxCloud SIP trunking
SignalWireCloud SIP trunking
If you’re using Twilio, Vonage, Exotel, or Asterisk, consider using the dedicated integrations for those providers — they offer additional features like webhook-based call control and provider-specific optimizations.

Troubleshooting

  • Verify the SIP URI in your credential is correct and reachable
  • Check that your PBX can route to sip.rapida.ai:5060 (firewall/NAT rules)
  • If using authentication, ensure username and password are correct
  • Try both UDP and TCP transport if one doesn’t work
  • Check RTP port ranges — ensure your firewall allows UDP traffic for RTP media
  • Verify codec negotiation — Rapida supports G.711 μ-law (PCMU) and G.711 A-law (PCMA)
  • If behind NAT, ensure your PBX has proper STUN/TURN or external media IP configuration
  • Verify STT and TTS providers are configured in the phone deployment
  • Verify the SIP credential is connected in Integration > Tools
  • Ensure the phone deployment is configured and saved
  • Check that your SIP trunk allows outbound calls from Rapida’s IP
  • Use a wired network connection for your PBX when possible
  • Prefer G.711 μ-law (PCMU) codec for compatibility
  • Minimize network hops between your PBX and Rapida
  • Check for packet loss or jitter on the RTP path using network monitoring tools